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

#include <base.hh>

Inheritance diagram for BaseSimpleCPU:
BaseCPU AtomicSimpleCPU TimingSimpleCPU

Public Member Functions

 BaseSimpleCPU (BaseSimpleCPUParams *params)
 
virtual ~BaseSimpleCPU ()
 
void wakeup (ThreadID tid) override
 
void init () override
 
Addr dbg_vtophys (Addr addr)
 
void checkForInterrupts ()
 
void setupFetchRequest (Request *req)
 
void preExecute ()
 
void postExecute ()
 
void advancePC (const Fault &fault)
 
void haltContext (ThreadID thread_num) override
 
void regStats () override
 
void resetStats () override
 
void startup () override
 
virtual Fault readMem (Addr addr, uint8_t *data, unsigned size, Request::Flags flags)=0
 
virtual Fault initiateMemRead (Addr addr, unsigned size, Request::Flags flags)=0
 
virtual Fault writeMem (uint8_t *data, unsigned size, Addr addr, Request::Flags flags, uint64_t *res)=0
 
void countInst ()
 
Counter totalInsts () const override
 
Counter totalOps () const override
 
void serializeThread (CheckpointOut &cp, ThreadID tid) const override
 
void unserializeThread (CheckpointIn &cp, ThreadID tid) override
 

Public Attributes

Trace::InstRecordtraceData
 
CheckerCPUchecker
 
std::vector< SimpleExecContext * > threadInfo
 
std::list< ThreadIDactiveThreads
 
TheISA::MachInst inst
 Current instruction. More...
 
StaticInstPtr curStaticInst
 
StaticInstPtr curMacroStaticInst
 

Protected Types

enum  Status {
  Idle, Running, Faulting, ITBWaitResponse,
  IcacheRetry, IcacheWaitResponse, IcacheWaitSwitch, DTBWaitResponse,
  DcacheRetry, DcacheWaitResponse, DcacheWaitSwitch
}
 

Protected Member Functions

void checkPcEventQueue ()
 
void swapActiveThread ()
 

Protected Attributes

ThreadID curThread
 
BPredUnitbranchPred
 
Status _status
 

Additional Inherited Members

- Static Public Member Functions inherited from BaseCPU
static int numSimulatedInsts ()
 
static int numSimulatedOps ()
 
static void wakeup (ThreadID tid)
 

Detailed Description

Definition at line 84 of file base.hh.

Member Enumeration Documentation

enum BaseSimpleCPU::Status
protected
Enumerator
Idle 
Running 
Faulting 
ITBWaitResponse 
IcacheRetry 
IcacheWaitResponse 
IcacheWaitSwitch 
DTBWaitResponse 
DcacheRetry 
DcacheWaitResponse 
DcacheWaitSwitch 

Definition at line 111 of file base.hh.

Constructor & Destructor Documentation

BaseSimpleCPU::BaseSimpleCPU ( BaseSimpleCPUParams *  params)
BaseSimpleCPU::~BaseSimpleCPU ( )
virtual

Definition at line 209 of file base.cc.

Member Function Documentation

void BaseSimpleCPU::advancePC ( const Fault fault)
void BaseSimpleCPU::checkForInterrupts ( )
void BaseSimpleCPU::checkPcEventQueue ( )
protected

Definition at line 145 of file base.cc.

References curThread, pc, ArmISA::system, and threadInfo.

Referenced by TimingSimpleCPU::fetch(), and AtomicSimpleCPU::tick().

void BaseSimpleCPU::countInst ( )
Addr BaseSimpleCPU::dbg_vtophys ( Addr  addr)

Definition at line 414 of file base.cc.

References curThread, and AlphaISA::vtophys().

void BaseSimpleCPU::haltContext ( ThreadID  thread_num)
override

Definition at line 214 of file base.cc.

void BaseSimpleCPU::init ( )
override

Definition at line 129 of file base.cc.

References FullSystem, Stats::init, and AlphaISA::initCPU().

Referenced by TimingSimpleCPU::init(), and AtomicSimpleCPU::init().

virtual Fault BaseSimpleCPU::initiateMemRead ( Addr  addr,
unsigned  size,
Request::Flags  flags 
)
pure virtual
void BaseSimpleCPU::postExecute ( )
void BaseSimpleCPU::preExecute ( )
virtual Fault BaseSimpleCPU::readMem ( Addr  addr,
uint8_t *  data,
unsigned  size,
Request::Flags  flags 
)
pure virtual

Implemented in TimingSimpleCPU, and AtomicSimpleCPU.

Referenced by SimpleExecContext::readMem().

void BaseSimpleCPU::regStats ( )
override
void BaseSimpleCPU::resetStats ( )
override

Definition at line 387 of file base.cc.

References _status, Idle, and threadInfo.

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

Definition at line 395 of file base.cc.

References _status, Idle, Running, and threadInfo.

void BaseSimpleCPU::setupFetchRequest ( Request req)
void BaseSimpleCPU::startup ( )
override

Definition at line 682 of file base.cc.

References threadInfo.

void BaseSimpleCPU::swapActiveThread ( )
protected
Counter BaseSimpleCPU::totalInsts ( ) const
override

Definition at line 188 of file base.cc.

References threadInfo.

Counter BaseSimpleCPU::totalOps ( ) const
override

Definition at line 199 of file base.cc.

References threadInfo.

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

Definition at line 403 of file base.cc.

References threadInfo.

void BaseSimpleCPU::wakeup ( ThreadID  tid)
override
virtual Fault BaseSimpleCPU::writeMem ( uint8_t *  data,
unsigned  size,
Addr  addr,
Request::Flags  flags,
uint64_t *  res 
)
pure virtual

Implemented in TimingSimpleCPU, and AtomicSimpleCPU.

Referenced by SimpleExecContext::writeMem().

Member Data Documentation

Status BaseSimpleCPU::_status
protected
std::list<ThreadID> BaseSimpleCPU::activeThreads
BPredUnit* BaseSimpleCPU::branchPred
protected

Definition at line 88 of file base.hh.

Referenced by advancePC(), and preExecute().

CheckerCPU* BaseSimpleCPU::checker

Definition at line 100 of file base.hh.

Referenced by BaseSimpleCPU().

StaticInstPtr BaseSimpleCPU::curMacroStaticInst

Definition at line 108 of file base.hh.

Referenced by advancePC(), TimingSimpleCPU::fetch(), preExecute(), and AtomicSimpleCPU::tick().

StaticInstPtr BaseSimpleCPU::curStaticInst
ThreadID BaseSimpleCPU::curThread
protected
TheISA::MachInst BaseSimpleCPU::inst

Current instruction.

Definition at line 106 of file base.hh.

Referenced by preExecute(), TimingSimpleCPU::sendFetch(), and AtomicSimpleCPU::tick().

std::vector<SimpleExecContext*> BaseSimpleCPU::threadInfo
Trace::InstRecord* BaseSimpleCPU::traceData

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

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