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

#include <RubySystem.hh>

Inheritance diagram for RubySystem:
ClockedObject SimObject Clocked EventManager Serializable Drainable

Classes

class  RubyEvent
 

Public Types

typedef RubySystemParams Params
 
- Public Types inherited from ClockedObject
typedef ClockedObjectParams Params
 Parameters of ClockedObject. More...
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 

Public Member Functions

 RubySystem (const Params *p)
 
 ~RubySystem ()
 
SimpleMemorygetPhysMem ()
 
Cycles getStartCycle ()
 
bool getAccessBackingStore ()
 
ProfilergetProfiler ()
 
void regStats () override
 Register statistics for this object. More...
 
void collateStats ()
 
void resetStats () override
 Reset statistics associated with this object. More...
 
void memWriteback () override
 Write back dirty buffers to memory using functional writes. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
void drainResume () override
 Resume execution after a successful drain. More...
 
void process ()
 
void startup () override
 startup() is the final initialization call before simulation. More...
 
bool functionalRead (Packet *ptr)
 
bool functionalWrite (Packet *ptr)
 
void registerNetwork (Network *)
 
void registerAbstractController (AbstractController *)
 
bool eventQueueEmpty ()
 
void enqueueRubyEvent (Tick tick)
 
- Public Member Functions inherited from ClockedObject
 ClockedObject (const ClockedObjectParams *p)
 
const Paramsparams () const
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
Enums::PwrState pwrState () const
 
std::string pwrStateName () const
 
std::vector< double > pwrStateWeights () const
 Returns the percentage residency for each power state. More...
 
void computeStats ()
 Record stats values like state residency by computing the time difference from previous update. More...
 
void pwrState (Enums::PwrState)
 
void regStats () override
 Register statistics for this object. More...
 
- Public Member Functions inherited from SimObject
const Paramsparams () const
 
 SimObject (const Params *_params)
 
virtual ~SimObject ()
 
virtual const std::string name () const
 
virtual void init ()
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
virtual void loadState (CheckpointIn &cp)
 loadState() is called on each SimObject when restoring from a checkpoint. More...
 
virtual void initState ()
 initState() is called on each SimObject when not restoring from a checkpoint. More...
 
virtual void regProbePoints ()
 Register probe points for this object. More...
 
virtual void regProbeListeners ()
 Register probe listeners for this object. More...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. More...
 
DrainState drain () override
 Provide a default implementation of the drain interface for objects that don't need draining. More...
 
virtual void memInvalidate ()
 Invalidate the contents of memory buffers. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from EventManager
 EventManager (EventManager &em)
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
EventQueueeventQueue () const
 
void schedule (Event &event, Tick when)
 
void deschedule (Event &event)
 
void reschedule (Event &event, Tick when, bool always=false)
 
void schedule (Event *event, Tick when)
 
void deschedule (Event *event)
 
void reschedule (Event *event, Tick when, bool always=false)
 
void wakeupEventQueue (Tick when=(Tick)-1)
 
void setCurTick (Tick newVal)
 
- 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 Member Functions inherited from Drainable
DrainState drainState () const
 Return the current drain state of an object. More...
 
virtual void notifyFork ()
 Notify a child process of a fork. More...
 
- Public Member Functions inherited from Clocked
void updateClockPeriod () const
 Update the tick to the current tick. More...
 
Tick clockEdge (Cycles cycles=Cycles(0)) const
 Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. More...
 
Cycles curCycle () const
 Determine the current cycle, corresponding to a tick aligned to a clock edge. More...
 
Tick nextCycle () const
 Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. More...
 
uint64_t frequency () const
 
Tick clockPeriod () const
 
double voltage () const
 
Cycles ticksToCycles (Tick t) const
 
Tick cyclesToTicks (Cycles c) const
 

Static Public Member Functions

static int getRandomization ()
 
static uint32_t getBlockSizeBytes ()
 
