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

#include <atomic.hh>

Inheritance diagram for AtomicSimpleCPU:
BaseSimpleCPU BaseCPU

Classes

class  AtomicCPUDPort
 
class  AtomicCPUPort
 An AtomicCPUPort overrides the default behaviour of the recvAtomicSnoop and ignores the packet instead of panicking. More...
 
struct  TickEvent
 

Public Member Functions

 AtomicSimpleCPU (AtomicSimpleCPUParams *params)
 
virtual ~AtomicSimpleCPU ()
 
void init () override
 
DrainState drain () override
 
void drainResume () override
 
void switchOut () override
 
void takeOverFrom (BaseCPU *oldCPU) override
 
void verifyMemoryMode () const override
 
void activateContext (ThreadID thread_num) override
 
void suspendContext (ThreadID thread_num) override
 
Fault readMem (Addr addr, uint8_t *data, unsigned size, Request::Flags flags) override
 
Fault initiateMemRead (Addr addr, unsigned size, Request::Flags flags) override
 
Fault writeMem (uint8_t *data, unsigned size, Addr addr, Request::Flags flags, uint64_t *res) override
 
void regProbePoints () override
 
void printAddr (Addr a)
 Print state of address in memory system via PrintReq (for debugging). More...
 
- Public Member Functions inherited from BaseSimpleCPU
 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
 
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
 

Protected Member Functions

MasterPortgetDataPort () override
 Return a reference to the data port. More...
 
MasterPortgetInstPort () override
 Return a reference to the instruction port. More...
 
void threadSnoop (PacketPtr pkt, ThreadID sender)
 Perform snoop for other cpu-local thread contexts. More...
 
- Protected Member Functions inherited from BaseSimpleCPU
void checkPcEventQueue ()
 
void swapActiveThread ()
 

Private Member Functions

void tick ()
 
bool isDrained ()
 Check if a system is in a drained state. More...
 
bool tryCompleteDrain ()
 Try to complete a drain request. More...
 

Private Attributes

TickEvent tickEvent
 
const int width
 
bool locked
 
const bool simulate_data_stalls
 
const bool simulate_inst_stalls
 
AtomicCPUPort icachePort
 
AtomicCPUDPort dcachePort
 
bool fastmem
 
Request ifetch_req
 
Request data_read_req
 
Request data_write_req
 
bool dcache_access
 
Tick dcache_latency
 
ProbePointArg< std::pair
< SimpleThread *, const
StaticInstPtr > > * 
ppCommit
 Probe Points. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from BaseCPU
static int numSimulatedInsts ()
 
static int numSimulatedOps ()
 
static void wakeup (ThreadID tid)
 
- Public Attributes inherited from BaseSimpleCPU
Trace::InstRecordtraceData
 
CheckerCPUchecker
 
std::vector< SimpleExecContext * > threadInfo
 
std::list< ThreadIDactiveThreads
 
TheISA::MachInst inst
 Current instruction. More...
 
StaticInstPtr curStaticInst
 
StaticInstPtr curMacroStaticInst
 
- Protected Types inherited from BaseSimpleCPU
enum  Status {
  Idle, Running, Faulting, ITBWaitResponse,
  IcacheRetry, IcacheWaitResponse, IcacheWaitSwitch, DTBWaitResponse,
  DcacheRetry, DcacheWaitResponse, DcacheWaitSwitch
}
 
- Protected Attributes inherited from BaseSimpleCPU
ThreadID curThread
 
BPredUnitbranchPred
 
Status _status
 

Detailed Description

Definition at line 52 of file atomic.hh.

Constructor & Destructor Documentation

AtomicSimpleCPU::AtomicSimpleCPU ( AtomicSimpleCPUParams *  params)

Definition at line 96 of file atomic.cc.

References BaseSimpleCPU::_status, and BaseSimpleCPU::Idle.

AtomicSimpleCPU::~AtomicSimpleCPU ( )
virtual

Definition at line 109 of file atomic.cc.

References Event::scheduled(), and tickEvent.

Member Function Documentation

void AtomicSimpleCPU::activateContext ( ThreadID  thread_num)
override
DrainState AtomicSimpleCPU::drain ( )
override
void AtomicSimpleCPU::drainResume ( )
override
MasterPort& AtomicSimpleCPU::getDataPort ( )
inlineoverrideprotected

Return a reference to the data port.

Definition at line 184 of file atomic.hh.

References dcachePort.

MasterPort& AtomicSimpleCPU::getInstPort ( )
inlineoverrideprotected

Return a reference to the instruction port.

Definition at line 187 of file atomic.hh.

References icachePort.

void AtomicSimpleCPU::init ( )
override
Fault AtomicSimpleCPU::initiateMemRead ( Addr  addr,
unsigned  size,
Request::Flags  flags 
)
overridevirtual

