gem5 v24.0.0.0
|
Fetch class handles both single threaded and SMT fetch. More...
#include <fetch.hh>
Classes | |
struct | FetchStatGroup |
class | FetchTranslation |
class | FinishTranslationEvent |
class | IcachePort |
IcachePort class for instruction fetch. More... | |
struct | Stalls |
Source of possible stalls. More... | |
Public Types | |
enum | FetchStatus { Active , Inactive } |
Overall fetch status. More... | |
enum | ThreadStatus { Running , Idle , Squashing , Blocked , Fetching , TrapPending , QuiescePending , ItlbWait , IcacheWaitResponse , IcacheWaitRetry , IcacheAccessComplete , NoGoodAddr } |
Individual thread status. More... | |
Public Member Functions | |
Fetch (CPU *_cpu, const BaseO3CPUParams ¶ms) | |
Fetch constructor. | |
std::string | name () const |
Returns the name of fetch. | |
void | regProbePoints () |
Registers probes. | |
void | setTimeBuffer (TimeBuffer< TimeStruct > *time_buffer) |
Sets the main backwards communication time buffer pointer. | |
void | setActiveThreads (std::list< ThreadID > *at_ptr) |
Sets pointer to list of active threads. | |
void | setFetchQueue (TimeBuffer< FetchStruct > *fq_ptr) |
Sets pointer to time buffer used to communicate to the next stage. | |
void | startupStage () |
Initialize stage. | |
void | clearStates (ThreadID tid) |
Clear all thread-specific states. | |
void | recvReqRetry () |
Handles retrying the fetch access. | |
void | processCacheCompletion (PacketPtr pkt) |
Processes cache completion event. | |
void | drainResume () |
Resume after a drain. | |
void | drainSanityCheck () const |
Perform sanity checks after a drain. | |
bool | isDrained () const |
Has the stage drained? | |
void | takeOverFrom () |
Takes over from another CPU's thread. | |
void | drainStall (ThreadID tid) |
Stall the fetch stage after reaching a safe drain point. | |
void | wakeFromQuiesce () |
Tells fetch to wake up from a quiesce instruction. | |
void | deactivateThread (ThreadID tid) |
For priority-based fetch policies, need to keep update priorityList. | |
void | squash (const PCStateBase &new_pc, const InstSeqNum seq_num, DynInstPtr squashInst, ThreadID tid) |
Squashes a specific thread and resets the PC. | |
void | tick () |
Ticks the fetch stage, processing all inputs signals and fetching as many instructions as possible. | |
bool | checkSignalsAndUpdate (ThreadID tid) |
Checks all input signals and updates the status as necessary. | |
void | fetch (bool &status_change) |
Does the actual fetching of instructions and passing them on to the next stage. | |
Addr | fetchBufferAlignPC (Addr addr) |
Align a PC to the start of a fetch buffer block. | |
RequestPort & | getInstPort () |
Public Attributes | |
InstDecoder * | decoder [MaxThreads] |
The decoder. | |
Protected Attributes | |
gem5::o3::Fetch::FetchStatGroup | fetchStats |
Private Member Functions | |
void | resetStage () |
Reset this pipeline stage. | |
void | switchToActive () |
Changes the status of this stage to active, and indicates this to the CPU. | |
void | switchToInactive () |
Changes the status of this stage to inactive, and indicates this to the CPU. | |
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 target. | |
bool | fetchCacheLine (Addr vaddr, ThreadID tid, Addr pc) |
Fetches the cache line that contains the fetch PC. | |
void | finishTranslation (const Fault &fault, const RequestPtr &mem_req) |
bool | checkInterrupt (Addr pc) |
Check if an interrupt is pending and that we need to handle. | |
void | doSquash (const PCStateBase &new_pc, const DynInstPtr squashInst, ThreadID tid) |
Squashes a specific thread and resets the PC. | |
void | squashFromDecode (const PCStateBase &new_pc, const DynInstPtr squashInst, const InstSeqNum seq_num, ThreadID tid) |
Squashes a specific thread and resets the PC. | |
bool | checkStall (ThreadID tid) const |
Checks if a thread is stalled. | |
FetchStatus | updateFetchStatus () |
Updates overall fetch stage status; to be called at the end of each cycle. | |
DynInstPtr | buildInst (ThreadID tid, StaticInstPtr staticInst, StaticInstPtr curMacroop, const PCStateBase &this_pc, const PCStateBase &next_pc, bool trace) |
ThreadID | getFetchingThread () |
Returns the appropriate thread to fetch, given the fetch policy. | |
ThreadID | roundRobin () |
Returns the appropriate thread to fetch using a round robin policy. | |
ThreadID | iqCount () |
Returns the appropriate thread to fetch using the IQ count policy. | |
ThreadID | lsqCount () |
Returns the appropriate thread to fetch using the LSQ count policy. | |
ThreadID | branchCount () |
Returns the appropriate thread to fetch using the branch count policy. | |
void | pipelineIcacheAccesses (ThreadID tid) |
Pipeline the next I-cache access to the current one. | |
void | profileStall (ThreadID tid) |
Profile the reasons of fetch stall. | |
Private Attributes | |
FetchStatus | _status |
Fetch status. | |
ThreadStatus | fetchStatus [MaxThreads] |
Per-thread status. | |
SMTFetchPolicy | fetchPolicy |
Fetch policy. | |
std::list< ThreadID > | priorityList |
List that has the threads organized by priority. | |
ProbePointArg< DynInstPtr > * | ppFetch |
Probe points. | |
ProbePointArg< RequestPtr > * | ppFetchRequestSent |
To probe when a fetch request is successfully sent. | |
CPU * | cpu |
Pointer to the O3CPU. | |
TimeBuffer< TimeStruct > * | timeBuffer |
Time buffer interface. | |
TimeBuffer< TimeStruct >::wire | fromDecode |
Wire to get decode's information from backwards time buffer. | |
TimeBuffer< TimeStruct >::wire | fromRename |
Wire to get rename's information from backwards time buffer. | |
TimeBuffer< TimeStruct >::wire | fromIEW |
Wire to get iew's information from backwards time buffer. | |
TimeBuffer< TimeStruct >::wire | fromCommit |
Wire to get commit's information from backwards time buffer. | |
TimeBuffer< FetchStruct >::wire | toDecode |
Wire used to write any information heading to decode. | |
branch_prediction::BPredUnit * | branchPred |
BPredUnit. | |
std::unique_ptr< PCStateBase > | pc [MaxThreads] |
Addr | fetchOffset [MaxThreads] |
StaticInstPtr | macroop [MaxThreads] |
bool | delayedCommit [MaxThreads] |
Can the fetch stage redirect from an interrupt on this instruction? | |
RequestPtr | memReq [MaxThreads] |
Memory request used to access cache. | |
bool | wroteToTimeBuffer |
Variable that tracks if fetch has written to the time buffer this cycle. | |
int | numInst |
Tracks how many instructions has been fetched this cycle. | |
Stalls | stalls [MaxThreads] |
Tracks which stages are telling fetch to stall. | |
Cycles | decodeToFetchDelay |
Decode to fetch delay. | |
Cycles | renameToFetchDelay |
Rename to fetch delay. | |
Cycles | iewToFetchDelay |
IEW to fetch delay. | |
Cycles | commitToFetchDelay |
Commit to fetch delay. | |
unsigned | fetchWidth |
The width of fetch in instructions. | |
unsigned | decodeWidth |
The width of decode in instructions. | |
bool | cacheBlocked |
Is the cache blocked? If so no threads can access it. | |
PacketPtr | retryPkt |
The packet that is waiting to be retried. | |
ThreadID | retryTid |
The thread that is waiting on the cache to tell fetch to retry. | |
Addr | cacheBlkSize |
Cache block size. | |
unsigned | fetchBufferSize |
The size of the fetch buffer in bytes. | |
Addr | fetchBufferMask |
Mask to align a fetch address to a fetch buffer boundary. | |
uint8_t * | fetchBuffer [MaxThreads] |
The fetch data that is being fetched and buffered. | |
Addr | fetchBufferPC [MaxThreads] |
The PC of the first instruction loaded into the fetch buffer. | |
unsigned | fetchQueueSize |
The size of the fetch queue in micro-ops. | |
std::deque< DynInstPtr > | fetchQueue [MaxThreads] |
Queue of fetched instructions. | |
bool | fetchBufferValid [MaxThreads] |
Whether or not the fetch buffer data is valid. | |
int | instSize |
Size of instructions. | |
Counter | lastIcacheStall [MaxThreads] |
Icache stall statistics. | |
std::list< ThreadID > * | activeThreads |
List of Active Threads. | |
ThreadID | numThreads |
Number of threads. | |
ThreadID | numFetchingThreads |
Number of threads that are actively fetching. | |
ThreadID | threadFetched |
Thread ID being fetched. | |
bool | interruptPending |
Checks if there is an interrupt pending. | |
IcachePort | icachePort |
Instruction port. | |
bool | issuePipelinedIfetch [MaxThreads] |
Set to true if a pipelined I-cache request should be issued. | |
FinishTranslationEvent | finishTranslationEvent |
Event used to delay fault generation of translation faults. | |
Fetch class handles both single threaded and SMT fetch.
Its width is specified by the parameters; each cycle it tries to fetch that many instructions. It supports using a branch predictor to predict direction and targets. It supports the idling functionality of the CPU by indicating to the CPU when it is active and inactive.
gem5::o3::Fetch::Fetch | ( | CPU * | _cpu, |
const BaseO3CPUParams & | params ) |
Fetch constructor.
Definition at line 83 of file fetch.cc.
References branchPred, cacheBlkSize, decoder, delayedCommit, fatal, fetchBuffer, fetchBufferPC, fetchBufferSize, fetchBufferValid, fetchOffset, fetchStatus, fetchWidth, gem5::ArmISA::i, Idle, instSize, issuePipelinedIfetch, lastIcacheStall, macroop, gem5::o3::MaxThreads, gem5::o3::MaxWidth, memReq, gem5::InstDecoder::moreBytesSize(), numThreads, pc, gem5::InstDecoder::reset(), and stalls.
|
private |
Returns the appropriate thread to fetch using the branch count policy.
Definition at line 1499 of file fetch.cc.
References gem5::InvalidThreadID, and panic.
Referenced by getFetchingThread().
|
private |
Definition at line 1020 of file fetch.cc.
References gem5::o3::CPU::addInst(), cpu, gem5::curTick(), delayedCommit, DPRINTF, fetchQueue, fetchQueueSize, fetchWidth, gem5::o3::CPU::getAndIncrementInstSeq(), gem5::trace::InstTracer::getInstRecord(), gem5::BaseCPU::getTracer(), gem5::PCStateBase::instAddr(), gem5::StaticInst::numDestRegs(), gem5::o3::DynInst::Arrays::numDests, numInst, gem5::StaticInst::numSrcRegs(), gem5::o3::DynInst::Arrays::numSrcs, gem5::o3::CPU::tcBase(), and gem5::o3::CPU::thread.
Referenced by fetch(), and finishTranslation().
|
inlineprivate |
Check if an interrupt is pending and that we need to handle.
Definition at line 305 of file fetch.hh.
References interruptPending.
Referenced by fetch(), and fetchCacheLine().
bool gem5::o3::Fetch::checkSignalsAndUpdate | ( | ThreadID | tid | ) |
Checks all input signals and updates the status as necessary.
Definition at line 918 of file fetch.cc.
References Blocked, branchPred, checkStall(), gem5::o3::Fetch::Stalls::decode, DPRINTF, fetchStatus, fromCommit, fromDecode, IcacheWaitResponse, IcacheWaitRetry, ItlbWait, QuiescePending, Running, gem5::branch_prediction::BPredUnit::squash(), squash(), squashFromDecode(), Squashing, stalls, and gem5::branch_prediction::BPredUnit::update().
Referenced by tick().
|
private |
Checks if a thread is stalled.
Definition at line 751 of file fetch.cc.
References cpu, DPRINTF, gem5::o3::CPU::isDraining(), and stalls.
Referenced by checkSignalsAndUpdate(), and processCacheCompletion().
void gem5::o3::Fetch::clearStates | ( | ThreadID | tid | ) |
Clear all thread-specific states.
Definition at line 274 of file fetch.cc.
References cpu, gem5::o3::Fetch::Stalls::decode, delayedCommit, gem5::o3::Fetch::Stalls::drain, fetchBufferPC, fetchBufferValid, fetchOffset, fetchQueue, fetchStatus, macroop, memReq, pc, gem5::o3::CPU::pcState(), Running, gem5::ArmISA::set, and stalls.
Referenced by gem5::o3::CPU::removeThread().
void gem5::o3::Fetch::deactivateThread | ( | ThreadID | tid | ) |
For priority-based fetch policies, need to keep update priorityList.
Definition at line 476 of file fetch.cc.
References priorityList.
Referenced by gem5::o3::CPU::deactivateThread().
|
private |
Squashes a specific thread and resets the PC.
Definition at line 686 of file fetch.cc.
References cacheBlocked, decoder, delayedCommit, DPRINTF, fetchOffset, fetchQueue, fetchStats, fetchStatus, IcacheWaitResponse, gem5::PCStateBase::instAddr(), gem5::InvalidThreadID, ItlbWait, macroop, memReq, pc, gem5::InstDecoder::reset(), retryPkt, retryTid, gem5::ArmISA::set, gem5::o3::Fetch::FetchStatGroup::squashCycles, and Squashing.
Referenced by squash(), and squashFromDecode().
void gem5::o3::Fetch::drainResume | ( | ) |
Resume after a drain.
Definition at line 370 of file fetch.cc.
References gem5::o3::Fetch::Stalls::decode, gem5::o3::Fetch::Stalls::drain, gem5::ArmISA::i, numThreads, and stalls.
Referenced by gem5::o3::CPU::drainResume().
void gem5::o3::Fetch::drainSanityCheck | ( | ) | const |
Perform sanity checks after a drain.
Definition at line 379 of file fetch.cc.
References branchPred, cacheBlocked, gem5::branch_prediction::BPredUnit::drainSanityCheck(), fetchStatus, gem5::ArmISA::i, Idle, interruptPending, gem5::InvalidThreadID, isDrained(), memReq, numThreads, retryPkt, retryTid, and stalls.
Referenced by gem5::o3::CPU::drainSanityCheck().
void gem5::o3::Fetch::drainStall | ( | ThreadID | tid | ) |
Stall the fetch stage after reaching a safe drain point.
The CPU uses this method to stop fetching instructions from a thread that has been drained. The drain stall is different from all other stalls in that it is signaled instantly from the commit stage (without the normal communication delay) when it has reached a safe point to drain from.
Definition at line 434 of file fetch.cc.
References cpu, DPRINTF, gem5::o3::Fetch::Stalls::drain, gem5::o3::CPU::isDraining(), and stalls.
Referenced by gem5::o3::CPU::commitDrained().
void gem5::o3::Fetch::fetch | ( | bool & | status_change | ) |
Does the actual fetching of instructions and passing them on to the next stage.
status_change | fetch() sets this variable if there was a status change (ie switching to IcacheMissStall). |
Definition at line 1073 of file fetch.cc.
References gem5::PCStateBase::branching(), buildInst(), checkInterrupt(), gem5::PCStateBase::clone(), cpu, gem5::curTick(), gem5::o3::Fetch::FetchStatGroup::cycles, decoder, delayedCommit, DPRINTF, fetchBuffer, fetchBufferAlignPC(), fetchBufferPC, fetchBufferSize, fetchBufferValid, fetchCacheLine(), gem5::StaticInst::fetchMicroop(), fetchOffset, fetchQueue, fetchQueueSize, gem5::BaseCPU::fetchStats, fetchStats, fetchStatus, fetchWidth, getFetchingThread(), IcacheAccessComplete, IcacheWaitResponse, IcacheWaitRetry, Idle, gem5::o3::Fetch::FetchStatGroup::idleCycles, gem5::PCStateBase::instAddr(), instSize, gem5::InvalidThreadID, gem5::StaticInst::isLastMicroop(), gem5::StaticInst::isMacroop(), gem5::isRomMicroPC(), issuePipelinedIfetch, ItlbWait, lookupAndUpdateNextPC(), macroop, gem5::PCStateBase::microPC(), gem5::o3::Fetch::FetchStatGroup::miscStallCycles, gem5::InstDecoder::moreBytes(), numFetchingThreads, numInst, numThreads, pc, gem5::InstDecoder::pcMask(), ppFetch, profileStall(), QuiescePending, Running, gem5::ArmISA::set, gem5::BaseCPU::switchedOut(), threadFetched, gem5::o3::Fetch::FetchStatGroup::tlbCycles, and wroteToTimeBuffer.
Referenced by gem5::o3::Fetch::FetchStatGroup::FetchStatGroup(), gem5::o3::Fetch::IcachePort::recvReqRetry(), gem5::o3::Fetch::IcachePort::recvTimingResp(), and tick().
Align a PC to the start of a fetch buffer block.
Definition at line 352 of file fetch.hh.
References gem5::X86ISA::addr, and fetchBufferMask.
Referenced by fetch(), fetchCacheLine(), and pipelineIcacheAccesses().
Fetches the cache line that contains the fetch PC.
Returns any fault that happened. Puts the data into the class variable fetchBuffer, which may not hold the entire fetched cache line.
vaddr | The memory address that is being fetched from. |
ret_fault | The fault reference that will be set to the result of the icache access. |
tid | Thread id. |
pc | The actual PC of the current instruction. |
Definition at line 530 of file fetch.cc.
References cacheBlocked, checkInterrupt(), cpu, delayedCommit, DPRINTF, gem5::BaseMMU::Execute, fetchBufferAlignPC(), fetchBufferSize, fetchStatus, gem5::Request::INST_FETCH, gem5::BaseCPU::instRequestorId(), ItlbWait, memReq, gem5::o3::CPU::mmu, gem5::NoFault, pc, gem5::BaseCPU::switchedOut(), gem5::BaseCPU::taskId(), gem5::o3::CPU::thread, gem5::BaseMMU::translateTiming(), and gem5::MipsISA::vaddr.
Referenced by fetch(), and pipelineIcacheAccesses().
|
private |
Definition at line 579 of file fetch.cc.
References _status, gem5::o3::CPU::activityThisCycle(), buildInst(), cacheBlocked, gem5::o3::Fetch::FetchStatGroup::cacheLines, gem5::Clocked::clockEdge(), gem5::BaseCPU::contextToThread(), cpu, gem5::curTick(), gem5::Packet::dataDynamic(), DPRINTF, fetchBufferPC, fetchBufferSize, fetchBufferValid, fetchQueue, fetchQueueSize, fetchStats, fetchStatus, fetchWidth, finishTranslationEvent, icachePort, IcacheWaitResponse, IcacheWaitRetry, gem5::InvalidThreadID, gem5::System::isMemAddr(), ItlbWait, lastIcacheStall, memReq, name(), gem5::NoFault, NoGoodAddr, gem5::nopStaticInstPtr, gem5::ProbePointArg< Arg >::notify(), numInst, pc, ppFetchRequestSent, gem5::MemCmd::ReadReq, retryPkt, retryTid, gem5::EventManager::schedule(), gem5::Event::scheduled(), gem5::RequestPort::sendTimingReq(), gem5::o3::Fetch::FinishTranslationEvent::setFault(), gem5::o3::Fetch::FinishTranslationEvent::setReq(), gem5::BaseCPU::switchedOut(), gem5::o3::CPU::system, gem5::o3::Fetch::FetchStatGroup::tlbSquashes, TrapPending, updateFetchStatus(), gem5::o3::CPU::wakeCPU(), warn, and wroteToTimeBuffer.
Referenced by gem5::o3::Fetch::FetchTranslation::finish(), and gem5::o3::Fetch::FinishTranslationEvent::process().
|
private |
Returns the appropriate thread to fetch, given the fetch policy.
Definition at line 1364 of file fetch.cc.
References activeThreads, branchCount(), fetchPolicy, fetchStatus, IcacheAccessComplete, Idle, gem5::InvalidThreadID, iqCount(), lsqCount(), numThreads, roundRobin(), and Running.
Referenced by fetch().
|
inline |
Definition at line 360 of file fetch.hh.
References icachePort.
Referenced by gem5::o3::CPU::getInstPort().
|
private |
Returns the appropriate thread to fetch using the IQ count policy.
Definition at line 1428 of file fetch.cc.
References activeThreads, fetchStatus, fromIEW, IcacheAccessComplete, Idle, gem5::InvalidThreadID, iqCount(), and Running.
Referenced by getFetchingThread(), and iqCount().
bool gem5::o3::Fetch::isDrained | ( | ) | const |
Has the stage drained?
Definition at line 396 of file fetch.cc.
References Blocked, fetchQueue, fetchStatus, finishTranslationEvent, gem5::ArmISA::i, Idle, numThreads, gem5::Event::scheduled(), and stalls.
Referenced by drainSanityCheck(), and gem5::o3::CPU::isCpuDrained().
|
private |
Looks up in the branch predictor to see if the next PC should be either next PC+=MachInst or a branch target.
next_PC | Next PC variable passed in by reference. It is expected to be set to the current PC; it will be updated with what the next PC will be. |
next_NPC | Used for ISAs which use delay slots. |
Definition at line 486 of file fetch.cc.
References branchPred, cpu, DPRINTF, gem5::BaseCPU::fetchStats, fetchStats, gem5::branch_prediction::BPredUnit::predict(), and gem5::o3::Fetch::FetchStatGroup::predictedBranches.
Referenced by fetch().
|
private |
Returns the appropriate thread to fetch using the LSQ count policy.
Definition at line 1464 of file fetch.cc.
References activeThreads, fetchStatus, fromIEW, IcacheAccessComplete, Idle, gem5::InvalidThreadID, and Running.
Referenced by getFetchingThread().
std::string gem5::o3::Fetch::name | ( | ) | const |
Returns the name of fetch.
Definition at line 148 of file fetch.cc.
References cpu, and gem5::Named::name().
Referenced by finishTranslation().
|
private |
Pipeline the next I-cache access to the current one.
Definition at line 1506 of file fetch.cc.
References decoder, DPRINTF, fetchBufferAlignPC(), fetchBufferPC, fetchBufferValid, fetchCacheLine(), fetchOffset, gem5::PCStateBase::instAddr(), gem5::isRomMicroPC(), issuePipelinedIfetch, gem5::PCStateBase::microPC(), and pc.
Referenced by tick().
void gem5::o3::Fetch::processCacheCompletion | ( | PacketPtr | pkt | ) |
Processes cache completion event.
Definition at line 327 of file fetch.cc.
References Blocked, checkStall(), gem5::BaseCPU::contextToThread(), cpu, DPRINTF, fetchBuffer, fetchBufferSize, fetchBufferValid, fetchStats, fetchStatus, gem5::Packet::getConstPtr(), IcacheAccessComplete, gem5::o3::Fetch::FetchStatGroup::icacheSquashes, IcacheWaitResponse, memReq, gem5::o3::CPU::ppInstAccessComplete, gem5::Packet::req, gem5::BaseCPU::switchedOut(), switchToActive(), and gem5::o3::CPU::wakeCPU().
|
private |
Profile the reasons of fetch stall.
Definition at line 1535 of file fetch.cc.
References activeThreads, Blocked, gem5::o3::Fetch::FetchStatGroup::blockedCycles, cpu, DPRINTF, gem5::BaseCPU::fetchStats, fetchStats, fetchStatus, IcacheWaitResponse, IcacheWaitRetry, gem5::o3::Fetch::FetchStatGroup::icacheWaitRetryStallCycles, ItlbWait, gem5::o3::Fetch::FetchStatGroup::noActiveThreadStallCycles, NoGoodAddr, gem5::o3::Fetch::FetchStatGroup::pendingDrainCycles, gem5::o3::Fetch::FetchStatGroup::pendingQuiesceStallCycles, gem5::o3::Fetch::FetchStatGroup::pendingTrapStallCycles, QuiescePending, gem5::o3::Fetch::FetchStatGroup::squashCycles, Squashing, stalls, gem5::o3::Fetch::FetchStatGroup::tlbCycles, and TrapPending.
Referenced by fetch().
void gem5::o3::Fetch::recvReqRetry | ( | ) |
Handles retrying the fetch access.
Definition at line 1334 of file fetch.cc.
References cacheBlocked, fetchStatus, icachePort, IcacheWaitResponse, IcacheWaitRetry, gem5::InvalidThreadID, gem5::ProbePointArg< Arg >::notify(), ppFetchRequestSent, gem5::Packet::req, retryPkt, retryTid, and gem5::RequestPort::sendTimingReq().
void gem5::o3::Fetch::regProbePoints | ( | ) |
Registers probes.
Definition at line 151 of file fetch.cc.
References cpu, gem5::SimObject::getProbeManager(), ppFetch, and ppFetchRequestSent.
Referenced by gem5::o3::CPU::regProbePoints().
|
private |
Reset this pipeline stage.
Definition at line 293 of file fetch.cc.
References _status, cacheBlocked, cpu, gem5::o3::Fetch::Stalls::decode, delayedCommit, gem5::o3::Fetch::Stalls::drain, fetchBufferPC, fetchBufferValid, fetchOffset, fetchQueue, fetchStatus, Inactive, interruptPending, macroop, memReq, numInst, numThreads, pc, gem5::o3::CPU::pcState(), priorityList, Running, gem5::ArmISA::set, stalls, and wroteToTimeBuffer.
Referenced by startupStage(), and takeOverFrom().
|
private |
Returns the appropriate thread to fetch using a round robin policy.
Definition at line 1399 of file fetch.cc.
References fetchStatus, IcacheAccessComplete, Idle, gem5::InvalidThreadID, numThreads, priorityList, and Running.
Referenced by getFetchingThread().
Sets pointer to list of active threads.
Definition at line 250 of file fetch.cc.
References activeThreads.
void gem5::o3::Fetch::setFetchQueue | ( | TimeBuffer< FetchStruct > * | fq_ptr | ) |
Sets pointer to time buffer used to communicate to the next stage.
Definition at line 256 of file fetch.cc.
References gem5::TimeBuffer< T >::getWire(), and toDecode.
void gem5::o3::Fetch::setTimeBuffer | ( | TimeBuffer< TimeStruct > * | time_buffer | ) |
Sets the main backwards communication time buffer pointer.
Definition at line 238 of file fetch.cc.
References commitToFetchDelay, decodeToFetchDelay, fromCommit, fromDecode, fromIEW, fromRename, gem5::TimeBuffer< T >::getWire(), iewToFetchDelay, renameToFetchDelay, and timeBuffer.
void gem5::o3::Fetch::squash | ( | const PCStateBase & | new_pc, |
const InstSeqNum | seq_num, | ||
DynInstPtr | squashInst, | ||
ThreadID | tid ) |
Squashes a specific thread and resets the PC.
Also tells the CPU to remove any instructions that are not in the ROB. The source of this squash should be the commit stage.
Definition at line 804 of file fetch.cc.
References cpu, doSquash(), DPRINTF, and gem5::o3::CPU::removeInstsNotInROB().
Referenced by checkSignalsAndUpdate().
|
private |
Squashes a specific thread and resets the PC.
Also tells the CPU to remove any instructions between fetch and decode that should be sqaushed.
Definition at line 738 of file fetch.cc.
References cpu, doSquash(), DPRINTF, and gem5::o3::CPU::removeInstsUntil().
Referenced by checkSignalsAndUpdate().
void gem5::o3::Fetch::startupStage | ( | ) |
Initialize stage.
Definition at line 263 of file fetch.cc.
References priorityList, resetStage(), and switchToActive().
Referenced by gem5::o3::CPU::startup().
|
private |
Changes the status of this stage to active, and indicates this to the CPU.
Definition at line 452 of file fetch.cc.
References _status, gem5::o3::CPU::activateStage(), Active, cpu, DPRINTF, gem5::o3::CPU::FetchIdx, and Inactive.
Referenced by processCacheCompletion(), and startupStage().
|
private |
Changes the status of this stage to inactive, and indicates this to the CPU.
Definition at line 464 of file fetch.cc.
References _status, Active, cpu, gem5::o3::CPU::deactivateStage(), DPRINTF, gem5::o3::CPU::FetchIdx, and Inactive.
void gem5::o3::Fetch::takeOverFrom | ( | ) |
Takes over from another CPU's thread.
Definition at line 426 of file fetch.cc.
References cpu, gem5::o3::CPU::getInstPort(), gem5::Port::isConnected(), and resetStage().
Referenced by gem5::o3::CPU::takeOverFrom().
void gem5::o3::Fetch::tick | ( | ) |
Ticks the fetch stage, processing all inputs signals and fetching as many instructions as possible.
Definition at line 816 of file fetch.cc.
References _status, activeThreads, gem5::o3::CPU::activityThisCycle(), checkSignalsAndUpdate(), cpu, decodeWidth, DPRINTF, fetch(), fetchQueue, fetchStats, fromCommit, gem5::FullSystem, gem5::ArmISA::i, interruptPending, issuePipelinedIfetch, gem5::o3::Fetch::FetchStatGroup::nisnDist, numFetchingThreads, numInst, numThreads, pipelineIcacheAccesses(), gem5::Random::random(), gem5::random_mt, gem5::statistics::DistBase< Derived, Stor >::sample(), stalls, threadFetched, toDecode, updateFetchStatus(), and wroteToTimeBuffer.
Referenced by gem5::o3::CPU::tick().
|
private |
Updates overall fetch stage status; to be called at the end of each cycle.
Definition at line 765 of file fetch.cc.
References _status, gem5::o3::CPU::activateStage(), Active, activeThreads, cpu, gem5::o3::CPU::deactivateStage(), DPRINTF, gem5::o3::CPU::FetchIdx, fetchStatus, IcacheAccessComplete, Inactive, Running, and Squashing.
Referenced by finishTranslation(), and tick().
void gem5::o3::Fetch::wakeFromQuiesce | ( | ) |
Tells fetch to wake up from a quiesce instruction.
Definition at line 443 of file fetch.cc.
References DPRINTF, fetchStatus, and Running.
Referenced by gem5::o3::CPU::activateContext().
|
private |
Fetch status.
Definition at line 187 of file fetch.hh.
Referenced by finishTranslation(), resetStage(), switchToActive(), switchToInactive(), tick(), and updateFetchStatus().
List of Active Threads.
Definition at line 505 of file fetch.hh.
Referenced by getFetchingThread(), iqCount(), lsqCount(), profileStall(), setActiveThreads(), tick(), and updateFetchStatus().
|
private |
BPredUnit.
Definition at line 413 of file fetch.hh.
Referenced by checkSignalsAndUpdate(), drainSanityCheck(), Fetch(), and lookupAndUpdateNextPC().
|
private |
|
private |
Is the cache blocked? If so no threads can access it.
Definition at line 464 of file fetch.hh.
Referenced by doSquash(), drainSanityCheck(), fetchCacheLine(), finishTranslation(), recvReqRetry(), and resetStage().
|
private |
|
private |
Pointer to the O3CPU.
Definition at line 391 of file fetch.hh.
Referenced by buildInst(), checkStall(), clearStates(), drainStall(), fetch(), fetchCacheLine(), finishTranslation(), lookupAndUpdateNextPC(), name(), processCacheCompletion(), profileStall(), regProbePoints(), resetStage(), squash(), squashFromDecode(), switchToActive(), switchToInactive(), takeOverFrom(), tick(), and updateFetchStatus().
InstDecoder* gem5::o3::Fetch::decoder[MaxThreads] |
The decoder.
Definition at line 358 of file fetch.hh.
Referenced by doSquash(), Fetch(), fetch(), gem5::o3::ThreadContext::getDecoderPtr(), and pipelineIcacheAccesses().
|
private |
|
private |
|
private |
Can the fetch stage redirect from an interrupt on this instruction?
Definition at line 422 of file fetch.hh.
Referenced by buildInst(), clearStates(), doSquash(), Fetch(), fetch(), fetchCacheLine(), and resetStage().
|
private |
The fetch data that is being fetched and buffered.
Definition at line 484 of file fetch.hh.
Referenced by Fetch(), fetch(), and processCacheCompletion().
|
private |
Mask to align a fetch address to a fetch buffer boundary.
Definition at line 481 of file fetch.hh.
Referenced by fetchBufferAlignPC().
|
private |
The PC of the first instruction loaded into the fetch buffer.
Definition at line 487 of file fetch.hh.
Referenced by clearStates(), Fetch(), fetch(), finishTranslation(), pipelineIcacheAccesses(), and resetStage().
|
private |
The size of the fetch buffer in bytes.
The fetch buffer itself may be smaller than a cache line.
Definition at line 478 of file fetch.hh.
Referenced by Fetch(), fetch(), fetchCacheLine(), finishTranslation(), and processCacheCompletion().
|
private |
Whether or not the fetch buffer data is valid.
Definition at line 496 of file fetch.hh.
Referenced by clearStates(), Fetch(), fetch(), finishTranslation(), pipelineIcacheAccesses(), processCacheCompletion(), and resetStage().
|
private |
Definition at line 417 of file fetch.hh.
Referenced by clearStates(), doSquash(), Fetch(), fetch(), pipelineIcacheAccesses(), and resetStage().
|
private |
|
private |
Queue of fetched instructions.
Per-thread to prevent HoL blocking.
Definition at line 493 of file fetch.hh.
Referenced by buildInst(), clearStates(), doSquash(), fetch(), finishTranslation(), isDrained(), resetStage(), and tick().
|
private |
The size of the fetch queue in micro-ops.
Definition at line 490 of file fetch.hh.
Referenced by buildInst(), fetch(), and finishTranslation().
|
protected |
Referenced by doSquash(), fetch(), finishTranslation(), lookupAndUpdateNextPC(), processCacheCompletion(), profileStall(), and tick().
|
private |
Per-thread status.
Definition at line 190 of file fetch.hh.
Referenced by checkSignalsAndUpdate(), clearStates(), doSquash(), drainSanityCheck(), Fetch(), fetch(), fetchCacheLine(), finishTranslation(), getFetchingThread(), iqCount(), isDrained(), lsqCount(), processCacheCompletion(), profileStall(), recvReqRetry(), resetStage(), roundRobin(), updateFetchStatus(), and wakeFromQuiesce().
|
private |
The width of fetch in instructions.
Definition at line 458 of file fetch.hh.
Referenced by buildInst(), Fetch(), fetch(), finishTranslation(), and gem5::o3::Fetch::FinishTranslationEvent::process().
|
private |
Event used to delay fault generation of translation faults.
Definition at line 528 of file fetch.hh.
Referenced by finishTranslation(), and isDrained().
|
private |
Wire to get commit's information from backwards time buffer.
Definition at line 406 of file fetch.hh.
Referenced by checkSignalsAndUpdate(), setTimeBuffer(), and tick().
|
private |
Wire to get decode's information from backwards time buffer.
Definition at line 397 of file fetch.hh.
Referenced by checkSignalsAndUpdate(), and setTimeBuffer().
|
private |
Wire to get iew's information from backwards time buffer.
Definition at line 403 of file fetch.hh.
Referenced by iqCount(), lsqCount(), and setTimeBuffer().
|
private |
Wire to get rename's information from backwards time buffer.
Definition at line 400 of file fetch.hh.
Referenced by setTimeBuffer().
|
private |
Instruction port.
Note that it has to appear after the fetch stage.
Definition at line 522 of file fetch.hh.
Referenced by finishTranslation(), getInstPort(), and recvReqRetry().
|
private |
|
private |
|
private |
Checks if there is an interrupt pending.
If there is, fetch must stop once it is not fetching PAL instructions.
Definition at line 519 of file fetch.hh.
Referenced by checkInterrupt(), drainSanityCheck(), resetStage(), and tick().
|
private |
|
private |
Icache stall statistics.
Definition at line 502 of file fetch.hh.
Referenced by Fetch(), and finishTranslation().
|
private |
Definition at line 419 of file fetch.hh.
Referenced by clearStates(), doSquash(), Fetch(), fetch(), and resetStage().
|
private |
Memory request used to access cache.
Definition at line 425 of file fetch.hh.
Referenced by clearStates(), doSquash(), drainSanityCheck(), Fetch(), fetchCacheLine(), finishTranslation(), processCacheCompletion(), and resetStage().
|
private |
|
private |
Tracks how many instructions has been fetched this cycle.
Definition at line 433 of file fetch.hh.
Referenced by buildInst(), fetch(), finishTranslation(), gem5::o3::Fetch::FinishTranslationEvent::process(), resetStage(), and tick().
|
private |
Number of threads.
Definition at line 508 of file fetch.hh.
Referenced by drainResume(), drainSanityCheck(), Fetch(), fetch(), getFetchingThread(), isDrained(), resetStage(), roundRobin(), and tick().
|
private |
Definition at line 415 of file fetch.hh.
Referenced by clearStates(), doSquash(), Fetch(), fetch(), fetchCacheLine(), finishTranslation(), pipelineIcacheAccesses(), and resetStage().
|
private |
|
private |
To probe when a fetch request is successfully sent.
Definition at line 201 of file fetch.hh.
Referenced by finishTranslation(), recvReqRetry(), and regProbePoints().
List that has the threads organized by priority.
Definition at line 196 of file fetch.hh.
Referenced by deactivateThread(), resetStage(), roundRobin(), and startupStage().
|
private |
|
private |
The packet that is waiting to be retried.
Definition at line 467 of file fetch.hh.
Referenced by doSquash(), drainSanityCheck(), finishTranslation(), and recvReqRetry().
|
private |
The thread that is waiting on the cache to tell fetch to retry.
Definition at line 470 of file fetch.hh.
Referenced by doSquash(), drainSanityCheck(), finishTranslation(), and recvReqRetry().
|
private |
Tracks which stages are telling fetch to stall.
Definition at line 443 of file fetch.hh.
Referenced by checkSignalsAndUpdate(), checkStall(), clearStates(), drainResume(), drainSanityCheck(), drainStall(), Fetch(), isDrained(), profileStall(), resetStage(), and tick().
|
private |
|
private |
|
private |
Wire used to write any information heading to decode.
Definition at line 410 of file fetch.hh.
Referenced by setFetchQueue(), and tick().
|
private |
Variable that tracks if fetch has written to the time buffer this cycle.
Used to tell CPU if there is activity this cycle.
Definition at line 430 of file fetch.hh.
Referenced by fetch(), finishTranslation(), resetStage(), and tick().