gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::DistIface::SyncNode Class Reference
Inheritance diagram for gem5::DistIface::SyncNode:
gem5::DistIface::Sync gem5::Serializable

Public Member Functions

 SyncNode ()
 
 ~SyncNode ()
 
bool run (bool same_tick) override
 Core method to perform a full dist sync.
 
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.
 
void requestCkpt (ReqType req) override
 
void requestExit (ReqType req) override
 
void requestStopSync (ReqType req) override
 
void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
- Public Member Functions inherited from gem5::DistIface::Sync
void init (Tick start, Tick repeat)
 Initialize periodic sync params.
 
void abort ()
 Abort processing an on-going sync event (in case of an error, e.g.
 
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.
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object.
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 

Private Attributes

ReqType needExit
 Exit requested.
 
ReqType needCkpt
 Ckpt requested.
 
ReqType needStopSync
 Sync stop requested.
 

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

Detailed Description

Definition at line 205 of file dist_iface.hh.

Constructor & Destructor Documentation

◆ SyncNode()

gem5::DistIface::SyncNode::SyncNode ( )

Definition at line 112 of file dist_iface.cc.

◆ ~SyncNode()

gem5::DistIface::SyncNode::~SyncNode ( )
inline

Definition at line 224 of file dist_iface.hh.

Member Function Documentation

◆ progress()

bool gem5::DistIface::SyncNode::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 243 of file dist_iface.cc.

References gem5::X86ISA::lock.

◆ requestCkpt()

void gem5::DistIface::SyncNode::requestCkpt ( ReqType req)
overridevirtual

Implements gem5::DistIface::Sync.

Definition at line 271 of file dist_iface.cc.

References gem5::X86ISA::lock, and warn.

◆ requestExit()

void gem5::DistIface::SyncNode::requestExit ( ReqType req)
overridevirtual

Implements gem5::DistIface::Sync.

Definition at line 282 of file dist_iface.cc.

References gem5::X86ISA::lock, and warn.

◆ requestStopSync()

void gem5::DistIface::SyncNode::requestStopSync ( ReqType req)
overridevirtual

Implements gem5::DistIface::Sync.

Definition at line 847 of file dist_iface.cc.

References gem5::DistIface::Sync::lock, and needStopSync.

◆ run()

bool gem5::DistIface::SyncNode::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 127 of file dist_iface.cc.

References gem5::curTick(), header, gem5::X86ISA::lock, gem5::DistIface::primary, gem5::DistIface::recvThreadsNum, and gem5::DistIface::sendCmd().

◆ serialize()

void gem5::DistIface::SyncNode::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 307 of file dist_iface.cc.

References SERIALIZE_SCALAR.

◆ unserialize()

void gem5::DistIface::SyncNode::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 314 of file dist_iface.cc.

References UNSERIALIZE_SCALAR.

Member Data Documentation

◆ needCkpt

ReqType gem5::DistIface::SyncNode::needCkpt
private

Ckpt requested.

Definition at line 215 of file dist_iface.hh.

◆ needExit

ReqType gem5::DistIface::SyncNode::needExit
private

Exit requested.

Definition at line 211 of file dist_iface.hh.

◆ needStopSync

ReqType gem5::DistIface::SyncNode::needStopSync
private

Sync stop requested.

Definition at line 219 of file dist_iface.hh.

Referenced by requestStopSync().


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

Generated on Tue Jun 18 2024 16:24:10 for gem5 by doxygen 1.11.0