gem5
|
MinorCPU is an in-order CPU model with four fixed pipeline stages: More...
#include <cpu.hh>
Classes | |
class | MinorCPUPort |
Provide a non-protected base class for Minor's Ports as derived classes are created by Fetch1 and Execute. More... | |
Public Member Functions | |
MinorCPU (MinorCPUParams *params) | |
~MinorCPU () | |
void | init () override |
Starting, waking and initialisation. More... | |
void | startup () override |
void | wakeup (ThreadID tid) override |
Addr | dbg_vtophys (Addr addr) |
void | regStats () override |
Stats interface from SimObject (by way of BaseCPU) More... | |
Counter | totalInsts () const override |
Simple inst count interface from BaseCPU. More... | |
Counter | totalOps () const override |
void | serializeThread (CheckpointOut &cp, ThreadID tid) const override |
void | unserializeThread (CheckpointIn &cp, ThreadID tid) override |
void | serialize (CheckpointOut &cp) const override |
Serialize pipeline data. More... | |
void | unserialize (CheckpointIn &cp) override |
DrainState | drain () override |
Drain interface. More... | |
void | drainResume () override |
void | signalDrainDone () |
Signal from Pipeline that MinorCPU should signal that a drain is complete and set its drainState. More... | |
void | memWriteback () override |
void | switchOut () override |
Switching interface from BaseCPU. More... | |
void | takeOverFrom (BaseCPU *old_cpu) override |
void | activateContext (ThreadID thread_id) override |
Thread activation interface from BaseCPU. More... | |
void | suspendContext (ThreadID thread_id) override |
std::vector< ThreadID > | roundRobinPriority (ThreadID priority) |
Thread scheduling utility functions. More... | |
std::vector< ThreadID > | randomPriority () |
void | wakeupOnEvent (unsigned int stage_id) |
Interface for stages to signal that they have become active after a callback or eventq event where the pipeline itself may have already been idled. More... | |
Public Attributes | |
Minor::MinorActivityRecorder * | activityRecorder |
Activity recording for pipeline. More... | |
std::vector< Minor::MinorThread * > | threads |
These are thread state-representing objects for this CPU. More... | |
Enums::ThreadPolicy | threadPolicy |
Thread Scheduling Policy (RoundRobin, Random, etc) More... | |
Minor::MinorStats | stats |
Processor-specific statistics. More... | |
Protected Member Functions | |
MasterPort & | getDataPort () override |
Return a reference to the data port. More... | |
MasterPort & | getInstPort () override |
Return a reference to the instruction port. More... | |
Protected Attributes | |
Minor::Pipeline * | pipeline |
pipeline is a container for the clockable pipeline stage objects. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from BaseCPU | |
static int | numSimulatedInsts () |
static int | numSimulatedOps () |
static void | wakeup (ThreadID tid) |
MinorCPU is an in-order CPU model with four fixed pipeline stages:
Fetch1 - fetches lines from memory Fetch2 - decomposes lines into macro-op instructions Decode - decomposes macro-ops into micro-ops Execute - executes those micro-ops
This pipeline is carried in the MinorCPU::pipeline object. The exec_context interface is not carried by MinorCPU but by Minor::ExecContext objects created by Minor::Execute.
MinorCPU::MinorCPU | ( | MinorCPUParams * | params | ) |
Definition at line 50 of file cpu.cc.
References activityRecorder, fatal, FullSystem, Minor::Pipeline::getActivityRecorder(), SimpleThread::getTC(), ThreadContext::Halted, ArmISA::i, Minor::MinorDynInst::init(), pipeline, SimpleThread::setStatus(), and threads.
|
override |
Thread activation interface from BaseCPU.
Definition at line 276 of file cpu.cc.
References Minor::Pipeline::CPUStageId, Ticked::cyclesSinceLastStopped(), DPRINTF, pipeline, Minor::MinorStats::quiesceCycles, Ticked::resetLastStopped(), stats, threads, Minor::Pipeline::wakeupFetch(), and wakeupOnEvent().
|
override |
|
override |
Definition at line 224 of file cpu.cc.
References DPRINTF, Minor::Pipeline::drainResume(), fatal, pipeline, Ticked::resetLastStopped(), ArmISA::system, and wakeup().
|
overrideprotected |
Return a reference to the data port.
Definition at line 325 of file cpu.cc.
References Minor::Pipeline::getDataPort(), and pipeline.
|
overrideprotected |
Return a reference to the instruction port.
Definition at line 320 of file cpu.cc.
References Minor::Pipeline::getInstPort(), and pipeline.
|
override |
Starting, waking and initialisation.
Definition at line 94 of file cpu.cc.
References fatal, FullSystem, Stats::init, AlphaISA::initCPU(), ThreadContext::initMemProxies(), ArmISA::system, and threads.
|
inline |
Definition at line 178 of file cpu.hh.
References ArmISA::i.
Referenced by Minor::Execute::getCommittingThread(), Minor::Execute::getIssuingThread(), Minor::Decode::getScheduledThread(), Minor::Fetch2::getScheduledThread(), and Minor::Fetch1::getScheduledThread().
|
override |
Stats interface from SimObject (by way of BaseCPU)
Definition at line 126 of file cpu.cc.
References name(), pipeline, Minor::MinorStats::regStats(), Ticked::regStats(), and stats.
|
inline |
Thread scheduling utility functions.
Definition at line 169 of file cpu.hh.
References ArmISA::i.
Referenced by Minor::Execute::getCommittingThread(), Minor::Execute::getIssuingThread(), Minor::Decode::getScheduledThread(), Minor::Fetch2::getScheduledThread(), and Minor::Fetch1::getScheduledThread().
|
override |
Serialize pipeline data.
Definition at line 146 of file cpu.cc.
References pipeline, X86ISA::serialize(), and Ticked::serialize().
|
override |
void MinorCPU::signalDrainDone | ( | ) |
Signal from Pipeline that MinorCPU should signal that a drain is complete and set its drainState.
Definition at line 217 of file cpu.cc.
References DPRINTF, and Drainable::signalDrainDone().
Referenced by Minor::Pipeline::evaluate().
|
override |
|
override |
|
override |
Switching interface from BaseCPU.
Definition at line 256 of file cpu.cc.
References activityRecorder, DPRINTF, and ActivityRecorder::reset().
|
override |
Definition at line 268 of file cpu.cc.
References DPRINTF, and takeOverFrom().
|
override |
|
override |
|
override |
Definition at line 153 of file cpu.cc.
References pipeline, X86ISA::unserialize(), and Ticked::unserialize().
|
override |
|
override |
Definition at line 169 of file cpu.cc.
References DPRINTF, ArmISA::status, ThreadContext::Suspended, and threads.
Referenced by drainResume(), Minor::LSQ::recvTimingSnoopReq(), and Minor::LSQ::threadSnoop().
void MinorCPU::wakeupOnEvent | ( | unsigned int | stage_id | ) |
Interface for stages to signal that they have become active after a callback or eventq event where the pipeline itself may have already been idled.
The stage argument should be from the enumeration Pipeline::StageId
Definition at line 305 of file cpu.cc.
References ActivityRecorder::activateStage(), activityRecorder, DPRINTF, pipeline, and Ticked::start().
Referenced by activateContext(), Minor::Execute::drain(), Minor::Execute::drainResume(), Minor::Execute::evaluate(), Minor::Fetch1::evaluate(), Minor::Fetch1::recvTimingResp(), Minor::LSQ::recvTimingResp(), Minor::Fetch1::tryToSendToTransfers(), and Minor::Fetch1::wakeupFetch().
Minor::MinorActivityRecorder* MinorCPU::activityRecorder |
Activity recording for pipeline.
This belongs to Pipeline but stages will access it through the CPU as the MinorCPU object actually mediates idling behaviour
Definition at line 90 of file cpu.hh.
Referenced by Minor::Decode::evaluate(), Minor::Fetch2::evaluate(), Minor::Execute::evaluate(), Minor::Fetch1::evaluate(), Minor::Execute::issue(), MinorCPU(), switchOut(), and wakeupOnEvent().
|
protected |
pipeline is a container for the clockable pipeline stage objects.
Elements of pipeline call TheISA to implement the model.
Definition at line 84 of file cpu.hh.
Referenced by activateContext(), drain(), drainResume(), getDataPort(), getInstPort(), MinorCPU(), regStats(), serialize(), startup(), unserialize(), wakeupOnEvent(), and ~MinorCPU().
Minor::MinorStats MinorCPU::stats |
Processor-specific statistics.
Definition at line 136 of file cpu.hh.
Referenced by activateContext(), Minor::Execute::commit(), Minor::Execute::commitInst(), Minor::Execute::doInstCommitAccounting(), and regStats().
Enums::ThreadPolicy MinorCPU::threadPolicy |
Thread Scheduling Policy (RoundRobin, Random, etc)
Definition at line 114 of file cpu.hh.
Referenced by Minor::Execute::getCommittingThread(), Minor::Execute::getIssuingThread(), Minor::Decode::getScheduledThread(), Minor::Fetch2::getScheduledThread(), and Minor::Fetch1::getScheduledThread().
std::vector<Minor::MinorThread *> MinorCPU::threads |
These are thread state-representing objects for this CPU.
If you need a ThreadContext for any reason, use threads[threadId]->getTC()
Definition at line 95 of file cpu.hh.
Referenced by activateContext(), Minor::Execute::commitInst(), Minor::Execute::doInstCommitAccounting(), Minor::Execute::executeMemRefInst(), Minor::Fetch1::fetchLine(), Minor::Execute::handleMemResponse(), init(), MinorCPU(), Minor::LSQ::pushRequest(), Minor::ExecContext::readRegOtherThread(), serializeThread(), Minor::ExecContext::setRegOtherThread(), startup(), suspendContext(), totalInsts(), totalOps(), Minor::LSQ::tryToSendToTransfers(), unserializeThread(), wakeup(), and ~MinorCPU().