gem5  v22.1.0.0
Public Member Functions | Private Attributes | List of all members
gem5::DistIface::SyncSwitch Class Reference
Inheritance diagram for gem5::DistIface::SyncSwitch:
gem5::DistIface::Sync gem5::Serializable

Public Member Functions

 SyncSwitch (int num_nodes)
 
 ~SyncSwitch ()
 
bool run (bool same_tick) override
 Core method to perform a full dist sync. More...
 
bool progress (Tick max_req_tick, Tick next_repeat, ReqType do_ckpt, ReqType do_exit, ReqType do_stop_sync) override
 Callback when the receiver thread gets a sync ack message. More...
 
void requestCkpt (ReqType) override
 
void requestExit (ReqType) override
 
void requestStopSync (ReqType) override
 
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::DistIface::Sync
void init (Tick start, Tick repeat)
 Initialize periodic sync params. More...
 
void abort ()
 Abort processing an on-going sync event (in case of an error, e.g. More...
 
void drainComplete ()
 
- 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)
 

Private Attributes

unsigned numExitReq
 Counter for recording exit requests. More...
 
unsigned numCkptReq
 Counter for recording ckpt requests. More...
 
unsigned numStopSyncReq
 Counter for recording stop sync requests. More...
 
unsigned numNodes
 Number of connected simulated nodes. More...
 

Additional Inherited Members

- 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...
 
- Protected Attributes inherited from gem5::DistIface::Sync
std::mutex lock
 The lock to protect access to the Sync object. More...
 
std::condition_variable cv
 Condition variable for the simulation thread to wait on until all receiver threads completes the current global synchronisation. More...
 
unsigned waitNum
 Number of receiver threads that not yet completed the current global synchronisation. More...
 
bool doExit
 Flag is set if exit is permitted upon sync completion. More...
 
bool doCkpt
 Flag is set if taking a ckpt is permitted upon sync completion. More...
 
bool doStopSync
 Flag is set if sync is to stop upon sync completion. More...
 
Tick nextRepeat
 The repeat value for the next periodic sync. More...
 
Tick nextAt
 Tick for the next periodic sync (if the event is not scheduled yet) More...
 
bool isAbort
 Flag is set if the sync is aborted (e.g. More...
 

Detailed Description

Definition at line 240 of file dist_iface.hh.

Constructor & Destructor Documentation

◆ SyncSwitch()

gem5::DistIface::SyncSwitch::SyncSwitch ( int  num_nodes)

Definition at line 97 of file dist_iface.cc.

◆ ~SyncSwitch()

gem5::DistIface::SyncSwitch::~SyncSwitch ( )
inline

Definition at line 262 of file dist_iface.hh.

Member Function Documentation

◆ progress()

bool gem5::DistIface::SyncSwitch::progress ( Tick  send_tick,
Tick  next_repeat,
ReqType  do_ckpt,
ReqType  do_exit,
ReqType  do_stop_sync 
)
overridevirtual

Callback when the receiver thread gets a sync ack message.

Returns
false if the receiver thread needs to stop (e.g. simulation is to exit)

Implements gem5::DistIface::Sync.

Definition at line 202 of file dist_iface.cc.

References gem5::DistHeaderPkt::collective, gem5::DistHeaderPkt::immediate, and gem5::X86ISA::lock.

◆ requestCkpt()

void gem5::DistIface::SyncSwitch::requestCkpt ( ReqType  )
inlineoverridevirtual

Implements gem5::DistIface::Sync.

Definition at line 271 of file dist_iface.hh.

References panic.

◆ requestExit()

void gem5::DistIface::SyncSwitch::requestExit ( ReqType  )
inlineoverridevirtual

Implements gem5::DistIface::Sync.

Definition at line 274 of file dist_iface.hh.

References panic.

◆ requestStopSync()

void gem5::DistIface::SyncSwitch::requestStopSync ( ReqType  )
inlineoverridevirtual

Implements gem5::DistIface::Sync.

Definition at line 277 of file dist_iface.hh.

References panic.

◆ run()

bool gem5::DistIface::SyncSwitch::run ( bool  same_tick)
overridevirtual

Core method to perform a full dist sync.

Returns
true if the sync completes, false if it gets aborted

Implements gem5::DistIface::Sync.

Definition at line 159 of file dist_iface.cc.

References gem5::DistHeaderPkt::cmdSyncAck, gem5::curTick(), header, gem5::DistHeaderPkt::immediate, gem5::X86ISA::lock, gem5::DistHeaderPkt::none, gem5::DistIface::primary, and gem5::DistIface::sendCmd().

◆ serialize()

void gem5::DistIface::SyncSwitch::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::DistIface::Sync.

Definition at line 322 of file dist_iface.cc.

References SERIALIZE_SCALAR.

◆ unserialize()

void gem5::DistIface::SyncSwitch::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::DistIface::Sync.

Definition at line 328 of file dist_iface.cc.

References UNSERIALIZE_SCALAR.

Member Data Documentation

◆ numCkptReq

unsigned gem5::DistIface::SyncSwitch::numCkptReq
private

Counter for recording ckpt requests.

Definition at line 250 of file dist_iface.hh.

◆ numExitReq

unsigned gem5::DistIface::SyncSwitch::numExitReq
private

Counter for recording exit requests.

Definition at line 246 of file dist_iface.hh.

◆ numNodes

unsigned gem5::DistIface::SyncSwitch::numNodes
private

Number of connected simulated nodes.

Definition at line 258 of file dist_iface.hh.

◆ numStopSyncReq

unsigned gem5::DistIface::SyncSwitch::numStopSyncReq
private

Counter for recording stop sync requests.

Definition at line 254 of file dist_iface.hh.


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

Generated on Wed Dec 21 2022 10:23:20 for gem5 by doxygen 1.9.1