gem5  v21.1.0.2
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
gem5::ruby::RubySystem Class Reference

#include <RubySystem.hh>

Inheritance diagram for gem5::ruby::RubySystem:
gem5::ClockedObject gem5::SimObject gem5::Clocked gem5::EventManager gem5::Serializable gem5::Drainable gem5::statistics::Group gem5::Named

Public Member Functions

 PARAMS (RubySystem)
 
 RubySystem (const Params &p)
 
 ~RubySystem ()
 
memory::SimpleMemorygetPhysMem ()
 
Cycles getStartCycle ()
 
bool getAccessBackingStore ()
 
ProfilergetProfiler ()
 
void regStats () override
 Callback to set stat parameters. More...
 
void collateStats ()
 
void resetStats () override
 Callback to reset stats. 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 init () override
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
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 *)
 
void registerMachineID (const MachineID &mach_id, Network *network)
 
void registerRequestorIDs ()
 
bool eventQueueEmpty ()
 
void enqueueRubyEvent (Tick tick)
 
- Public Member Functions inherited from gem5::ClockedObject
 ClockedObject (const ClockedObjectParams &p)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from gem5::SimObject
const Paramsparams () const
 
 SimObject (const Params &p)
 
virtual ~SimObject ()
 
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...
 
virtual PortgetPort (const std::string &if_name, PortID idx=InvalidPortID)
 Get a port with a given name and index. 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 gem5::EventManager
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)
 This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. More...
 
void setCurTick (Tick newVal)
 
 EventManager (EventManager &em)
 Event manger manages events in the event queue. More...
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
- Public Member Functions inherited from gem5::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 gem5::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 gem5::statistics::Group
 Group (Group *parent, const char *name=nullptr)
 Construct a new statistics group. More...
 
virtual ~Group ()
 
virtual void preDumpStats ()
 Callback before stats are dumped. More...
 
void addStat (statistics::Info *info)
 Register a stat with this group. More...
 
const std::map< std::string, Group * > & getStatGroups () const
 Get all child groups associated with this object. More...
 
const std::vector< Info * > & getStats () const
 Get all stats associated with this object. More...
 
void addStatGroup (const char *name, Group *block)
 Add a stat block as a child of this block. More...
 
const InforesolveStat (std::string name) const
 Resolve a stat by its name within this group. More...
 
void mergeStatGroup (Group *block)
 Merge the contents (stats & children) of a block to this block. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 
- Public Member Functions inherited from gem5::Named
 Named (const std::string &name_)
 
virtual ~Named ()=default
 
virtual std::string name () const
 
- Public Member Functions inherited from gem5::Clocked
void updateClockPeriod ()
 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 gem5::SimObject
static void serializeAll (const std::string &cpt_dir)
 Create a checkpoint by serializing 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 void setSimObjectResolver (SimObjectResolver *resolver)
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More...
 
static SimObjectResolvergetSimObjectResolver ()
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More...
 
- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it. More...
 

Public Attributes

Profilerm_profiler
 
CacheRecorderm_cache_recorder
 
std::vector< std::map< uint32_t, AbstractController * > > m_abstract_controls
 
- Public Attributes inherited from gem5::ClockedObject
PowerStatepowerState
 

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)
 
void processRubyEvent ()
 

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

memory::SimpleMemorym_phys_mem
 
const bool m_access_backing_store
 
std::vector< std::unique_ptr< Network > > m_networks
 
std::vector< AbstractController * > m_abs_cntrl_vec
 
Cycles m_start_cycle
 
std::unordered_map< MachineID, unsigned > machineToNetwork
 
std::unordered_map< RequestorID, unsigned > requestorToNetwork
 
std::unordered_map< unsigned, std::vector< AbstractController * > > netCntrls
 

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
 

Additional Inherited Members

- Public Types inherited from gem5::ClockedObject
using Params = ClockedObjectParams
 Parameters of ClockedObject. More...
 
- Public Types inherited from gem5::SimObject
typedef SimObjectParams Params
 
- Protected Member Functions inherited from gem5::Drainable
 Drainable ()
 
virtual ~Drainable ()
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- Protected Member Functions inherited from gem5::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...
 
virtual void clockPeriodUpdated ()
 A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. More...
 
- Protected Attributes inherited from gem5::SimObject
const SimObjectParams & _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from gem5::EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

Definition at line 63 of file RubySystem.hh.

Constructor & Destructor Documentation

◆ RubySystem() [1/2]

gem5::ruby::RubySystem::RubySystem ( const Params p)

◆ ~RubySystem()

gem5::ruby::RubySystem::~RubySystem ( )

Definition at line 170 of file RubySystem.cc.

References m_profiler.

◆ RubySystem() [2/2]

gem5::ruby::RubySystem::RubySystem ( const RubySystem obj)
private

Member Function Documentation

◆ collateStats()

void gem5::ruby::RubySystem::collateStats ( )
inline

Definition at line 93 of file RubySystem.hh.

References gem5::ruby::Profiler::collateStats(), and m_profiler.

Referenced by RubySystem().

◆ drainResume()

