gem5  v21.2.1.1
Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
gem5::BaseSimpleCPU Class Referenceabstract

#include <base.hh>

Inheritance diagram for gem5::BaseSimpleCPU:
gem5::AtomicSimpleCPU gem5::TimingSimpleCPU gem5::NonCachingSimpleCPU

Public Member Functions

 BaseSimpleCPU (const BaseSimpleCPUParams &params)
 
virtual ~BaseSimpleCPU ()
 
void wakeup (ThreadID tid) override
 
void checkForInterrupts ()
 
void setupFetchRequest (const RequestPtr &req)
 
void serviceInstCountEvents ()
 
void preExecute ()
 
void postExecute ()
 
void advancePC (const Fault &fault)
 
void haltContext (ThreadID thread_num) override
 
void resetStats () override
 
virtual Fault readMem (Addr addr, uint8_t *data, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >())
 
virtual Fault initiateMemRead (Addr addr, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >())
 
virtual Fault writeMem (uint8_t *data, unsigned size, Addr addr, Request::Flags flags, uint64_t *res, const std::vector< bool > &byte_enable=std::vector< bool >())
 
virtual Fault amoMem (Addr addr, uint8_t *data, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op)
 
virtual Fault initiateMemAMO (Addr addr, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op)
 
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
 
virtual Fault initiateHtmCmd (Request::Flags flags)=0
 Hardware transactional memory commands (HtmCmds), e.g. More...
 

Public Attributes

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

Protected Types

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

Protected Member Functions

void checkPcEventQueue ()
 
void swapActiveThread ()
 
void traceFault ()
 Handler used when encountering a fault; its purpose is to tear down the InstRecord. More...
 

Protected Attributes

ThreadID curThread
 
branch_prediction::BPredUnitbranchPred
 
const RegIndex zeroReg
 
Status _status
 
std::unique_ptr< PCStateBasepreExecuteTempPC
 

Detailed Description

Definition at line 83 of file base.hh.

Member Enumeration Documentation

◆ Status

Enumerator
Idle 
Running 
Faulting 
ITBWaitResponse 
IcacheRetry 
IcacheWaitResponse 
IcacheWaitSwitch 
DTBWaitResponse 
DcacheRetry 
DcacheWaitResponse 
DcacheWaitSwitch 

Definition at line 110 of file base.hh.

Constructor & Destructor Documentation

◆ BaseSimpleCPU()

gem5::BaseSimpleCPU::BaseSimpleCPU ( const BaseSimpleCPUParams &  params)

◆ ~BaseSimpleCPU()

gem5::BaseSimpleCPU::~BaseSimpleCPU ( )
virtual

Definition at line 187 of file base.cc.

Member Function Documentation

◆ advancePC()

void gem5::BaseSimpleCPU::advancePC ( const Fault fault)

◆ amoMem()

virtual Fault gem5::BaseSimpleCPU::amoMem ( Addr  addr,
uint8_t *  data,
unsigned  size,
Request::Flags  flags,
AtomicOpFunctorPtr  amo_op 
)
inlinevirtual

Reimplemented in gem5::AtomicSimpleCPU.

Definition at line 173 of file base.hh.

References panic.

Referenced by gem5::SimpleExecContext::amoMem().

◆ checkForInterrupts()

void gem5::BaseSimpleCPU::checkForInterrupts ( )

◆ checkPcEventQueue()

void gem5::BaseSimpleCPU::checkPcEventQueue ( )
protected

Definition at line 125 of file base.cc.

References curThread, gem5::MipsISA::pc, and threadInfo.

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

◆ countInst()

void gem5::BaseSimpleCPU::countInst ( )

◆ haltContext()

void gem5::BaseSimpleCPU::haltContext ( ThreadID  thread_num)
override

Definition at line 192 of file base.cc.

◆ initiateHtmCmd()

virtual Fault gem5::BaseSimpleCPU::initiateHtmCmd ( Request::Flags  flags)
pure virtual

Hardware transactional memory commands (HtmCmds), e.g.

start a transaction and commit a transaction, are memory operations but are neither really (true) loads nor stores. For this reason the interface is extended and initiateHtmCmd() is used to instigate the command.

Implemented in gem5::TimingSimpleCPU, and gem5::AtomicSimpleCPU.

Referenced by gem5::SimpleExecContext::initiateHtmCmd().

◆ initiateMemAMO()

virtual Fault gem5::BaseSimpleCPU::initiateMemAMO ( Addr  addr,
unsigned  size,
Request::Flags  flags,
AtomicOpFunctorPtr  amo_op 
)
inlinevirtual

Reimplemented in gem5::TimingSimpleCPU.

Definition at line 180 of file base.hh.

References panic.

