rename.hh

来自「M5,一个功能强大的多处理器系统模拟器.很多针对处理器架构,性能的研究都使用它作」· HH 代码 · 共 484 行 · 第 1/2 页

HH
484
字号
    /** Returns the number of valid instructions coming from decode. */    unsigned validInsts();    /** Reads signals telling rename to block/unblock. */    void readStallSignals(unsigned tid);    /** Checks if any stages are telling rename to block. */    bool checkStall(unsigned tid);    /** Gets the number of free entries for a specific thread. */    void readFreeEntries(unsigned tid);    /** Checks the signals and updates the status. */    bool checkSignalsAndUpdate(unsigned tid);    /** Either serializes on the next instruction available in the InstQueue,     * or records that it must serialize on the next instruction to enter     * rename.     * @param inst_list The list of younger, unprocessed instructions for the     * thread that has the serializeAfter instruction.     * @param tid The thread id.     */    void serializeAfter(InstQueue &inst_list, unsigned tid);    /** Holds the information for each destination register rename. It holds     * the instruction's sequence number, the arch register, the old physical     * register for that arch. register, and the new physical register.     */    struct RenameHistory {        RenameHistory(InstSeqNum _instSeqNum, RegIndex _archReg,                      PhysRegIndex _newPhysReg, PhysRegIndex _prevPhysReg)            : instSeqNum(_instSeqNum), archReg(_archReg),              newPhysReg(_newPhysReg), prevPhysReg(_prevPhysReg)        {        }        /** The sequence number of the instruction that renamed. */        InstSeqNum instSeqNum;        /** The architectural register index that was renamed. */        RegIndex archReg;        /** The new physical register that the arch. register is renamed to. */        PhysRegIndex newPhysReg;        /** The old physical register that the arch. register was renamed to. */        PhysRegIndex prevPhysReg;    };    /** A per-thread list of all destination register renames, used to either     * undo rename mappings or free old physical registers.     */    std::list<RenameHistory> historyBuffer[Impl::MaxThreads];    /** Pointer to CPU. */    O3CPU *cpu;    /** Pointer to main time buffer used for backwards communication. */    TimeBuffer<TimeStruct> *timeBuffer;    /** Wire to get IEW's output from backwards time buffer. */    typename TimeBuffer<TimeStruct>::wire fromIEW;    /** Wire to get commit's output from backwards time buffer. */    typename TimeBuffer<TimeStruct>::wire fromCommit;    /** Wire to write infromation heading to previous stages. */    typename TimeBuffer<TimeStruct>::wire toDecode;    /** Rename instruction queue. */    TimeBuffer<RenameStruct> *renameQueue;    /** Wire to write any information heading to IEW. */    typename TimeBuffer<RenameStruct>::wire toIEW;    /** Decode instruction queue interface. */    TimeBuffer<DecodeStruct> *decodeQueue;    /** Wire to get decode's output from decode queue. */    typename TimeBuffer<DecodeStruct>::wire fromDecode;    /** Queue of all instructions coming from decode this cycle. */    InstQueue insts[Impl::MaxThreads];    /** Skid buffer between rename and decode. */    InstQueue skidBuffer[Impl::MaxThreads];    /** Rename map interface. */    RenameMap *renameMap[Impl::MaxThreads];    /** Free list interface. */    FreeList *freeList;    /** Pointer to the list of active threads. */    std::list<unsigned> *activeThreads;    /** Pointer to the scoreboard. */    Scoreboard *scoreboard;    /** Count of instructions in progress that have been sent off to the IQ     * and ROB, but are not yet included in their occupancy counts.     */    int instsInProgress[Impl::MaxThreads];    /** Variable that tracks if decode has written to the time buffer this     * cycle. Used to tell CPU if there is activity this cycle.     */    bool wroteToTimeBuffer;    /** Structures whose free entries impact the amount of instructions that     * can be renamed.     */    struct FreeEntries {        unsigned iqEntries;        unsigned lsqEntries;        unsigned robEntries;    };    /** Per-thread tracking of the number of free entries of back-end     * structures.     */    FreeEntries freeEntries[Impl::MaxThreads];    /** Records if the ROB is empty. In SMT mode the ROB may be dynamically     * partitioned between threads, so the ROB must tell rename when it is     * empty.     */    bool emptyROB[Impl::MaxThreads];    /** Source of possible stalls. */    struct Stalls {        bool iew;        bool commit;    };    /** Tracks which stages are telling decode to stall. */    Stalls stalls[Impl::MaxThreads];    /** The serialize instruction that rename has stalled on. */    DynInstPtr serializeInst[Impl::MaxThreads];    /** Records if rename needs to serialize on the next instruction for any     * thread.     */    bool serializeOnNextInst[Impl::MaxThreads];    /** Delay between iew and rename, in ticks. */    int iewToRenameDelay;    /** Delay between decode and rename, in ticks. */    int decodeToRenameDelay;    /** Delay between commit and rename, in ticks. */    unsigned commitToRenameDelay;    /** Rename width, in instructions. */    unsigned renameWidth;    /** Commit width, in instructions.  Used so rename knows how many     *  instructions might have freed registers in the previous cycle.     */    unsigned commitWidth;    /** The index of the instruction in the time buffer to IEW that rename is     * currently using.     */    unsigned toIEWIndex;    /** Whether or not rename needs to block this cycle. */    bool blockThisCycle;    /** Whether or not rename needs to resume a serialize instruction     * after squashing. */    bool resumeSerialize;    /** Whether or not rename needs to resume clearing out the skidbuffer     * after squashing. */    bool resumeUnblocking;    /** The number of threads active in rename. */    unsigned numThreads;    /** The maximum skid buffer size. */    unsigned skidBufferMax;    PhysRegIndex maxPhysicalRegs;    /** Enum to record the source of a structure full stall.  Can come from     * either ROB, IQ, LSQ, and it is priortized in that order.     */    enum FullSource {        ROB,        IQ,        LSQ,        NONE    };    /** Function used to increment the stat that corresponds to the source of     * the stall.     */    inline void incrFullStat(const FullSource &source);    /** Stat for total number of cycles spent squashing. */    Stats::Scalar<> renameSquashCycles;    /** Stat for total number of cycles spent idle. */    Stats::Scalar<> renameIdleCycles;    /** Stat for total number of cycles spent blocking. */    Stats::Scalar<> renameBlockCycles;    /** Stat for total number of cycles spent stalling for a serializing inst. */    Stats::Scalar<> renameSerializeStallCycles;    /** Stat for total number of cycles spent running normally. */    Stats::Scalar<> renameRunCycles;    /** Stat for total number of cycles spent unblocking. */    Stats::Scalar<> renameUnblockCycles;    /** Stat for total number of renamed instructions. */    Stats::Scalar<> renameRenamedInsts;    /** Stat for total number of squashed instructions that rename discards. */    Stats::Scalar<> renameSquashedInsts;    /** Stat for total number of times that the ROB starts a stall in rename. */    Stats::Scalar<> renameROBFullEvents;    /** Stat for total number of times that the IQ starts a stall in rename. */    Stats::Scalar<> renameIQFullEvents;    /** Stat for total number of times that the LSQ starts a stall in rename. */    Stats::Scalar<> renameLSQFullEvents;    /** Stat for total number of times that rename runs out of free registers     * to use to rename. */    Stats::Scalar<> renameFullRegistersEvents;    /** Stat for total number of renamed destination registers. */    Stats::Scalar<> renameRenamedOperands;    /** Stat for total number of source register rename lookups. */    Stats::Scalar<> renameRenameLookups;    /** Stat for total number of committed renaming mappings. */    Stats::Scalar<> renameCommittedMaps;    /** Stat for total number of mappings that were undone due to a squash. */    Stats::Scalar<> renameUndoneMaps;    /** Number of serialize instructions handled. */    Stats::Scalar<> renamedSerializing;    /** Number of instructions marked as temporarily serializing. */    Stats::Scalar<> renamedTempSerializing;    /** Number of instructions inserted into skid buffers. */    Stats::Scalar<> renameSkidInsts;};#endif // __CPU_O3_RENAME_HH__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?