void gem5::ruby::RubySystem::drainResume ( )
overridevirtual

Resume execution after a successful drain.

Reimplemented from gem5::Drainable.

Definition at line 338 of file RubySystem.cc.

References m_cache_recorder.

◆ enqueueRubyEvent()

void gem5::ruby::RubySystem::enqueueRubyEvent ( Tick  tick)
inline

◆ eventQueueEmpty()

bool gem5::ruby::RubySystem::eventQueueEmpty ( )
inline

Definition at line 111 of file RubySystem.hh.

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

◆ functionalRead()

bool gem5::ruby::RubySystem::functionalRead ( Packet ptr)

◆ functionalWrite()

bool gem5::ruby::RubySystem::functionalWrite ( Packet ptr)

◆ getAccessBackingStore()

bool gem5::ruby::RubySystem::getAccessBackingStore ( )
inline

Definition at line 80 of file RubySystem.hh.

References m_access_backing_store.

◆ getBlockSizeBits()

static uint32_t gem5::ruby::RubySystem::getBlockSizeBits ( )
inlinestatic

◆ getBlockSizeBytes()

static uint32_t gem5::ruby::RubySystem::getBlockSizeBytes ( )
inlinestatic

◆ getCooldownEnabled()

static bool gem5::ruby::RubySystem::getCooldownEnabled ( )
inlinestatic

Definition at line 76 of file RubySystem.hh.

References m_cooldown_enabled.

Referenced by gem5::ruby::Sequencer::hitCallback(), and processRubyEvent().

◆ getMemorySizeBits()

static uint32_t gem5::ruby::RubySystem::getMemorySizeBits ( )
inlinestatic

Definition at line 74 of file RubySystem.hh.

References m_memory_size_bits.

◆ getPhysMem()

memory::SimpleMemory* gem5::ruby::RubySystem::getPhysMem ( )
inline

Definition at line 78 of file RubySystem.hh.

References m_phys_mem.

◆ getProfiler()

Profiler* gem5::ruby::RubySystem::getProfiler ( )
inline

Definition at line 84 of file RubySystem.hh.

References m_profiler.

◆ getRandomization()

static int gem5::ruby::RubySystem::getRandomization ( )
inlinestatic

Definition at line 71 of file RubySystem.hh.

References m_randomization.

Referenced by gem5::ruby::MessageBuffer::enqueue().

◆ getStartCycle()

Cycles gem5::ruby::RubySystem::getStartCycle ( )
inline

Definition at line 79 of file RubySystem.hh.

References m_start_cycle.

Referenced by gem5::ruby::Throttle::collateStats().

◆ getWarmupEnabled()

static bool gem5::ruby::RubySystem::getWarmupEnabled ( )
inlinestatic

◆ init()

void gem5::ruby::RubySystem::init ( )
overridevirtual

init() is called after all C++ SimObjects have been created and all ports are connected.

Initializations that are independent of unserialization but rely on a fully instantiated and connected SimObject graph should be done here.

Reimplemented from gem5::SimObject.

Definition at line 407 of file RubySystem.cc.

References registerRequestorIDs().

◆ makeCacheRecorder()

void gem5::ruby::RubySystem::makeCacheRecorder ( uint8_t *  uncompressed_trace,
uint64_t  cache_trace_size,
uint64_t  block_size_bytes 
)
private

Definition at line 176 of file RubySystem.cc.

References m_abs_cntrl_vec, and m_cache_recorder.

Referenced by memWriteback(), and unserialize().

◆ memWriteback()

void gem5::ruby::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 gem5::SimObject.

Definition at line 209 of file RubySystem.cc.

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

◆ operator=()

RubySystem& gem5::ruby::RubySystem::operator= ( const RubySystem obj)
private

◆ PARAMS()

gem5::ruby::RubySystem::PARAMS ( RubySystem  )

◆ process()

void gem5::ruby::RubySystem::process ( )

◆ processRubyEvent()

void gem5::ruby::RubySystem::processRubyEvent ( )
private

◆ readCompressedTrace()

void gem5::ruby::RubySystem::readCompressedTrace ( std::string  filename,
uint8_t *&  raw_data,
uint64_t &  uncompressed_trace_size 
)
staticprivate

Definition at line 349 of file RubySystem.cc.

References fatal, and gem5::ArmISA::fd.

Referenced by unserialize().

◆ registerAbstractController()

void gem5::ruby::RubySystem::registerAbstractController ( AbstractController cntrl)

◆ registerMachineID()

void gem5::ruby::RubySystem::registerMachineID ( const MachineID mach_id,
Network network 
)

Definition at line 116 of file RubySystem.cc.

References fatal_if, m_networks, gem5::ruby::MachineIDToString(), and machineToNetwork.

◆ registerNetwork()

void gem5::ruby::RubySystem::registerNetwork ( Network network_ptr)

Definition at line 101 of file RubySystem.cc.

References m_networks.

◆ registerRequestorIDs()

void gem5::ruby::RubySystem::registerRequestorIDs ( )

◆ regStats()

void gem5::ruby::RubySystem::regStats ( )
inlineoverridevirtual