static uint32_t getBlockSizeBits ()
 
static uint32_t getMemorySizeBits ()
 
static bool getWarmupEnabled ()
 
static bool getCooldownEnabled ()
 
- Static Public Member Functions inherited from SimObject
static void serializeAll (CheckpointOut &cp)
 Serialize all SimObjects in the system. More...
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it. More...
 
- 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)
 

Public Attributes

Profilerm_profiler
 
CacheRecorderm_cache_recorder
 
std::vector< std::map
< uint32_t, AbstractController * > > 
m_abstract_controls
 

Private Member Functions

 RubySystem (const RubySystem &obj)
 
RubySystemoperator= (const RubySystem &obj)
 
void makeCacheRecorder (uint8_t *uncompressed_trace, uint64_t cache_trace_size, uint64_t block_size_bytes)
 

Static Private Member Functions

static void readCompressedTrace (std::string filename, uint8_t *&raw_data, uint64_t &uncompressed_trace_size)
 
static void writeCompressedTrace (uint8_t *raw_data, std::string file, uint64_t uncompressed_trace_size)
 

Private Attributes

SimpleMemorym_phys_mem
 
const bool m_access_backing_store
 
Networkm_network
 
std::vector< AbstractController * > m_abs_cntrl_vec
 
Cycles m_start_cycle
 

Static Private Attributes

static bool m_randomization
 
static uint32_t m_block_size_bytes
 
static uint32_t m_block_size_bits
 
static uint32_t m_memory_size_bits
 
static bool m_warmup_enabled = false
 
static unsigned m_systems_to_warmup = 0
 
static bool m_cooldown_enabled = false
 

Friends

class RubyEvent
 

Additional Inherited Members

- Static Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 
- Protected Member Functions inherited from Drainable
 Drainable ()
 
virtual ~Drainable ()
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- Protected Member Functions inherited from Clocked
 Clocked (ClockDomain &clk_domain)
 Create a clocked object and set the clock domain based on the parameters. More...
 
 Clocked (Clocked &)=delete
 
Clockedoperator= (Clocked &)=delete
 
virtual ~Clocked ()
 Virtual destructor due to inheritance. More...
 
void resetClock () const
 Reset the object's clock using the current global tick value. More...
 
- Protected Attributes inherited from ClockedObject
Enums::PwrState _currPwrState
 To keep track of the current power state. More...
 
Tick prvEvalTick
 
Stats::Scalar numPwrStateTransitions
 
Stats::Distribution pwrStateClkGateDist
 
Stats::Vector pwrStateResidencyTicks
 
- Protected Attributes inherited from SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

Definition at line 50 of file RubySystem.hh.

Member Typedef Documentation

typedef RubySystemParams RubySystem::Params

Definition at line 68 of file RubySystem.hh.

Constructor & Destructor Documentation

RubySystem::RubySystem ( const Params p)
RubySystem::~RubySystem ( )

Definition at line 95 of file RubySystem.cc.

References m_network, and m_profiler.

RubySystem::RubySystem ( const RubySystem obj)
private

Member Function Documentation

void RubySystem::collateStats ( )
inline

Definition at line 96 of file RubySystem.hh.

References Profiler::collateStats(), and m_profiler.

Referenced by RubyStatsCallback::process().

void RubySystem::drainResume ( )
overridevirtual

Resume execution after a successful drain.

Reimplemented from Drainable.

Definition at line 263 of file RubySystem.cc.

References m_cache_recorder.

void RubySystem::enqueueRubyEvent ( Tick  tick)
inline

Definition at line 112 of file RubySystem.hh.

References ArmISA::e, RubyEvent, and EventManager::schedule().

Referenced by memWriteback(), and startup().

bool RubySystem::eventQueueEmpty ( )
inline

Definition at line 111 of file RubySystem.hh.

References EventQueue::empty(), and EventManager::eventq.