Referenced by gem5::SimpleExecContext::initiateMemAMO().

◆ initiateMemRead()

virtual Fault gem5::BaseSimpleCPU::initiateMemRead ( Addr  addr,
unsigned  size,
Request::Flags  flags,
const std::vector< bool > &  byte_enable = std::vector<bool>() 
)
inlinevirtual

Reimplemented in gem5::TimingSimpleCPU.

Definition at line 158 of file base.hh.

References panic.

Referenced by gem5::SimpleExecContext::initiateMemRead().

◆ postExecute()

void gem5::BaseSimpleCPU::postExecute ( )

Definition at line 387 of file base.cc.

References curStaticInst, curThread, gem5::Trace::InstRecord::dump(), gem5::SimpleExecContext::execContextStats, gem5::FullSystem, gem5::StaticInst::isAtomic(), gem5::StaticInst::isCall(), gem5::StaticInst::isCondCtrl(), gem5::StaticInst::isControl(), gem5::StaticInst::isFloating(), gem5::StaticInst::isInteger(), gem5::StaticInst::isLoad(), gem5::StaticInst::isMemRef(), gem5::StaticInst::isReturn(), gem5::StaticInst::isStore(), gem5::StaticInst::isVector(), gem5::SimpleExecContext::ExecContextStats::numBranches, gem5::SimpleExecContext::ExecContextStats::numCallsReturns, gem5::SimpleExecContext::ExecContextStats::numCondCtrlInsts, gem5::SimpleExecContext::ExecContextStats::numFpAluAccesses, gem5::SimpleExecContext::ExecContextStats::numFpInsts, gem5::SimpleExecContext::ExecContextStats::numIntAluAccesses, gem5::SimpleExecContext::ExecContextStats::numIntInsts, gem5::SimpleExecContext::numLoad, gem5::SimpleExecContext::ExecContextStats::numLoadInsts, gem5::SimpleExecContext::ExecContextStats::numMemRefs, gem5::SimpleExecContext::ExecContextStats::numStoreInsts, gem5::SimpleExecContext::ExecContextStats::numVecAluAccesses, gem5::SimpleExecContext::ExecContextStats::numVecInsts, gem5::StaticInst::opClass(), gem5::SimpleExecContext::ExecContextStats::statExecutedInstType, threadInfo, and traceData.

Referenced by gem5::TimingSimpleCPU::completeDataAccess(), gem5::TimingSimpleCPU::completeIfetch(), gem5::AtomicSimpleCPU::tick(), and gem5::TimingSimpleCPU::translationFault().

◆ preExecute()

void gem5::BaseSimpleCPU::preExecute ( )

◆ readMem()

virtual Fault gem5::BaseSimpleCPU::readMem ( Addr  addr,
uint8_t *  data,
unsigned  size,
Request::Flags  flags,
const std::vector< bool > &  byte_enable = std::vector<bool>() 
)
inlinevirtual

Reimplemented in gem5::AtomicSimpleCPU.

Definition at line 151 of file base.hh.

References panic.

Referenced by gem5::SimpleExecContext::readMem().

◆ resetStats()

void gem5::BaseSimpleCPU::resetStats ( )
override

Definition at line 200 of file base.cc.

References _status, Idle, and threadInfo.

◆ serializeThread()

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

Definition at line 209 of file base.cc.

References _status, Idle, Running, and threadInfo.

◆ serviceInstCountEvents()

void gem5::BaseSimpleCPU::serviceInstCountEvents ( )

◆ setupFetchRequest()

void gem5::BaseSimpleCPU::setupFetchRequest ( const RequestPtr req)

◆ swapActiveThread()

void gem5::BaseSimpleCPU::swapActiveThread ( )
protected

◆ totalInsts()

Counter gem5::BaseSimpleCPU::totalInsts ( ) const
override

Definition at line 166 of file base.cc.

References threadInfo.

◆ totalOps()

Counter gem5::BaseSimpleCPU::totalOps ( ) const
override

Definition at line 177 of file base.cc.

References threadInfo.

◆ traceFault()

void gem5::BaseSimpleCPU::traceFault ( )
protected

Handler used when encountering a fault; its purpose is to tear down the InstRecord.

If a fault is meant to be traced, the handler won't delete the record and it will annotate the record as coming from a faulting instruction.

Definition at line 239 of file base.cc.

References gem5::Trace::InstRecord::setFaulting(), and traceData.

Referenced by gem5::TimingSimpleCPU::completeDataAccess(), gem5::TimingSimpleCPU::completeIfetch(), gem5::AtomicSimpleCPU::tick(), and gem5::TimingSimpleCPU::translationFault().

◆ unserializeThread()

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

Definition at line 217 of file base.cc.

