The Sparta Modeling Framework
|
A type of "global" reusable event. More...
#include <GlobalEvent.hpp>
Public Member Functions | |
GlobalEvent (const Clock *clk, const SpartaHandler &event_handler) | |
Create a GlobalEvent. | |
GlobalEvent (const GlobalEvent &rhs) | |
GlobalEvent (GlobalEvent &&rhs) | |
GlobalEvent & | operator= (const GlobalEvent &rhs) |
GlobalEvent & | operator= (GlobalEvent &&rhs) |
void | schedule (const Clock::Cycle &delay, const Clock *clk) |
void | schedule (const Clock::Cycle &delay) |
void | resetHandler (const SpartaHandler &event_handler) |
Friends | |
class | GlobalEventProxy |
A type of "global" reusable event.
This is to support dynamically created objects that require event semantics, but cannot create events. The original requirement comes from sparta::CoreExample: On the one hand, each dummy instruction contains a sparta::SharedData instance to represent and update its status. sparta::SharedData contains event handler to support "delayed update (from present-state to next-state)" semantics. On the other hand, the sparta::SharedData instance is required to be "copyable", since dummy instructions are created dynamically in the fetch unit. However, the original implementation of sparta::SharedData uses sparta::UniqueEvent, which is not copyable at run time.
To support this, the concept of "global" reusable events can be created, but with certain cautions in place: #. The Scheduleable being scheduled will be unique to a specific object requiring a timed call. #. The Scheduleable being scheduled might point to a dead callback (the originator of the event might be deallocated). #. The Scheduleable can be scheduled immediately, in the immediate future, or far into the future.
Definition at line 93 of file GlobalEvent.hpp.
|
inline |
Create a GlobalEvent.
clk | The clock to which synchronized by this global event |
event_handler | The event handler of this global event |
Definition at line 102 of file GlobalEvent.hpp.
|
inline |
Definition at line 109 of file GlobalEvent.hpp.
|
inline |
Definition at line 117 of file GlobalEvent.hpp.
|
inline |
Definition at line 164 of file GlobalEvent.hpp.
|
inline |
Definition at line 126 of file GlobalEvent.hpp.
|
inline |
Definition at line 135 of file GlobalEvent.hpp.
|
inline |
Definition at line 160 of file GlobalEvent.hpp.
|
inline |
Definition at line 153 of file GlobalEvent.hpp.
|
inline |
Definition at line 146 of file GlobalEvent.hpp.
|
friend |
Definition at line 168 of file GlobalEvent.hpp.