Callback to set stat parameters.

This callback is typically used for complex stats (e.g., distributions) that need parameters in addition to a name and a description. Stat names and descriptions should typically be set from the constructor usingo from the constructor using the ADD_STAT macro.

Reimplemented from gem5::statistics::Group.

Definition at line 90 of file RubySystem.hh.

References gem5::statistics::Group::regStats().

◆ resetStats()

void gem5::ruby::RubySystem::resetStats ( )
overridevirtual

Callback to reset stats.

Reimplemented from gem5::statistics::Group.

Definition at line 474 of file RubySystem.cc.

References gem5::Clocked::curCycle(), m_networks, and m_start_cycle.

Referenced by startup().

◆ serialize()

void gem5::ruby::RubySystem::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 311 of file RubySystem.cc.

References gem5::ruby::CacheRecorder::aggregateRecords(), fatal, getBlockSizeBytes(), m_cache_recorder, gem5::Named::name(), SERIALIZE_SCALAR, and writeCompressedTrace().

◆ startup()

void gem5::ruby::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 gem5::SimObject.

Definition at line 413 of file RubySystem.cc.

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

◆ unserialize()

void gem5::ruby::RubySystem::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 380 of file RubySystem.cc.

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

◆ writeCompressedTrace()

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

Definition at line 282 of file RubySystem.cc.

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

Referenced by serialize().

Member Data Documentation

◆ m_abs_cntrl_vec

std::vector<AbstractController *> gem5::ruby::RubySystem::m_abs_cntrl_vec
private

◆ m_abstract_controls

std::vector<std::map<uint32_t, AbstractController *> > gem5::ruby::RubySystem::m_abstract_controls

◆ m_access_backing_store

const bool gem5::ruby::RubySystem::m_access_backing_store
private

Definition at line 146 of file RubySystem.hh.

Referenced by getAccessBackingStore().

◆ m_block_size_bits

uint32_t gem5::ruby::RubySystem::m_block_size_bits
staticprivate

Definition at line 139 of file RubySystem.hh.

Referenced by getBlockSizeBits(), and RubySystem().

◆ m_block_size_bytes

uint32_t gem5::ruby::RubySystem::m_block_size_bytes
staticprivate

Definition at line 138 of file RubySystem.hh.

Referenced by getBlockSizeBytes(), and RubySystem().

◆ m_cache_recorder

CacheRecorder* gem5::ruby::RubySystem::m_cache_recorder

◆ m_cooldown_enabled

bool gem5::ruby::RubySystem::m_cooldown_enabled = false
staticprivate

Definition at line 144 of file RubySystem.hh.

Referenced by getCooldownEnabled(), and memWriteback().

◆ m_memory_size_bits

uint32_t gem5::ruby::RubySystem::m_memory_size_bits
staticprivate

Definition at line 140 of file RubySystem.hh.

Referenced by getMemorySizeBits(), and RubySystem().

◆ m_networks

std::vector<std::unique_ptr<Network> > gem5::ruby::RubySystem::m_networks
private

◆ m_phys_mem

memory::SimpleMemory* gem5::ruby::RubySystem::m_phys_mem
private

Definition at line 145 of file RubySystem.hh.

Referenced by getPhysMem(), and RubySystem().

◆ m_profiler

Profiler* gem5::ruby::RubySystem::m_profiler

Definition at line 158 of file RubySystem.hh.

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

◆ m_randomization

bool gem5::ruby::RubySystem::m_randomization
staticprivate

Definition at line 137 of file RubySystem.hh.

Referenced by getRandomization(), and RubySystem().

◆ m_start_cycle

Cycles gem5::ruby::RubySystem::m_start_cycle
private

Definition at line 151 of file RubySystem.hh.

Referenced by getStartCycle(), and resetStats().

◆ m_systems_to_warmup

unsigned gem5::ruby::RubySystem::m_systems_to_warmup = 0
staticprivate

Definition at line 143 of file RubySystem.hh.

Referenced by startup(), and unserialize().

◆ m_warmup_enabled

bool gem5::ruby::RubySystem::m_warmup_enabled = false
staticprivate

Definition at line 142 of file RubySystem.hh.

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

◆ machineToNetwork

std::unordered_map<MachineID, unsigned> gem5::ruby::RubySystem::machineToNetwork
private

Definition at line 153 of file RubySystem.hh.

Referenced by registerMachineID(), and registerRequestorIDs().

◆ netCntrls

std::unordered_map<unsigned, std::vector<AbstractController*> > gem5::ruby::RubySystem::netCntrls
private

Definition at line 155 of file RubySystem.hh.

Referenced by functionalRead(), functionalWrite(), and registerRequestorIDs().

◆ requestorToNetwork

std::unordered_map<RequestorID, unsigned> gem5::ruby::RubySystem::requestorToNetwork
private

Definition at line 154 of file RubySystem.hh.

Referenced by functionalRead(), functionalWrite(), and registerRequestorIDs().


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

Generated on Tue Sep 21 2021 12:32:09 for gem5 by doxygen 1.8.17