gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MinorCPU Class Reference

MinorCPU is an in-order CPU model with four fixed pipeline stages: More...

#include <cpu.hh>

Inheritance diagram for MinorCPU:
BaseCPU

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< ThreadIDroundRobinPriority (ThreadID priority)
 Thread scheduling utility functions. More...
 
std::vector< ThreadIDrandomPriority ()
 
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::MinorActivityRecorderactivityRecorder
 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

MasterPortgetDataPort () override
 Return a reference to the data port. More...
 
MasterPortgetInstPort () override
 Return a reference to the instruction port. More...
 

Protected Attributes

Minor::Pipelinepipeline
 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)
 

Detailed Description

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.

Definition at line 79 of file cpu.hh.

Constructor & Destructor Documentation

MinorCPU::MinorCPU ( MinorCPUParams *  params)
MinorCPU::~MinorCPU ( )

Definition at line 84 of file cpu.cc.

References pipeline, and threads.

Member Function Documentation

void MinorCPU::activateContext ( ThreadID  thread_id)
override
Addr MinorCPU::dbg_vtophys ( Addr  addr)

Definition at line 160 of file cpu.cc.

References panic.

DrainState MinorCPU::drain ( )
override

Drain interface.

Definition at line 196 of file cpu.cc.

References DPRINTF, Minor::Pipeline::drain(), Drained, Draining, and pipeline.

void MinorCPU::drainResume ( )
override
MasterPort & MinorCPU::getDataPort ( )
overrideprotected

Return a reference to the data port.

Definition at line 325 of file cpu.cc.

References Minor::Pipeline::getDataPort(), and pipeline.

MasterPort & MinorCPU::getInstPort ( )
overrideprotected

Return a reference to the instruction port.

Definition at line 320 of file cpu.cc.

References Minor::Pipeline::getInstPort(), and pipeline.

void MinorCPU::init ( )
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.

void MinorCPU::memWriteback ( )
override

Definition at line 250 of file cpu.cc.

References DPRINTF.

std::vector<ThreadID> MinorCPU::randomPriority ( )
inline
void MinorCPU::regStats ( )
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.

std::vector<ThreadID> MinorCPU::roundRobinPriority ( ThreadID  priority)
inline
void MinorCPU::serialize ( CheckpointOut cp) const
override

Serialize pipeline data.

Definition at line 146 of file cpu.cc.

References pipeline, X86ISA::serialize(), and Ticked::serialize().

void MinorCPU::serializeThread ( CheckpointOut cp,
ThreadID  tid 
) const
override

Definition at line 134 of file cpu.cc.

References threads.

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().

void MinorCPU::startup ( )
override

Definition at line 180 of file cpu.cc.

References DPRINTF, ArmISA::i, pipeline, threads, and Minor::Pipeline::wakeupFetch().

void MinorCPU::suspendContext ( ThreadID  thread_id)
override

Definition at line 295 of file cpu.cc.

References DPRINTF, and threads.

void MinorCPU::switchOut ( )
override

Switching interface from BaseCPU.

Definition at line 256 of file cpu.cc.

References activityRecorder, DPRINTF, and ActivityRecorder::reset().

void MinorCPU::takeOverFrom ( BaseCPU old_cpu)
override

Definition at line 268 of file cpu.cc.

References DPRINTF, and takeOverFrom().

Counter MinorCPU::totalInsts ( ) const
override

Simple inst count interface from BaseCPU.

Definition at line 331 of file cpu.cc.

References ArmISA::i, and threads.

Counter MinorCPU::totalOps ( ) const
override

Definition at line 342 of file cpu.cc.

References ArmISA::i, and threads.

void MinorCPU::unserialize ( CheckpointIn cp)
override

Definition at line 153 of file cpu.cc.

References pipeline, X86ISA::unserialize(), and Ticked::unserialize().

void MinorCPU::unserializeThread ( CheckpointIn cp,
ThreadID  tid 
)
override

Definition at line 140 of file cpu.cc.

References threads.

void MinorCPU::wakeup ( ThreadID  tid)
override
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().

Member Data Documentation

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().

Minor::Pipeline* MinorCPU::pipeline
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
std::vector<Minor::MinorThread *> MinorCPU::threads

The documentation for this class was generated from the following files:

Generated on Fri Jun 9 2017 13:04:15 for gem5 by doxygen 1.8.6