bool RubySystem::functionalRead ( Packet ptr)
bool RubySystem::functionalWrite ( Packet ptr)
bool RubySystem::getAccessBackingStore ( )
inline

Definition at line 82 of file RubySystem.hh.

References m_access_backing_store.

static uint32_t RubySystem::getBlockSizeBits ( )
inlinestatic
static uint32_t RubySystem::getBlockSizeBytes ( )
inlinestatic
static bool RubySystem::getCooldownEnabled ( )
inlinestatic

Definition at line 78 of file RubySystem.hh.

References m_cooldown_enabled.

Referenced by Sequencer::hitCallback(), and RubySystem::RubyEvent::process().

static uint32_t RubySystem::getMemorySizeBits ( )
inlinestatic

Definition at line 76 of file RubySystem.hh.

References m_memory_size_bits.

Referenced by DirectoryMemory::init().

SimpleMemory* RubySystem::getPhysMem ( )
inline
Profiler* RubySystem::getProfiler ( )
inline

Definition at line 86 of file RubySystem.hh.

References m_profiler.

static int RubySystem::getRandomization ( )
inlinestatic

Definition at line 73 of file RubySystem.hh.

References m_randomization.

Referenced by MessageBuffer::enqueue().

Cycles RubySystem::getStartCycle ( )
inline

Definition at line 81 of file RubySystem.hh.

References m_start_cycle.

Referenced by Throttle::collateStats(), and GarnetNetwork::collateStats().

static bool RubySystem::getWarmupEnabled ( )
inlinestatic
void RubySystem::makeCacheRecorder ( uint8_t *  uncompressed_trace,
uint64_t  cache_trace_size,
uint64_t  block_size_bytes 
)
private

Definition at line 102 of file RubySystem.cc.

References m_abs_cntrl_vec, and m_cache_recorder.

Referenced by memWriteback(), and unserialize().

void RubySystem::memWriteback ( )
overridevirtual

Write back dirty buffers to memory using functional writes.

After returning, an object implementing this method should have written all its dirty data back to memory. This method is typically used to prepare a system with caches for checkpointing.

Reimplemented from SimObject.

Definition at line 135 of file RubySystem.cc.

References curTick(), EventQueue::deschedule(), DPRINTF, EventQueue::empty(), enqueueRubyEvent(), MipsISA::event, EventManager::eventq, getBlockSizeBytes(), EventQueue::getHead(), Event::isAutoDelete(), m_abs_cntrl_vec, m_cache_recorder, m_cooldown_enabled, makeCacheRecorder(), Event::name(), EventQueue::schedule(), EventManager::setCurTick(), simulate(), warn_once, and Event::when().

RubySystem& RubySystem::operator= ( const RubySystem obj)
private
void RubySystem::process ( )
void RubySystem::readCompressedTrace ( std::string  filename,
uint8_t *&  raw_data,
uint64_t &  uncompressed_trace_size 
)
staticprivate

Definition at line 274 of file RubySystem.cc.

References fatal, and ArmISA::fd.

Referenced by unserialize().

void RubySystem::registerAbstractController ( AbstractController cntrl)
void RubySystem::registerNetwork ( Network network_ptr)

Definition at line 81 of file RubySystem.cc.

References m_network.

void RubySystem::regStats ( )
inlineoverridevirtual

Register statistics for this object.

Reimplemented from SimObject.

Definition at line 92 of file RubySystem.hh.

References m_profiler, SimObject::name(), Profiler::regStats(), and ClockedObject::regStats().

void RubySystem::resetStats ( )
overridevirtual

Reset statistics associated with this object.

Reimplemented from SimObject.

Definition at line 393 of file RubySystem.cc.

References Clocked::curCycle(), and m_start_cycle.

Referenced by startup().

void RubySystem::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 236 of file RubySystem.cc.

References CacheRecorder::aggregateRecords(), fatal, getBlockSizeBytes(), m_cache_recorder, SimObject::name(), SERIALIZE_SCALAR, and writeCompressedTrace().

