Go to the documentation of this file.
41 #ifndef __CPU_O3_FETCH_HH__
42 #define __CPU_O3_FETCH_HH__
44 #include "arch/decoder.hh"
45 #include "arch/utility.hh"
47 #include "config/the_isa.hh"
52 #include "enums/FetchPolicy.hh"
58 struct DerivO3CPUParams;
75 typedef typename Impl::CPUPol
CPUPol;
78 typedef typename Impl::O3CPU
O3CPU;
131 fetch->finishTranslation(fault, req);
171 return "FullO3CPU FetchFinishTranslation";
223 std::string
name()
const;
368 void fetch(
bool &status_change);
609 #endif //__CPU_O3_FETCH_HH__
Stats::Scalar cycles
Stat for total number of cycles spent fetching.
CPUPol::FetchStruct FetchStruct
Typedefs from the CPU policy.
void switchToActive()
Changes the status of this stage to active, and indicates this to the CPU.
Stats::Scalar pendingQuiesceStallCycles
Total number of stall cycles caused by pending quiesce instructions.
StaticInstPtr macroop[Impl::MaxThreads]
FullO3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time ...
FetchTranslation(DefaultFetch< Impl > *_fetch)
void setReq(const RequestPtr &_req)
ThreadID getFetchingThread()
Returns the appropriate thread to fetch, given the fetch policy.
Cycles commitToFetchDelay
Commit to fetch delay.
Addr fetchBufferAlignPC(Addr addr)
Align a PC to the start of a fetch buffer block.
Stats::Scalar tlbSquashes
Total number of outstanding tlb accesses that were dropped due to a squash.
void switchToInactive()
Changes the status of this stage to inactive, and indicates this to the CPU.
FinishTranslationEvent finishTranslationEvent
Event used to delay fault generation of translation faults.
Stats::Scalar predictedBranches
Stat for total number of predicted branches.
int16_t ThreadID
Thread index/ID type.
Addr fetchOffset[Impl::MaxThreads]
FetchStatus
Overall fetch status.
void takeOverFrom()
Takes over from another CPU's thread.
Stats::Scalar pendingTrapStallCycles
Total number of stall cycles caused by pending traps.
void regProbePoints()
Registers probes.
DefaultFetch::FetchStatGroup fetchStats
FetchPolicy fetchPolicy
Fetch policy.
void squashFromDecode(const TheISA::PCState &newPC, const DynInstPtr squashInst, const InstSeqNum seq_num, ThreadID tid)
Squashes a specific thread and resets the PC.
unsigned decodeWidth
The width of decode in instructions.
std::shared_ptr< Request > RequestPtr
bool fetchBufferValid[Impl::MaxThreads]
Whether or not the fetch buffer data is valid.
unsigned int cacheBlkSize
Cache block size.
Addr fetchBufferPC[Impl::MaxThreads]
The PC of the first instruction loaded into the fetch buffer.
Stats::Scalar cacheLines
Stat for total number of fetched cache lines.
Stats::Formula branchRate
Number of branch fetches per cycle.
TimeBuffer< TimeStruct >::wire fromIEW
Wire to get iew's information from backwards time buffer.
void deactivateThread(ThreadID tid)
For priority-based fetch policies, need to keep update priorityList.
void markDelayed()
Signal that the translation has been delayed due to a hw page table walk.
ThreadID numFetchingThreads
Number of threads that are actively fetching.
Stats::Scalar noActiveThreadStallCycles
Total number of stall cycles caused by no active threads to run.
void tick()
Ticks the fetch stage, processing all inputs signals and fetching as many instructions as possible.
TheISA::Decoder * decoder[Impl::MaxThreads]
The decoder.
ThreadID roundRobin()
Returns the appropriate thread to fetch using a round robin policy.
bool wroteToTimeBuffer
Variable that tracks if fetch has written to the time buffer this cycle.
int instSize
Size of instructions.
void wakeFromQuiesce()
Tells fetch to wake up from a quiesce instruction.
void pipelineIcacheAccesses(ThreadID tid)
Pipeline the next I-cache access to the current one.
void resetStage()
Reset this pipeline stage.
RequestPtr memReq[Impl::MaxThreads]
Memory request used to access cache.
Stats::Scalar squashCycles
Stat for total number of cycles spent squashing.
ThreadID retryTid
The thread that is waiting on the cache to tell fetch to retry.
This is a simple scalar statistic, like a counter.
void doSquash(const TheISA::PCState &newPC, const DynInstPtr squashInst, ThreadID tid)
Squashes a specific thread and resets the PC.
ThreadID lsqCount()
Returns the appropriate thread to fetch using the LSQ count policy.
int64_t Counter
Statistics counter type.
bool isDrained() const
Has the stage drained?
IcachePort icachePort
Instruction port.
TimeBuffer< TimeStruct >::wire fromDecode
Wire to get decode's information from backwards time buffer.
Stats::Scalar insts
Stat for total number of fetched instructions.
bool fetchCacheLine(Addr vaddr, ThreadID tid, Addr pc)
Fetches the cache line that contains the fetch PC.
Stats::Scalar miscStallCycles
Total number of cycles spent in any other state.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to list of active threads.
ThreadID branchCount()
Returns the appropriate thread to fetch using the branch count policy.
std::string name() const
Returns the name of fetch.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
IcachePort(DefaultFetch< Impl > *_fetch, FullO3CPU< Impl > *_cpu)
Default constructor.
bool issuePipelinedIfetch[Impl::MaxThreads]
Set to true if a pipelined I-cache request should be issued.
void recvReqRetry()
Handles retrying the fetch access.
Cycles decodeToFetchDelay
Decode to fetch delay.
std::shared_ptr< FaultBase > Fault
void setFetchQueue(TimeBuffer< FetchStruct > *fq_ptr)
Sets pointer to time buffer used to communicate to the next stage.
CPUPol::TimeStruct TimeStruct
Cycles iewToFetchDelay
IEW to fetch delay.
void startupStage()
Initialize stage.
Basically a wrapper class to hold both the branch predictor and the BTB.
TimeBuffer< TimeStruct > * timeBuffer
Time buffer interface.
Cycles renameToFetchDelay
Rename to fetch delay.
const char * description() const
Return a C string describing the event.
FinishTranslationEvent(DefaultFetch< Impl > *_fetch)
bool cacheBlocked
Is the cache blocked? If so no threads can access it.
bool checkSignalsAndUpdate(ThreadID tid)
Checks all input signals and updates the status as necessary.
Stats::Scalar branches
Total number of fetched branches.
Source of possible stalls.
void drainSanityCheck() const
Perform sanity checks after a drain.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Stats::Scalar blockedCycles
Total number of cycles spent blocked.
Stats::Formula rate
Number of instruction fetched per cycle.
DynInstPtr buildInst(ThreadID tid, StaticInstPtr staticInst, StaticInstPtr curMacroop, TheISA::PCState thisPC, TheISA::PCState nextPC, bool trace)
Stats::Distribution nisnDist
Distribution of number of instructions fetched each cycle.
IcachePort class for instruction fetch.
void drainStall(ThreadID tid)
Stall the fetch stage after reaching a safe drain point.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const std::string name() const
Return port name (for DPRINTF).
A simple distribution stat.
FetchStatus updateFetchStatus()
Updates overall fetch stage status; to be called at the end of each cycle.
ProbePointArg< RequestPtr > * ppFetchRequestSent
To probe when a fetch request is successfully sent.
DefaultFetch class handles both single threaded and SMT fetch.
bool delayedCommit[Impl::MaxThreads]
Can the fetch stage redirect from an interrupt on this instruction?
Stats::Scalar pendingDrainCycles
Total number of cycles spent in waiting for drains.
ProbePointArg< DynInstPtr > * ppFetch
Probe points.
bool lookupAndUpdateNextPC(const DynInstPtr &inst, TheISA::PCState &pc)
Looks up in the branch predictor to see if the next PC should be either next PC+=MachInst or a branch...
TimeBuffer< FetchStruct >::wire toDecode
Wire used to write any information heading to decode.
unsigned fetchWidth
The width of fetch in instructions.
void setFault(Fault _fault)
Stats::Scalar idleCycles
Stat for total number of cycles spent blocked due to other stages in the pipeline.
TheISA::MachInst MachInst
Typedefs from ISA.
FetchStatGroup(O3CPU *cpu, DefaultFetch *fetch)
Impl::CPUPol CPUPol
Typedefs from Impl.
std::list< ThreadID > priorityList
List that has the threads organized by priority.
void process()
Process the delayed finish translation.
void fetch(bool &status_change)
Does the actual fetching of instructions and passing them on to the next stage.
bool interruptPending
Checks if there is an interrupt pending.
virtual void recvReqRetry()
Handles doing a retry of a failed fetch.
void profileStall(ThreadID tid)
Profile the reasons of fetch stall.
ThreadID numThreads
Number of threads.
void clearStates(ThreadID tid)
Clear all thread-specific states.
GenericISA::DelaySlotPCState< MachInst > PCState
void drainResume()
Resume after a drain.
void finishTranslation(const Fault &fault, const RequestPtr &mem_req)
DefaultFetch< Impl > * fetch
unsigned fetchQueueSize
The size of the fetch queue in micro-ops.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Stats::Scalar tlbCycles
Stat for total number of cycles spent waiting for translation.
Stats::Scalar icacheSquashes
Total number of outstanding icache accesses that were dropped due to a squash.
Stats::Formula idleRate
Rate of how often fetch was idle.
TimeBuffer< TimeStruct >::wire fromRename
Wire to get rename's information from backwards time buffer.
Addr fetchBufferMask
Mask to align a fetch address to a fetch buffer boundary.
ThreadStatus
Individual thread status.
Cycles is a wrapper class for representing cycle counts, i.e.
void setTimeBuffer(TimeBuffer< TimeStruct > *time_buffer)
Sets the main backwards communication time buffer pointer.
ThreadID threadFetched
Thread ID being fetched.
Stats::Scalar icacheWaitRetryStallCycles
Total number of stall cycles caused by I-cache wait retrys.
void processCacheCompletion(PacketPtr pkt)
Processes cache completion event.
TheISA::PCState pc[Impl::MaxThreads]
std::deque< DynInstPtr > fetchQueue[Impl::MaxThreads]
Queue of fetched instructions.
ThreadID iqCount()
Returns the appropriate thread to fetch using the IQ count policy.
O3CPU * cpu
Pointer to the O3CPU.
DefaultFetch(O3CPU *_cpu, DerivO3CPUParams *params)
DefaultFetch constructor.
DefaultFetch< Impl > * fetch
void finish(const Fault &fault, const RequestPtr &req, ThreadContext *tc, BaseTLB::Mode mode)
BPredUnit * branchPred
BPredUnit.
int numInst
Tracks how many instructions has been fetched this cycle.
uint8_t * fetchBuffer[Impl::MaxThreads]
The fetch data that is being fetched and buffered.
FetchStatus _status
Fetch status.
virtual bool recvTimingResp(PacketPtr pkt)
Timing version of receive.
Stalls stalls[Impl::MaxThreads]
Tracks which stages are telling fetch to stall.
PacketPtr retryPkt
The packet that is waiting to be retried.
bool checkStall(ThreadID tid) const
Checks if a thread is stalled.
Stats::Scalar icacheStallCycles
Stat for total number of cycles stalled due to an icache miss.
Counter lastIcacheStall[Impl::MaxThreads]
Icache stall statistics.
bool checkInterrupt(Addr pc)
Check if an interrupt is pending and that we need to handle.
ThreadStatus fetchStatus[Impl::MaxThreads]
Per-thread status.
std::list< ThreadID > * activeThreads
List of Active Threads.
DefaultFetch< Impl > * fetch
Pointer to fetch.
RequestPort & getInstPort()
void squash(const TheISA::PCState &newPC, const InstSeqNum seq_num, DynInstPtr squashInst, ThreadID tid)
Squashes a specific thread and resets the PC.
unsigned fetchBufferSize
The size of the fetch buffer in bytes.
TimeBuffer< TimeStruct >::wire fromCommit
Wire to get commit's information from backwards time buffer.
Impl::DynInstPtr DynInstPtr
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17