|
gem5 [DEVELOP-FOR-25.0]
|
This class implements global sync operations among gem5 peer processes. More...
Public Member Functions | |
| void | init (Tick start, Tick repeat) |
| Initialize periodic sync params. | |
| virtual bool | run (bool same_tick)=0 |
| Core method to perform a full dist sync. | |
| virtual bool | progress (Tick send_tick, Tick next_repeat, ReqType do_ckpt, ReqType do_exit, ReqType do_stop_sync)=0 |
| Callback when the receiver thread gets a sync ack message. | |
| void | abort () |
| Abort processing an on-going sync event (in case of an error, e.g. | |
| virtual void | requestCkpt (ReqType req)=0 |
| virtual void | requestExit (ReqType req)=0 |
| virtual void | requestStopSync (ReqType req)=0 |
| void | drainComplete () |
| virtual void | serialize (CheckpointOut &cp) const override=0 |
| Serialize an object. | |
| virtual void | unserialize (CheckpointIn &cp) override=0 |
| Unserialize an object. | |
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) |
Protected Attributes | |
| 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. | |
Friends | |
| class | SyncEvent |
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. | |
This class implements global sync operations among gem5 peer processes.
Definition at line 119 of file dist_iface.hh.
| void gem5::DistIface::Sync::abort | ( | ) |
| void gem5::DistIface::Sync::drainComplete | ( | ) |
Definition at line 292 of file dist_iface.cc.
Initialize periodic sync params.
| start | Start tick for dist synchronisation |
| repeat | Frequency of dist synchronisation |
Definition at line 69 of file dist_iface.cc.
References inform, nextAt, nextRepeat, and panic.
|
pure virtual |
Callback when the receiver thread gets a sync ack message.
Implemented in gem5::DistIface::SyncNode, and gem5::DistIface::SyncSwitch.
|
pure virtual |
Implemented in gem5::DistIface::SyncNode, and gem5::DistIface::SyncSwitch.
|
pure virtual |
Implemented in gem5::DistIface::SyncNode, and gem5::DistIface::SyncSwitch.
|
pure virtual |
Implemented in gem5::DistIface::SyncNode, and gem5::DistIface::SyncSwitch.
|
pure virtual |
Core method to perform a full dist sync.
Implemented in gem5::DistIface::SyncNode, and gem5::DistIface::SyncSwitch.
Referenced by drainComplete().
|
overridepure virtual |
Serialize an object.
Output an object's state into the current checkpoint section.
| cp | Checkpoint state |
Implements gem5::Serializable.
Implemented in gem5::DistIface::SyncNode, and gem5::DistIface::SyncSwitch.
|
overridepure virtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
| cp | Checkpoint state |
Implements gem5::Serializable.
Implemented in gem5::DistIface::SyncNode, and gem5::DistIface::SyncSwitch.
|
friend |
|
protected |
Condition variable for the simulation thread to wait on until all receiver threads completes the current global synchronisation.
Definition at line 131 of file dist_iface.hh.
Referenced by abort(), gem5::DistIface::SyncNode::progress(), gem5::DistIface::SyncSwitch::progress(), gem5::DistIface::SyncNode::run(), and gem5::DistIface::SyncSwitch::run().
|
protected |
Flag is set if taking a ckpt is permitted upon sync completion.
Definition at line 144 of file dist_iface.hh.
Referenced by drainComplete(), gem5::DistIface::SyncNode::progress(), gem5::DistIface::SyncSwitch::progress(), gem5::DistIface::SyncSwitch::run(), gem5::DistIface::SyncNode::SyncNode(), and gem5::DistIface::SyncSwitch::SyncSwitch().
|
protected |
Flag is set if exit is permitted upon sync completion.
Definition at line 140 of file dist_iface.hh.
Referenced by gem5::DistIface::SyncNode::progress(), gem5::DistIface::SyncSwitch::progress(), gem5::DistIface::SyncSwitch::run(), gem5::DistIface::SyncNode::SyncNode(), and gem5::DistIface::SyncSwitch::SyncSwitch().
|
protected |
Flag is set if sync is to stop upon sync completion.
Definition at line 148 of file dist_iface.hh.
Referenced by gem5::DistIface::SyncNode::progress(), gem5::DistIface::SyncSwitch::progress(), gem5::DistIface::SyncSwitch::run(), gem5::DistIface::SyncNode::SyncNode(), and gem5::DistIface::SyncSwitch::SyncSwitch().
|
protected |
Flag is set if the sync is aborted (e.g.
due to connection lost)
Definition at line 160 of file dist_iface.hh.
Referenced by abort(), gem5::DistIface::SyncNode::progress(), gem5::DistIface::SyncSwitch::progress(), gem5::DistIface::SyncNode::run(), gem5::DistIface::SyncSwitch::run(), gem5::DistIface::SyncNode::SyncNode(), and gem5::DistIface::SyncSwitch::SyncSwitch().
|
protected |
The lock to protect access to the Sync object.
Definition at line 125 of file dist_iface.hh.
Referenced by abort(), gem5::DistIface::SyncNode::progress(), gem5::DistIface::SyncSwitch::progress(), gem5::DistIface::SyncNode::requestCkpt(), gem5::DistIface::SyncNode::requestExit(), gem5::DistIface::SyncNode::requestStopSync(), gem5::DistIface::SyncNode::run(), and gem5::DistIface::SyncSwitch::run().
|
protected |
Tick for the next periodic sync (if the event is not scheduled yet)
Definition at line 156 of file dist_iface.hh.
Referenced by init(), gem5::DistIface::SyncNode::progress(), gem5::DistIface::SyncSwitch::progress(), gem5::DistIface::SyncNode::run(), gem5::DistIface::SyncSwitch::run(), gem5::DistIface::SyncNode::SyncNode(), and gem5::DistIface::SyncSwitch::SyncSwitch().
|
protected |
The repeat value for the next periodic sync.
Definition at line 152 of file dist_iface.hh.
Referenced by init(), gem5::DistIface::SyncNode::progress(), gem5::DistIface::SyncSwitch::progress(), gem5::DistIface::SyncNode::run(), gem5::DistIface::SyncSwitch::run(), gem5::DistIface::SyncNode::SyncNode(), and gem5::DistIface::SyncSwitch::SyncSwitch().
|
protected |
Number of receiver threads that not yet completed the current global synchronisation.
Definition at line 136 of file dist_iface.hh.
Referenced by abort(), gem5::DistIface::SyncNode::progress(), gem5::DistIface::SyncSwitch::progress(), gem5::DistIface::SyncNode::run(), gem5::DistIface::SyncSwitch::run(), gem5::DistIface::SyncNode::SyncNode(), and gem5::DistIface::SyncSwitch::SyncSwitch().