void RubySystem::startup ( )
overridevirtual

startup() is the final initialization call before simulation.

All state is initialized (including unserialized state, if any, such as the curTick() value), so this is the appropriate place to schedule initial event(s) for objects that need them.

Reimplemented from SimObject.

Definition at line 332 of file RubySystem.cc.

References curTick(), DPRINTF, enqueueRubyEvent(), EventManager::eventq, m_cache_recorder, m_systems_to_warmup, m_warmup_enabled, EventQueue::replaceHead(), Clocked::resetClock(), resetStats(), EventManager::setCurTick(), and simulate().

void RubySystem::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 305 of file RubySystem.cc.

References CheckpointIn::cptDir, getBlockSizeBytes(), m_systems_to_warmup, m_warmup_enabled, makeCacheRecorder(), readCompressedTrace(), UNSERIALIZE_OPT_SCALAR, and UNSERIALIZE_SCALAR.

void RubySystem::writeCompressedTrace ( uint8_t *  raw_data,
std::string  file,
uint64_t  uncompressed_trace_size 
)
staticprivate

Definition at line 207 of file RubySystem.cc.

References CheckpointIn::dir(), fatal, and ArmISA::fd.

Referenced by serialize().

Friends And Related Function Documentation

friend class RubyEvent
friend

Definition at line 66 of file RubySystem.hh.

Referenced by enqueueRubyEvent().

Member Data Documentation

std::vector<AbstractController *> RubySystem::m_abs_cntrl_vec
private
std::vector<std::map<uint32_t, AbstractController *> > RubySystem::m_abstract_controls

Definition at line 153 of file RubySystem.hh.

Referenced by Profiler::collateStats(), registerAbstractController(), and RubySystem().

const bool RubySystem::m_access_backing_store
private

Definition at line 144 of file RubySystem.hh.

Referenced by getAccessBackingStore().

uint32_t RubySystem::m_block_size_bits
staticprivate

Definition at line 137 of file RubySystem.hh.

Referenced by getBlockSizeBits(), and RubySystem().

uint32_t RubySystem::m_block_size_bytes
staticprivate

Definition at line 136 of file RubySystem.hh.

Referenced by getBlockSizeBytes(), and RubySystem().

CacheRecorder* RubySystem::m_cache_recorder
bool RubySystem::m_cooldown_enabled = false
staticprivate

Definition at line 142 of file RubySystem.hh.

Referenced by getCooldownEnabled(), and memWriteback().

uint32_t RubySystem::m_memory_size_bits
staticprivate

Definition at line 138 of file RubySystem.hh.

Referenced by getMemorySizeBits(), and RubySystem().

Network* RubySystem::m_network
private

Definition at line 146 of file RubySystem.hh.

Referenced by functionalWrite(), registerNetwork(), and ~RubySystem().

SimpleMemory* RubySystem::m_phys_mem
private

Definition at line 143 of file RubySystem.hh.

Referenced by getPhysMem(), and RubySystem().

Profiler* RubySystem::m_profiler

Definition at line 151 of file RubySystem.hh.

Referenced by collateStats(), getProfiler(), regStats(), RubySystem(), and ~RubySystem().

bool RubySystem::m_randomization
staticprivate

Definition at line 135 of file RubySystem.hh.

Referenced by getRandomization(), and RubySystem().

Cycles RubySystem::m_start_cycle
private

Definition at line 148 of file RubySystem.hh.

Referenced by getStartCycle(), and resetStats().

unsigned RubySystem::m_systems_to_warmup = 0
staticprivate

Definition at line 141 of file RubySystem.hh.

Referenced by startup(), and unserialize().

bool RubySystem::m_warmup_enabled = false
staticprivate

Definition at line 140 of file RubySystem.hh.

Referenced by getWarmupEnabled(), startup(), and unserialize().


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

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