gem5
|
The constructed pipeline. More...
#include <pipeline.hh>
Public Types | |
enum | StageId { CPUStageId = 0, Fetch1StageId, Fetch2StageId, DecodeStageId, ExecuteStageId, Num_StageId } |
Enumerated ids of the 'stages' for the activity recorder. More... | |
Public Member Functions | |
Pipeline (MinorCPU &cpu_, MinorCPUParams ¶ms) | |
void | wakeupFetch (ThreadID tid) |
Wake up the Fetch unit. More... | |
bool | drain () |
Try to drain the CPU. More... | |
void | drainResume () |
bool | isDrained () |
Test to see if the CPU is drained. More... | |
void | evaluate () override |
A custom evaluate allows report in the right place (between stages and pipeline advance) More... | |
void | countCycles (Cycles delta) override |
Callback to handle cycle statistics and probes. More... | |
void | minorTrace () const |
MinorCPU::MinorCPUPort & | getInstPort () |
Functions below here are BaseCPU operations passed on to pipeline stages. More... | |
MinorCPU::MinorCPUPort & | getDataPort () |
Return the DcachePort belonging to Execute for the CPU. More... | |
MinorActivityRecorder * | getActivityRecorder () |
To give the activity recorder to the CPU. More... | |
Public Member Functions inherited from Ticked | |
Ticked (ClockedObject &object_, Stats::Scalar *imported_num_cycles=NULL, Event::Priority priority=Event::CPU_Tick_Pri) | |
virtual | ~Ticked () |
void | regStats () |
Register {num,ticks}Cycles if necessary. More... | |
void | start () |
Start ticking. More... | |
Cycles | cyclesSinceLastStopped () const |
How long have we been stopped for? More... | |
void | resetLastStopped () |
Reset stopped time to current time. More... | |
void | stop () |
Cancel the next tick event and issue no more. More... | |
void | serialize (CheckpointOut &cp) const override |
Checkpoint lastStopped. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
Public Member Functions inherited from Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Attributes | |
bool | needToSignalDrained |
True after drain is called but draining isn't complete. More... | |
Protected Attributes | |
MinorCPU & | cpu |
bool | allow_idling |
Allow cycles to be skipped when the pipeline is idle. More... | |
Latch< ForwardLineData > | f1ToF2 |
Latch< BranchData > | f2ToF1 |
Latch< ForwardInstData > | f2ToD |
Latch< ForwardInstData > | dToE |
Latch< BranchData > | eToF1 |
Execute | execute |
Decode | decode |
Fetch2 | fetch2 |
Fetch1 | fetch1 |
MinorActivityRecorder | activityRecorder |
Activity recording for the pipeline. More... | |
Protected Attributes inherited from Ticked | |
ClockedObject & | object |
ClockedObject who is responsible for this Ticked's actions/stats. More... | |
ClockEvent | event |
The single instance of ClockEvent used. More... | |
bool | running |
Have I been started? and am not stopped. More... | |
Cycles | lastStopped |
Time of last stop event to calculate run time. More... | |
Stats::Scalar & | numCycles |
Total number of cycles either ticked or spend stopped. More... | |
Stats::Scalar | tickCycles |
Number of cycles ticked. More... | |
Stats::Formula | idleCycles |
Number of cycles stopped. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Get the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
static void | unserializeGlobals (CheckpointIn &cp) |
Static Public Attributes inherited from Serializable | |
static int | ckptCount = 0 |
static int | ckptMaxCount = 0 |
static int | ckptPrevCount = -1 |
The constructed pipeline.
Kept out of MinorCPU to keep the interface between the CPU and its grubby implementation details clean.
Definition at line 71 of file pipeline.hh.
Enumerated ids of the 'stages' for the activity recorder.
Enumerator | |
---|---|
CPUStageId | |
Fetch1StageId | |
Fetch2StageId | |
DecodeStageId | |
ExecuteStageId | |
Num_StageId |
Definition at line 97 of file pipeline.hh.
Minor::Pipeline::Pipeline | ( | MinorCPU & | cpu_, |
MinorCPUParams & | params | ||
) |
Definition at line 56 of file pipeline.cc.
|
inlineoverridevirtual |
Callback to handle cycle statistics and probes.
This callback is called at the beginning of a new cycle active cycle and when restarting the ticked object. The delta parameter indicates the number of cycles elapsed since the previous call is normally '1' unless the object has been stopped and restarted.
delta | Number of cycles since the previous call. |
Reimplemented from Ticked.
Definition at line 129 of file pipeline.hh.
References cpu.
bool Minor::Pipeline::drain | ( | ) |
Try to drain the CPU.
Definition at line 197 of file pipeline.cc.
References DPRINTF, Minor::Execute::drain(), execute, isDrained(), and needToSignalDrained.
Referenced by MinorCPU::drain().
void Minor::Pipeline::drainResume | ( | ) |
Definition at line 213 of file pipeline.cc.
References cpu, DPRINTF, Minor::Execute::drainResume(), execute, fetch1, and Minor::Fetch1::wakeupFetch().
Referenced by MinorCPU::drainResume().
|
overridevirtual |
A custom evaluate allows report in the right place (between stages and pipeline advance)
Implements Ticked.
Definition at line 124 of file pipeline.cc.
References ActivityRecorder::active(), activityRecorder, allow_idling, cpu, CPUStageId, ActivityRecorder::deactivateStage(), decode, DecodeStageId, DPRINTF, dToE, DTRACE, eToF1, Minor::MinorActivityRecorder::evaluate(), Minor::Decode::evaluate(), Minor::Fetch2::evaluate(), Minor::Execute::evaluate(), Minor::Fetch1::evaluate(), execute, ExecuteStageId, f1ToF2, f2ToD, f2ToF1, fetch1, Fetch1StageId, fetch2, Fetch2StageId, isDrained(), minorTrace(), needToSignalDrained, MinorCPU::signalDrainDone(), and Ticked::stop().
|
inline |
To give the activity recorder to the CPU.
Definition at line 145 of file pipeline.hh.
References activityRecorder.
Referenced by MinorCPU::MinorCPU().
MinorCPU::MinorCPUPort & Minor::Pipeline::getDataPort | ( | ) |
Return the DcachePort belonging to Execute for the CPU.
Definition at line 185 of file pipeline.cc.
References execute, and Minor::Execute::getDcachePort().
Referenced by MinorCPU::getDataPort().
MinorCPU::MinorCPUPort & Minor::Pipeline::getInstPort | ( | ) |
Functions below here are BaseCPU operations passed on to pipeline stages.
Return the IcachePort belonging to Fetch1 for the CPU
Definition at line 179 of file pipeline.cc.
References fetch1, and Minor::Fetch1::getIcachePort().
Referenced by MinorCPU::getInstPort().
bool Minor::Pipeline::isDrained | ( | ) |
Test to see if the CPU is drained.
Definition at line 225 of file pipeline.cc.
References decode, DPRINTF, dToE, execute, f1ToF2, f2ToD, f2ToF1, fetch1, fetch2, Minor::Decode::isDrained(), Minor::Fetch2::isDrained(), Minor::Execute::isDrained(), and Minor::Fetch1::isDrained().
Referenced by drain(), and evaluate().
void Minor::Pipeline::minorTrace | ( | ) | const |
Definition at line 109 of file pipeline.cc.
References activityRecorder, decode, dToE, eToF1, execute, f1ToF2, f2ToD, f2ToF1, fetch1, fetch2, Minor::MinorActivityRecorder::minorTrace(), Minor::Decode::minorTrace(), Minor::Fetch2::minorTrace(), Minor::Execute::minorTrace(), and Minor::Fetch1::minorTrace().
Referenced by evaluate().
void Minor::Pipeline::wakeupFetch | ( | ThreadID | tid | ) |
Wake up the Fetch unit.
This is needed on thread activation esp. after quiesce wakeup
Definition at line 191 of file pipeline.cc.
References fetch1, and Minor::Fetch1::wakeupFetch().
Referenced by MinorCPU::activateContext(), and MinorCPU::startup().
|
protected |
Activity recording for the pipeline.
This is access through the CPU by the pipeline stages but belongs to the Pipeline as it is the cleanest place to initialise it
Definition at line 93 of file pipeline.hh.
Referenced by evaluate(), getActivityRecorder(), and minorTrace().
|
protected |
Allow cycles to be skipped when the pipeline is idle.
Definition at line 77 of file pipeline.hh.
Referenced by evaluate().
|
protected |
Definition at line 74 of file pipeline.hh.
Referenced by countCycles(), drainResume(), evaluate(), and Pipeline().
|
protected |
Definition at line 86 of file pipeline.hh.
Referenced by evaluate(), isDrained(), and minorTrace().
|
protected |
Definition at line 82 of file pipeline.hh.
Referenced by evaluate(), isDrained(), and minorTrace().
|
protected |
Definition at line 83 of file pipeline.hh.
Referenced by evaluate(), and minorTrace().
|
protected |
Definition at line 85 of file pipeline.hh.
Referenced by drain(), drainResume(), evaluate(), getDataPort(), isDrained(), and minorTrace().
|
protected |
Definition at line 79 of file pipeline.hh.
Referenced by evaluate(), isDrained(), and minorTrace().
|
protected |
Definition at line 81 of file pipeline.hh.
Referenced by evaluate(), isDrained(), and minorTrace().
|
protected |
Definition at line 80 of file pipeline.hh.
Referenced by evaluate(), isDrained(), and minorTrace().
|
protected |
Definition at line 88 of file pipeline.hh.
Referenced by drainResume(), evaluate(), getInstPort(), isDrained(), minorTrace(), and wakeupFetch().
|
protected |
Definition at line 87 of file pipeline.hh.
Referenced by evaluate(), isDrained(), and minorTrace().
bool Minor::Pipeline::needToSignalDrained |
True after drain is called but draining isn't complete.
Definition at line 107 of file pipeline.hh.
Referenced by drain(), and evaluate().