43 #ifndef __CPU_O3_DECODE_HH__
44 #define __CPU_O3_DECODE_HH__
51 struct DerivO3CPUParams;
65 typedef typename Impl::O3CPU
O3CPU;
67 typedef typename Impl::CPUPol
CPUPol;
108 std::string
name()
const;
239 std::queue<DynInstPtr>
insts[Impl::MaxThreads];
321 #endif // __CPU_O3_DECODE_HH__
TimeBuffer< TimeStruct > * timeBuffer
Time buffer interface.
Cycles fetchToDecodeDelay
Fetch to decode delay.
void decode(bool &status_change, ThreadID tid)
Determines what to do based on decode's current status.
ThreadID numThreads
number of Active Threads
unsigned toRenameIndex
Index of instructions being sent to rename.
void setDecodeQueue(TimeBuffer< DecodeStruct > *dq_ptr)
Sets pointer to time buffer used to communicate to the next stage.
bool wroteToTimeBuffer
Variable that tracks if decode has written to the time buffer this cycle.
Cycles is a wrapper class for representing cycle counts, i.e.
void sortInsts()
Separates instructions from fetch into individual lists of instructions sorted by thread...
DynInstPtr squashInst[Impl::MaxThreads]
Instruction used for squashing branch (used for MIPS)
Stalls stalls[Impl::MaxThreads]
Tracks which stages are telling decode to stall.
bool squashAfterDelaySlot[Impl::MaxThreads]
Tells when their is a pending delay slot inst.
Cycles iewToDecodeDelay
IEW to decode delay.
Stats::Scalar decodeBlockedCycles
Stat for total number of blocked cycles.
bool isDrained() const
Has the stage drained?
void takeOverFrom()
Takes over from another CPU's thread.
DecodeStatus
Overall decode stage status.
TimeBuffer< DecodeStruct >::wire toRename
Wire used to write any information heading to rename.
void tick()
Ticks decode, processing all input signals and decoding as many instructions as possible.
DefaultDecode(O3CPU *_cpu, DerivO3CPUParams *params)
DefaultDecode constructor.
DefaultDecode class handles both single threaded and SMT decode.
bool skidsEmpty()
Returns if all of the skid buffers are empty.
void skidInsert(ThreadID tid)
Inserts a thread's instructions into the skid buffer, to be decoded once decode unblocks.
unsigned decodeWidth
The width of decode, in instructions.
Declaration of Statistics objects.
TimeBuffer< TimeStruct >::wire fromIEW
Wire to get iew's information from backwards time buffer.
This is a simple scalar statistic, like a counter.
Stats::Scalar decodeUnblockCycles
Stat for total number of unblocking cycles.
void regStats()
Registers statistics.
CPUPol::FetchStruct FetchStruct
ThreadStatus decodeStatus[Impl::MaxThreads]
Per-thread status.
unsigned skidBufferMax
Maximum size of the skid buffer.
TimeBuffer< TimeStruct >::wire fromRename
Wire to get rename's output from backwards time buffer.
std::string name() const
Returns the name of decode.
std::list< ThreadID > * activeThreads
List of active thread ids.
Stats::Scalar decodeSquashCycles
Stat for total number of squashing cycles.
Stats::Scalar decodeControlMispred
Stat for number of times decode detected a non-control instruction incorrectly predicted as a branch...
void drainSanityCheck() const
Perform sanity checks after a drain.
CPUPol::DecodeStruct DecodeStruct
TimeBuffer< DecodeStruct > * decodeQueue
Decode instruction queue.
Addr bdelayDoneSeqNum[Impl::MaxThreads]
SeqNum of Squashing Branch Delay Instruction (used for MIPS)
void squash(DynInstPtr &inst, ThreadID tid)
Squashes if there is a PC-relative branch that was predicted incorrectly.
Stats::Scalar decodeBranchResolved
Stat for number of times a branch is resolved at decode.
bool checkStall(ThreadID tid) const
Checks all stall signals, and returns if any are true.
void readStallSignals(ThreadID tid)
Reads all stall signals from the backwards communication timebuffer.
TimeBuffer< TimeStruct >::wire fromCommit
Wire to get commit's information from backwards time buffer.
Impl::DynInstPtr DynInstPtr
Stats::Scalar decodeIdleCycles
Stat for total number of idle cycles.
O3CPU * cpu
CPU interface.
Stats::Scalar decodeSquashedInsts
Stat for total number of squashed instructions.
bool block(ThreadID tid)
Switches decode to blocking, and signals back that decode has become blocked.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to list of active threads.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Source of possible stalls.
void decodeInsts(ThreadID tid)
Processes instructions from fetch and passes them on to rename.
int16_t ThreadID
Thread index/ID type.
TimeBuffer< TimeStruct >::wire toFetch
Wire to write information heading to previous stages.
std::queue< DynInstPtr > insts[Impl::MaxThreads]
Queue of all instructions coming from fetch this cycle.
std::queue< DynInstPtr > skidBuffer[Impl::MaxThreads]
Skid buffer between fetch and decode.
Stats::Scalar decodeBranchMispred
Stat for number of times a branch mispredict is detected.
bool checkSignalsAndUpdate(ThreadID tid)
Checks all input signals and updates decode's status appropriately.
DecodeStatus _status
Decode status.
CPUPol::TimeStruct TimeStruct
Cycles commitToDecodeDelay
Commit to decode delay.
Stats::Scalar decodeRunCycles
Stat for total number of normal running cycles.
void setFetchQueue(TimeBuffer< FetchStruct > *fq_ptr)
Sets pointer to time buffer coming from fetch.
bool unblock(ThreadID tid)
Switches decode to unblocking if the skid buffer is empty, and signals back that decode has unblocked...
ThreadStatus
Individual thread status.
TimeBuffer< FetchStruct >::wire fromFetch
Wire to get fetch's output from fetch queue.
Stats::Scalar decodeDecodedInsts
Stat for total number of decoded instructions.
void updateStatus()
Updates overall decode status based on all of the threads' statuses.
TimeBuffer< FetchStruct > * fetchQueue
Fetch instruction queue interface.
Cycles renameToDecodeDelay
Rename to decode delay.
void setTimeBuffer(TimeBuffer< TimeStruct > *tb_ptr)
Sets the main backwards communication time buffer pointer.
bool fetchInstsValid()
Returns if there any instructions from fetch on this cycle.