Implements BaseSimpleCPU.

Definition at line 426 of file atomic.cc.

References panic.

bool AtomicSimpleCPU::isDrained ( )
inlineprivate

Check if a system is in a drained state.

We need to drain if:

  • We are in the middle of a microcode sequence as some CPUs (e.g., HW accelerated CPUs) can't be started in the middle of a gem5 microcode sequence.

  • The CPU is in a LLSC region. This shouldn't normally happen as these are executed atomically within a single tick() call. The only way this can happen at the moment is if there is an event in the PC event queue that affects the CPU state while it is in an LLSC region.

  • Stay at PC is true.

Definition at line 100 of file atomic.hh.

References BaseSimpleCPU::curThread, locked, SimpleThread::microPC(), SimpleExecContext::stayAtPC, SimpleExecContext::thread, and BaseSimpleCPU::threadInfo.

Referenced by drain(), switchOut(), and tryCompleteDrain().

void AtomicSimpleCPU::printAddr ( Addr  a)

Print state of address in memory system via PrintReq (for debugging).

Definition at line 700 of file atomic.cc.

References dcachePort, and MasterPort::printAddr().

Fault AtomicSimpleCPU::readMem ( Addr  addr,
uint8_t *  data,
unsigned  size,
Request::Flags  flags 
)
overridevirtual
void AtomicSimpleCPU::regProbePoints ( )
override

Definition at line 691 of file atomic.cc.

References ppCommit.

void AtomicSimpleCPU::suspendContext ( ThreadID  thread_num)
override
void AtomicSimpleCPU::switchOut ( )
override
void AtomicSimpleCPU::takeOverFrom ( BaseCPU oldCPU)
override

Definition at line 212 of file atomic.cc.

References Event::scheduled(), takeOverFrom(), and tickEvent.

void AtomicSimpleCPU::threadSnoop ( PacketPtr  pkt,
ThreadID  sender 
)
protected
void AtomicSimpleCPU::tick ( )
private
bool AtomicSimpleCPU::tryCompleteDrain ( )
private

Try to complete a drain request.

Returns
true if the CPU is drained, false otherwise.

Definition at line 184 of file atomic.cc.

References DPRINTF, Draining, and isDrained().

Referenced by tick().

void AtomicSimpleCPU::verifyMemoryMode ( ) const
override

Definition at line 221 of file atomic.cc.

References fatal, and ArmISA::system.

Referenced by drainResume().

Fault AtomicSimpleCPU::writeMem ( uint8_t *  data,
unsigned  size,
Addr  addr,
Request::Flags  flags,
uint64_t *  res 
)
overridevirtual

Member Data Documentation

Request AtomicSimpleCPU::data_read_req
private

Definition at line 172 of file atomic.hh.

Referenced by init(), readMem(), and tick().

Request AtomicSimpleCPU::data_write_req
private

Definition at line 173 of file atomic.hh.

Referenced by init(), tick(), and writeMem().

bool AtomicSimpleCPU::dcache_access
private

Definition at line 175 of file atomic.hh.

Referenced by readMem(), tick(), and writeMem().

Tick AtomicSimpleCPU::dcache_latency
private

Definition at line 176 of file atomic.hh.

Referenced by readMem(), tick(), and writeMem().

AtomicCPUDPort AtomicSimpleCPU::dcachePort
private

Definition at line 168 of file atomic.hh.

Referenced by getDataPort(), printAddr(), readMem(), threadSnoop(), and writeMem().

bool AtomicSimpleCPU::fastmem
private

Definition at line 170 of file atomic.hh.

Referenced by readMem(), tick(), and writeMem().

AtomicCPUPort AtomicSimpleCPU::icachePort
private

Definition at line 167 of file atomic.hh.

Referenced by getInstPort(), and tick().

Request AtomicSimpleCPU::ifetch_req
private

Definition at line 171 of file atomic.hh.

Referenced by init(), and tick().

bool AtomicSimpleCPU::locked
private

Definition at line 75 of file atomic.hh.

Referenced by isDrained(), readMem(), tick(), and writeMem().

ProbePointArg<std::pair<SimpleThread*, const StaticInstPtr> >* AtomicSimpleCPU::ppCommit
private

Probe Points.

Definition at line 179 of file atomic.hh.

Referenced by regProbePoints(), and tick().

const bool AtomicSimpleCPU::simulate_data_stalls
private

Definition at line 76 of file atomic.hh.

Referenced by tick().

const bool AtomicSimpleCPU::simulate_inst_stalls
private

Definition at line 77 of file atomic.hh.

Referenced by tick().

TickEvent AtomicSimpleCPU::tickEvent
private
const int AtomicSimpleCPU::width
private

Definition at line 74 of file atomic.hh.

Referenced by tick().


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

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