References threadInfo.

◆ wakeup()

void gem5::BaseSimpleCPU::wakeup ( ThreadID  tid)
override

◆ writeMem()

virtual Fault gem5::BaseSimpleCPU::writeMem ( uint8_t *  data,
unsigned  size,
Addr  addr,
Request::Flags  flags,
uint64_t *  res,
const std::vector< bool > &  byte_enable = std::vector<bool>() 
)
inlinevirtual

Reimplemented in gem5::TimingSimpleCPU, and gem5::AtomicSimpleCPU.

Definition at line 165 of file base.hh.

References panic.

Referenced by gem5::SimpleExecContext::writeMem().

Member Data Documentation

◆ _status

Status gem5::BaseSimpleCPU::_status
protected

◆ activeThreads

std::list<ThreadID> gem5::BaseSimpleCPU::activeThreads

◆ branchPred

branch_prediction::BPredUnit* gem5::BaseSimpleCPU::branchPred
protected

Definition at line 87 of file base.hh.

Referenced by advancePC(), and preExecute().

◆ checker

CheckerCPU* gem5::BaseSimpleCPU::checker

Definition at line 100 of file base.hh.

Referenced by BaseSimpleCPU().

◆ curMacroStaticInst

StaticInstPtr gem5::BaseSimpleCPU::curMacroStaticInst

◆ curStaticInst

StaticInstPtr gem5::BaseSimpleCPU::curStaticInst

◆ curThread

ThreadID gem5::BaseSimpleCPU::curThread
protected

◆ preExecuteTempPC

std::unique_ptr<PCStateBase> gem5::BaseSimpleCPU::preExecuteTempPC
protected

Definition at line 135 of file base.hh.

Referenced by preExecute().

◆ threadInfo

std::vector<SimpleExecContext*> gem5::BaseSimpleCPU::threadInfo

Definition at line 102 of file base.hh.

Referenced by gem5::AtomicSimpleCPU::activateContext(), gem5::TimingSimpleCPU::activateContext(), gem5::TimingSimpleCPU::advanceInst(), advancePC(), gem5::AtomicSimpleCPU::amoMem(), BaseSimpleCPU(), checkForInterrupts(), checkPcEventQueue(), gem5::TimingSimpleCPU::completeDataAccess(), gem5::TimingSimpleCPU::completeIfetch(), countInst(), gem5::AtomicSimpleCPU::drainResume(), gem5::TimingSimpleCPU::drainResume(), gem5::TimingSimpleCPU::fetch(), gem5::NonCachingSimpleCPU::fetchInstMem(), gem5::AtomicSimpleCPU::fetchInstMem(), gem5::AtomicSimpleCPU::genMemFragmentRequest(), gem5::TimingSimpleCPU::handleReadPacket(), gem5::TimingSimpleCPU::handleWritePacket(), gem5::TimingSimpleCPU::htmSendAbortSignal(), gem5::TimingSimpleCPU::initiateHtmCmd(), gem5::TimingSimpleCPU::initiateMemAMO(), gem5::TimingSimpleCPU::initiateMemRead(), gem5::AtomicSimpleCPU::isCpuDrained(), gem5::TimingSimpleCPU::isCpuDrained(), postExecute(), preExecute(), gem5::AtomicSimpleCPU::readMem(), gem5::AtomicSimpleCPU::AtomicCPUDPort::recvAtomicSnoop(), gem5::AtomicSimpleCPU::AtomicCPUDPort::recvFunctionalSnoop(), gem5::TimingSimpleCPU::DcachePort::recvTimingSnoopReq(), resetStats(), gem5::TimingSimpleCPU::sendData(), gem5::TimingSimpleCPU::sendFetch(), gem5::TimingSimpleCPU::sendSplitData(), serializeThread(), serviceInstCountEvents(), setupFetchRequest(), gem5::AtomicSimpleCPU::suspendContext(), gem5::TimingSimpleCPU::suspendContext(), swapActiveThread(), gem5::TimingSimpleCPU::switchOut(), gem5::TimingSimpleCPU::threadSnoop(), gem5::AtomicSimpleCPU::threadSnoop(), gem5::AtomicSimpleCPU::tick(), totalInsts(), totalOps(), unserializeThread(), wakeup(), gem5::AtomicSimpleCPU::writeMem(), and gem5::TimingSimpleCPU::writeMem().

◆ traceData

Trace::InstRecord* gem5::BaseSimpleCPU::traceData

◆ zeroReg

const RegIndex gem5::BaseSimpleCPU::zeroReg
protected

Definition at line 89 of file base.hh.

Referenced by preExecute().


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

Generated on Wed May 4 2022 12:14:30 for gem5 by doxygen 1.8.17