Go to the documentation of this file.
59 #include "debug/Activity.hh"
60 #include "debug/Drain.hh"
61 #include "debug/Fetch.hh"
62 #include "debug/O3CPU.hh"
63 #include "debug/O3PipeView.hh"
65 #include "params/BaseO3CPU.hh"
105 fatal(
"numThreads (%d) is larger than compiled limit (%d),\n"
106 "\tincrease MaxThreads in src/cpu/o3/limits.hh\n",
109 fatal(
"fetchWidth (%d) is larger than compiled limit (%d),\n"
110 "\tincrease MaxWidth in src/cpu/o3/limits.hh\n",
113 fatal(
"fetch buffer size (%u bytes) is greater than the cache "
116 fatal(
"cache block (%u bytes) is not a multiple of the "
122 pc[
i].reset(params.isa[0]->newPCState());
138 decoder[tid] = params.decoder[tid];
160 : statistics::
Group(cpu,
"fetch"),
162 "Number of branches that fetch has predicted taken"),
163 ADD_STAT(cycles, statistics::units::Cycle::get(),
164 "Number of cycles fetch has run and was not squashing or "
166 ADD_STAT(squashCycles, statistics::units::Cycle::get(),
167 "Number of cycles fetch has spent squashing"),
168 ADD_STAT(tlbCycles, statistics::units::Cycle::get(),
169 "Number of cycles fetch has spent waiting for tlb"),
170 ADD_STAT(idleCycles, statistics::units::Cycle::get(),
171 "Number of cycles fetch was idle"),
172 ADD_STAT(blockedCycles, statistics::units::Cycle::get(),
173 "Number of cycles fetch has spent blocked"),
174 ADD_STAT(miscStallCycles, statistics::units::Cycle::get(),
175 "Number of cycles fetch has spent waiting on interrupts, or bad "
176 "addresses, or out of MSHRs"),
177 ADD_STAT(pendingDrainCycles, statistics::units::Cycle::get(),
178 "Number of cycles fetch has spent waiting on pipes to drain"),
179 ADD_STAT(noActiveThreadStallCycles, statistics::units::Cycle::get(),
180 "Number of stall cycles due to no active thread to fetch from"),
181 ADD_STAT(pendingTrapStallCycles, statistics::units::Cycle::get(),
182 "Number of stall cycles due to pending traps"),
183 ADD_STAT(pendingQuiesceStallCycles, statistics::units::Cycle::get(),
184 "Number of stall cycles due to pending quiesce instructions"),
185 ADD_STAT(icacheWaitRetryStallCycles, statistics::units::Cycle::get(),
186 "Number of stall cycles due to full MSHR"),
188 "Number of cache lines fetched"),
190 "Number of outstanding Icache misses that were squashed"),
192 "Number of outstanding ITLB misses that were squashed"),
194 "Number of instructions fetched each cycle (Total)"),
195 ADD_STAT(idleRate, statistics::units::Ratio::get(),
196 "Ratio of cycles fetch was idle",
197 idleCycles / cpu->baseStats.numCycles)
331 DPRINTF(
Fetch,
"[tid:%i] Waking up from cache miss.\n", tid);
350 DPRINTF(Activity,
"[tid:%i] Activating fetch due to cache completion\n",
362 pkt->
req->setAccessLatency();
437 assert(!
stalls[tid].drain);
438 DPRINTF(Drain,
"%i: Thread drained.\n", tid);
455 DPRINTF(Activity,
"Activating stage.\n");
467 DPRINTF(Activity,
"Deactivating stage.\n");
493 if (!inst->isControl()) {
494 inst->staticInst->advancePC(next_pc);
495 inst->setPredTarg(next_pc);
496 inst->setPredTaken(
false);
506 "predicted to be taken to %s\n",
507 tid, inst->seqNum, inst->pcState().instAddr(), next_pc);
510 "predicted to be not taken\n",
511 tid, inst->seqNum, inst->pcState().instAddr());
515 "predicted to go to %s\n",
516 tid, inst->seqNum, inst->pcState().instAddr(), next_pc);
517 inst->setPredTarg(next_pc);
518 inst->setPredTaken(predict_taken);
526 return predict_taken;
539 DPRINTF(
Fetch,
"[tid:%i] Can't fetch cache line, cache blocked\n",
547 DPRINTF(
Fetch,
"[tid:%i] Can't fetch cache line, interrupt pending\n",
555 DPRINTF(
Fetch,
"[tid:%i] Fetching cache line %#x for addr %#x\n",
556 tid, fetchBufferBlockPC,
vaddr);
561 RequestPtr mem_req = std::make_shared<Request>(
582 Addr fetchBufferBlockPC = mem_req->getVaddr();
590 mem_req->getVaddr() !=
memReq[tid]->getVaddr()) {
591 DPRINTF(
Fetch,
"[tid:%i] Ignoring itlb completed after squash\n",
604 warn(
"Address %#x is outside of physical memory, stopping fetch\n",
605 mem_req->getPaddr());
633 DPRINTF(Activity,
"[tid:%i] Activity: Waiting on I-cache "
653 "[tid:%i] Got back req with addr %#x but expected %#x\n",
654 tid, mem_req->getVaddr(),
memReq[tid]->getVaddr());
663 DPRINTF(
Fetch,
"[tid:%i] Translation faulted, building noop.\n", tid);
666 fetch_pc, fetch_pc,
false);
667 instruction->setNotAnInst();
669 instruction->setPredTarg(fetch_pc);
670 instruction->fault = fault;
673 DPRINTF(Activity,
"Activity this cycle.\n");
678 DPRINTF(
Fetch,
"[tid:%i] Blocked, need to handle the trap.\n", tid);
679 DPRINTF(
Fetch,
"[tid:%i] fault (%s) detected @ PC %s.\n",
680 tid, fault->
name(), *
pc[tid]);
689 DPRINTF(
Fetch,
"[tid:%i] Squashing, setting PC to: %s.\n",
692 set(
pc[tid], new_pc);
694 if (squashInst && squashInst->pcState().instAddr() == new_pc.
instAddr())
695 macroop[tid] = squashInst->macroop;
702 DPRINTF(
Fetch,
"[tid:%i] Squashing outstanding Icache miss.\n",
706 DPRINTF(
Fetch,
"[tid:%i] Squashing outstanding ITLB miss.\n",
740 DPRINTF(
Fetch,
"[tid:%i] Squashing from decode.\n", tid);
752 bool ret_val =
false;
770 while (threads != end) {
778 DPRINTF(Activity,
"[tid:%i] Activating stage.\n",tid);
781 DPRINTF(Activity,
"[tid:%i] Activating fetch due to cache"
794 DPRINTF(Activity,
"Deactivating stage.\n");
819 bool status_change =
false;
827 while (threads != end) {
833 status_change = status_change || updated_status;
839 if (
fromCommit->commitInfo[0].interruptPending) {
843 if (
fromCommit->commitInfo[0].clearInterrupt) {
851 fetch(status_change);
871 unsigned insts_to_decode = 0;
872 unsigned available_insts = 0;
875 if (!
stalls[tid].decode) {
882 std::advance(tid_itr,
885 while (available_insts != 0 && insts_to_decode <
decodeWidth) {
890 DPRINTF(
Fetch,
"[tid:%i] [sn:%llu] Sending instruction to decode "
891 "from fetch queue. Fetch queue size: %i.\n",
908 DPRINTF(Activity,
"Activity this cycle.\n");
925 assert(
stalls[tid].decode);
933 DPRINTF(
Fetch,
"[tid:%i] Squashing instructions due to squash "
934 "from commit.\n",tid);
943 if (
fromCommit->commitInfo[tid].mispredictInst &&
944 fromCommit->commitInfo[tid].mispredictInst->isControl()) {
947 fromCommit->commitInfo[tid].branchTaken, tid);
954 }
else if (
fromCommit->commitInfo[tid].doneSeqNum) {
962 DPRINTF(
Fetch,
"[tid:%i] Squashing instructions due to squash "
963 "from decode.\n",tid);
966 if (
fromDecode->decodeInfo[tid].branchMispredict) {
969 fromDecode->decodeInfo[tid].branchTaken, tid);
1005 DPRINTF(
Fetch,
"[tid:%i] Done squashing, switching to running.\n",
1032 arrays, staticInst, curMacroop, this_pc, next_pc, seq,
cpu);
1033 instruction->setTid(tid);
1035 instruction->setThreadState(
cpu->
thread[tid]);
1037 DPRINTF(
Fetch,
"[tid:%i] Instruction PC %s created [sn:%lli].\n",
1041 instruction->staticInst->disassemble(this_pc.
instAddr()));
1045 instruction->traceData =
1047 instruction->staticInst, this_pc, curMacroop);
1050 instruction->traceData = NULL;
1054 instruction->setInstListIt(
cpu->
addInst(instruction));
1061 DPRINTF(
Fetch,
"[tid:%i] Fetch queue entry created (%i/%i).\n",
1092 DPRINTF(
Fetch,
"Attempting to fetch from [tid:%i]\n", tid);
1106 DPRINTF(
Fetch,
"[tid:%i] Icache miss is complete.\n", tid);
1109 status_change =
true;
1120 DPRINTF(
Fetch,
"[tid:%i] Attempting to translate and read "
1121 "instruction, starting at PC %s.\n", tid, this_pc);
1154 std::unique_ptr<PCStateBase> next_pc(this_pc.
clone());
1163 DPRINTF(
Fetch,
"[tid:%i] Adding instructions to queue to "
1168 bool predictedBranch =
false;
1183 && !predictedBranch && !
quiesce) {
1187 bool needMem = !inRom && !curMacroop && !dec_ptr->instReady();
1188 fetchAddr = (this_pc.
instAddr() + pcOffset) & pc_mask;
1198 if (blkOffset >= numInsts) {
1204 memcpy(dec_ptr->moreBytesPtr(),
1208 if (dec_ptr->needMoreBytes()) {
1218 if (!(curMacroop || inRom)) {
1219 if (dec_ptr->instReady()) {
1220 staticInst = dec_ptr->decode(this_pc);
1226 curMacroop = staticInst;
1239 bool newMacro =
false;
1240 if (curMacroop || inRom) {
1242 staticInst = dec_ptr->fetchRomMicroop(
1243 this_pc.
microPC(), curMacroop);
1251 tid, staticInst, curMacroop, this_pc, *next_pc,
true);
1257 if (debug::O3PipeView) {
1258 instruction->fetchTick =
curTick();
1262 set(next_pc, this_pc);
1268 if (predictedBranch) {
1269 DPRINTF(
Fetch,
"Branch detected with PC = %s\n", this_pc);
1272 newMacro |= this_pc.
instAddr() != next_pc->instAddr();
1275 set(this_pc, *next_pc);
1279 fetchAddr = this_pc.
instAddr() & pc_mask;
1285 if (instruction->isQuiesce()) {
1287 "Quiesce instruction encountered, halting fetch!\n");
1289 status_change =
true;
1293 }
while ((curMacroop || dec_ptr->instReady()) &&
1302 if (predictedBranch) {
1303 DPRINTF(
Fetch,
"[tid:%i] Done fetching, predicted branch "
1304 "instruction encountered.\n", tid);
1306 DPRINTF(
Fetch,
"[tid:%i] Done fetching, reached fetch bandwidth "
1307 "for this cycle.\n", tid);
1309 DPRINTF(
Fetch,
"[tid:%i] Done fetching, reached the end of the"
1310 "fetch buffer.\n", tid);
1322 fetchAddr = (this_pc.
instAddr() + pcOffset) & pc_mask;
1367 case SMTFetchPolicy::RoundRobin:
1369 case SMTFetchPolicy::IQCount:
1371 case SMTFetchPolicy::LSQCount:
1373 case SMTFetchPolicy::Branch:
1405 while (pri_iter != end) {
1406 high_pri = *pri_iter;
1430 std::priority_queue<unsigned, std::vector<unsigned>,
1431 std::greater<unsigned> > PQ;
1432 std::map<unsigned, ThreadID> threadMap;
1437 while (threads != end) {
1447 while (!PQ.empty()) {
1448 ThreadID high_pri = threadMap[PQ.top()];
1466 std::priority_queue<unsigned, std::vector<unsigned>,
1467 std::greater<unsigned> > PQ;
1468 std::map<unsigned, ThreadID> threadMap;
1473 while (threads != end) {
1475 unsigned ldstqCount =
fromIEW->iewInfo[tid].ldstqCount;
1479 PQ.push(ldstqCount);
1480 threadMap[ldstqCount] = tid;
1483 while (!PQ.empty()) {
1484 ThreadID high_pri = threadMap[PQ.top()];
1500 panic(
"Branch Count Fetch policy unimplemented\n");
1526 DPRINTF(
Fetch,
"[tid:%i] Issuing a pipelined I-cache access, "
1527 "starting at PC %s.\n", tid, this_pc);
1536 DPRINTF(
Fetch,
"There are no more threads available to fetch from.\n");
1554 DPRINTF(
Fetch,
"[tid:%i] Fetch is waiting cache response!\n",
1558 DPRINTF(
Fetch,
"[tid:%i] Fetch is waiting ITLB walk to "
1562 DPRINTF(
Fetch,
"[tid:%i] Fetch is waiting for a pending trap!\n",
1566 DPRINTF(
Fetch,
"[tid:%i] Fetch is waiting for a pending quiesce "
1567 "instruction!\n", tid);
1570 DPRINTF(
Fetch,
"[tid:%i] Fetch is waiting for an I-cache retry!\n",
1573 DPRINTF(
Fetch,
"[tid:%i] Fetch predicted non-executable address\n",
1576 DPRINTF(
Fetch,
"[tid:%i] Unexpected fetch stall reason "
1585 DPRINTF(O3CPU,
"Fetch unit received timing\n");
1587 assert(pkt->
req->isUncacheable() ||
1589 fetch->processCacheCompletion(pkt);
1597 fetch->recvReqRetry();
virtual void moreBytes(const PCStateBase &pc, Addr fetchPC)=0
Feed data to the decoder.
Tick curTick()
The universal simulation clock.
#define fatal(...)
This implements a cprintf based fatal() function.
statistics::Scalar pendingQuiesceStallCycles
Total number of stall cycles caused by pending quiesce instructions.
FetchStatus
Overall fetch status.
void update(const InstSeqNum &done_sn, ThreadID tid)
Tells the branch predictor to commit any updates until the given sequence number.
ThreadID numFetchingThreads
Number of threads that are actively fetching.
bool lookupAndUpdateNextPC(const DynInstPtr &inst, PCStateBase &pc)
Looks up in the branch predictor to see if the next PC should be either next PC+=MachInst or a branch...
FetchStatus _status
Fetch status.
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
bool fetchCacheLine(Addr vaddr, ThreadID tid, Addr pc)
Fetches the cache line that contains the fetch PC.
void switchToInactive()
Changes the status of this stage to inactive, and indicates this to the CPU.
bool predict(const StaticInstPtr &inst, const InstSeqNum &seqNum, PCStateBase &pc, ThreadID tid)
Predicts whether or not the instruction is a taken branch, and the target of the branch if it is take...
void notify(const Arg &arg)
called at the ProbePoint call site, passes arg to each listener.
constexpr decltype(nullptr) NoFault
bool switchedOut() const
Determine if the CPU is switched out.
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
std::unique_ptr< PCStateBase > pc[MaxThreads]
Fetch(CPU *_cpu, const BaseO3CPUParams ¶ms)
Fetch constructor.
void removeInstsUntil(const InstSeqNum &seq_num, ThreadID tid)
Remove all instructions younger than the given sequence number.
statistics::Scalar blockedCycles
Total number of cycles spent blocked.
uint8_t * fetchBuffer[MaxThreads]
The fetch data that is being fetched and buffered.
statistics::Scalar pendingDrainCycles
Total number of cycles spent in waiting for drains.
void squash(const PCStateBase &new_pc, const InstSeqNum seq_num, DynInstPtr squashInst, ThreadID tid)
Squashes a specific thread and resets the PC.
statistics::Scalar miscStallCycles
Total number of cycles spent in any other state.
void profileStall(ThreadID tid)
Profile the reasons of fetch stall.
void pipelineIcacheAccesses(ThreadID tid)
Pipeline the next I-cache access to the current one.
static bool isRomMicroPC(MicroPC upc)
virtual void recvReqRetry()
Handles doing a retry of a failed fetch.
RequestPtr req
A pointer to the original request.
branch_prediction::BPredUnit * branchPred
BPredUnit.
void drainStall(ThreadID tid)
Stall the fetch stage after reaching a safe drain point.
bool checkInterrupt(Addr pc)
Check if an interrupt is pending and that we need to handle.
PacketPtr retryPkt
The packet that is waiting to be retried.
Cycles iewToFetchDelay
IEW to fetch delay.
void wakeFromQuiesce()
Tells fetch to wake up from a quiesce instruction.
virtual InstRecord * getInstRecord(Tick when, ThreadContext *tc, const StaticInstPtr staticInst, const PCStateBase &pc, const StaticInstPtr macroStaticInst=nullptr)=0
std::string name() const
Returns the name of fetch.
void processCacheCompletion(PacketPtr pkt)
Processes cache completion event.
bool cacheResponding() const
InstSeqNum getAndIncrementInstSeq()
Get the current instruction sequence number, and increment it.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to list of active threads.
statistics::Distribution nisnDist
Distribution of number of instructions fetched each cycle.
bool delayedCommit[MaxThreads]
Can the fetch stage redirect from an interrupt on this instruction?
statistics::Scalar cacheLines
Stat for total number of fetched cache lines.
void schedule(Event &event, Tick when)
MicroPC microPC() const
Returns the current micropc.
unsigned fetchWidth
The width of fetch in instructions.
void clearStates(ThreadID tid)
Clear all thread-specific states.
Fetch class handles both single threaded and SMT fetch.
void quiesce(ThreadContext *tc)
int numInst
Tracks how many instructions has been fetched this cycle.
ThreadID retryTid
The thread that is waiting on the cache to tell fetch to retry.
bool isDrained() const
Has the stage drained?
StaticInstPtr macroop[MaxThreads]
ThreadID getFetchingThread()
Returns the appropriate thread to fetch, given the fetch policy.
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
gem5::o3::Fetch::FetchStatGroup fetchStats
InstDecoder * decoder[MaxThreads]
The decoder.
statistics::Scalar idleCycles
Stat for total number of cycles spent blocked due to other stages in the pipeline.
ProbePointArg< PacketPtr > * ppInstAccessComplete
statistics::Scalar pendingTrapStallCycles
Total number of stall cycles caused by pending traps.
std::enable_if_t< std::is_integral_v< T >, T > random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
ProbePointArg< RequestPtr > * ppFetchRequestSent
To probe when a fetch request is successfully sent.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
void setFault(Fault _fault)
statistics::Scalar tlbCycles
Stat for total number of cycles spent waiting for translation.
virtual StaticInstPtr fetchMicroop(MicroPC upc) const
Return the microop that goes with a particular micropc.
Cycles is a wrapper class for representing cycle counts, i.e.
void deactivateStage(const StageIdx idx)
Changes a stage's status to inactive within the activity recorder.
const FlagsType pdf
Print the percent of the total that this entry represents.
void drainSanityCheck() const
Perform sanity checks after a drain.
Counter lastIcacheStall[MaxThreads]
Icache stall statistics.
virtual bool branching() const =0
void drainResume()
Resume after a drain.
TimeBuffer< TimeStruct >::wire fromDecode
Wire to get decode's information from backwards time buffer.
unsigned fetchBufferSize
The size of the fetch buffer in bytes.
statistics::Scalar tlbSquashes
Total number of outstanding tlb accesses that were dropped due to a squash.
uint32_t taskId() const
Get cpu task id.
std::list< ThreadID > priorityList
List that has the threads organized by priority.
TimeBuffer< TimeStruct >::wire fromIEW
Wire to get iew's information from backwards time buffer.
Cycles commitToFetchDelay
Commit to fetch delay.
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buff...
void fetch(bool &status_change)
Does the actual fetching of instructions and passing them on to the next stage.
Port & getInstPort() override
Used by the fetch unit to get a hold of the instruction port.
Distribution & init(Counter min, Counter max, Counter bkt)
Set the parameters of this distribution.
bool isMemAddr(Addr addr) const
Check if a physical address is within a range of a memory that is part of the global address map.
virtual std::string name() const
std::shared_ptr< FaultBase > Fault
bool checkStall(ThreadID tid) const
Checks if a thread is stalled.
FinishTranslationEvent finishTranslationEvent
Event used to delay fault generation of translation faults.
Stalls stalls[MaxThreads]
Tracks which stages are telling fetch to stall.
bool wroteToTimeBuffer
Variable that tracks if fetch has written to the time buffer this cycle.
void recvReqRetry()
Handles retrying the fetch access.
ThreadID roundRobin()
Returns the appropriate thread to fetch using a round robin policy.
Addr fetchBufferAlignPC(Addr addr)
Align a PC to the start of a fetch buffer block.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
void squashFromDecode(const PCStateBase &new_pc, const DynInstPtr squashInst, const InstSeqNum seq_num, ThreadID tid)
Squashes a specific thread and resets the PC.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
ThreadID lsqCount()
Returns the appropriate thread to fetch using the LSQ count policy.
ProbePointArg< PacketInfo > Packet
Packet probe point.
void pcState(const PCStateBase &new_pc_state, ThreadID tid)
Sets the commit PC state of a specific thread.
void setTimeBuffer(TimeBuffer< TimeStruct > *time_buffer)
Sets the main backwards communication time buffer pointer.
RequestorID instRequestorId() const
Reads this CPU's unique instruction requestor ID.
std::shared_ptr< Request > RequestPtr
void setReq(const RequestPtr &_req)
const T * getConstPtr() const
void activateStage(const StageIdx idx)
Changes a stage's status to active within the activity recorder.
gem5::ThreadContext * tcBase(ThreadID tid)
Returns a pointer to a thread context.
bool fetchBufferValid[MaxThreads]
Whether or not the fetch buffer data is valid.
ThreadID threadFetched
Thread ID being fetched.
std::vector< ThreadState * > thread
Pointers to all of the threads in the CPU.
void deactivateThread(ThreadID tid)
For priority-based fetch policies, need to keep update priorityList.
void drainSanityCheck() const
Perform sanity checks after a drain.
const ThreadID InvalidThreadID
void wakeCPU()
Wakes the CPU, rescheduling the CPU if it's not already active.
CPU * cpu
Pointer to the O3CPU.
statistics::Scalar cycles
Stat for total number of cycles spent fetching.
bool isConnected() const
Is this port currently connected to a peer?
static constexpr int MaxWidth
statistics::Scalar squashCycles
Stat for total number of cycles spent squashing.
void switchToActive()
Changes the status of this stage to active, and indicates this to the CPU.
ThreadID contextToThread(ContextID cid)
Convert ContextID to threadID.
int instSize
Size of instructions.
void squash(const InstSeqNum &squashed_sn, ThreadID tid)
Squashes all outstanding updates until a given sequence number.
TimeBuffer< TimeStruct > * timeBuffer
Time buffer interface.
std::deque< DynInstPtr > fetchQueue[MaxThreads]
Queue of fetched instructions.
void tick()
Ticks the fetch stage, processing all inputs signals and fetching as many instructions as possible.
bool interruptPending
Checks if there is an interrupt pending.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
statistics::Scalar icacheSquashes
Total number of outstanding icache accesses that were dropped due to a squash.
const std::string & name()
bool isLastMicroop() const
void resetStage()
Reset this pipeline stage.
FetchStatus updateFetchStatus()
Updates overall fetch stage status; to be called at the end of each cycle.
virtual void translateTiming(const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode)
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
bool cacheBlocked
Is the cache blocked? If so no threads can access it.
Cycles decodeToFetchDelay
Decode to fetch delay.
bool checkSignalsAndUpdate(ThreadID tid)
Checks all input signals and updates the status as necessary.
void startupStage()
Initialize stage.
ProbePointArg generates a point for the class of Arg.
System * system
Pointer to the system.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
size_t moreBytesSize() const
ProbeManager * getProbeManager()
Get the probe manager for this object.
unsigned decodeWidth
The width of decode in instructions.
static constexpr int MaxThreads
ProbePointArg< DynInstPtr > * ppFetch
Probe points.
void activityThisCycle()
Records that there was time buffer activity this cycle.
void removeInstsNotInROB(ThreadID tid)
Remove all instructions that are not currently in the ROB.
TimeBuffer< FetchStruct >::wire toDecode
Wire used to write any information heading to decode.
ThreadID iqCount()
Returns the appropriate thread to fetch using the IQ count policy.
StaticInstPtr nopStaticInstPtr
Pointer to a statically allocated generic "nop" instruction object.
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
@ INST_FETCH
The request was an instruction fetch.
statistics::Scalar noActiveThreadStallCycles
Total number of stall cycles caused by no active threads to run.
bool issuePipelinedIfetch[MaxThreads]
Set to true if a pipelined I-cache request should be issued.
SMTFetchPolicy fetchPolicy
Fetch policy.
TimeBuffer< TimeStruct >::wire fromRename
Wire to get rename's information from backwards time buffer.
void takeOverFrom()
Takes over from another CPU's thread.
ListIt addInst(const DynInstPtr &inst)
Function to add instruction onto the head of the list of the instructions.
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
std::list< ThreadID > * activeThreads
List of Active Threads.
uint8_t numDestRegs() const
Number of destination registers.
Addr fetchBufferPC[MaxThreads]
The PC of the first instruction loaded into the fetch buffer.
bool isDraining() const
Is the CPU draining?
TimeBuffer< TimeStruct >::wire fromCommit
Wire to get commit's information from backwards time buffer.
void finishTranslation(const Fault &fault, const RequestPtr &mem_req)
uint8_t numSrcRegs() const
Number of source registers.
Addr fetchBufferMask
Mask to align a fetch address to a fetch buffer boundary.
IcachePort(Fetch *_fetch, CPU *_cpu)
Default constructor.
statistics::Scalar icacheWaitRetryStallCycles
Total number of stall cycles caused by I-cache wait retrys.
trace::InstTracer * getTracer()
Provide access to the tracer pointer.
void regProbePoints()
Registers probes.
DynInstPtr buildInst(ThreadID tid, StaticInstPtr staticInst, StaticInstPtr curMacroop, const PCStateBase &this_pc, const PCStateBase &next_pc, bool trace)
IcachePort icachePort
Instruction port.
std::vector< std::unique_ptr< FetchCPUStats > > fetchStats
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
void setFetchQueue(TimeBuffer< FetchStruct > *fq_ptr)
Sets pointer to time buffer used to communicate to the next stage.
unsigned fetchQueueSize
The size of the fetch queue in micro-ops.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
ThreadID branchCount()
Returns the appropriate thread to fetch using the branch count policy.
Addr fetchOffset[MaxThreads]
statistics::Formula idleRate
Rate of how often fetch was idle.
statistics::Scalar predictedBranches
Stat for total number of predicted branches.
RequestPtr memReq[MaxThreads]
Memory request used to access cache.
void doSquash(const PCStateBase &new_pc, const DynInstPtr squashInst, ThreadID tid)
Squashes a specific thread and resets the PC.
ThreadID numThreads
Number of threads.
unsigned int cacheBlkSize
Cache block size.
FetchStatGroup(CPU *cpu, Fetch *fetch)
ThreadStatus fetchStatus[MaxThreads]
Per-thread status.
virtual PCStateBase * clone() const =0
Cycles renameToFetchDelay
Rename to fetch delay.
bool scheduled() const
Determine if the current event is scheduled.
int16_t ThreadID
Thread index/ID type.
#define panic(...)
This implements a cprintf based panic() function.
virtual bool recvTimingResp(PacketPtr pkt)
Timing version of receive.
Generated on Sun Jul 30 2023 01:56:52 for gem5 by doxygen 1.8.17