47 const std::string & name,
49 const SpartaHandler & consumer_event_handler,
50 Clock::Cycle delay = 0) :
53 pue_consumer_event_handler_(consumer_event_handler),
54 fancy_name_(name +
"[" + consumer_event_handler.
getName() +
"]")
94 sparta_assert(last_tick_called_ != (scheduler->getCurrentTick() + rel_tick),
95 "PhasedUniqueEvent (UniqueEvent) '" <<
getName()
96 <<
"' was already scheduled and fired this cycle."
97 "\t\nAre you missing a precedence rule?");
102#ifndef DO_NOT_DOCUMENT
115 void deliverEvent_() {
122 pue_consumer_event_handler_();
126 void createResource_()
override {
132 SpartaHandler pue_consumer_event_handler_;
138 std::string fancy_name_;
File that defines the EventNode class.
File that defines the Scheduleable class.
#define sparta_assert(...)
Simple variadic assertion that will throw a sparta_exception if the condition fails.
#define SPARTA_EXPECT_TRUE(x)
A macro for hinting to the compiler a particular condition should be considered most likely true.
#define CREATE_SPARTA_HANDLER(clname, meth)
Scheduler * getScheduler() const
EventNode is the base class for all event types in SPARTA. Not to be used by the modeler....
sparta::SchedulingPhase getSchedulingPhase() const
Get the scheduling phase of this event node.
virtual Scheduleable & getScheduleable()=0
Get the scheduleable associated with this event node.
static Scheduler * determineScheduler(const Clock *clk)
Center point of Scheduler location.
A type of Event that uniquely schedules itself on the schedule within a single time quantum....
PhasedUniqueEvent & operator=(const PhasedUniqueEvent &)=delete
Disallow the assignment of the PhasedUniqueEvent.
PhasedUniqueEvent(const PhasedUniqueEvent &)=delete
Disallow the copying of the PhasedUniqueEvent.
Scheduler * getScheduler(const bool must_exist=true)
Get the scheduler this Scheduleable is assigned to.
void scheduleRelativeTick(sparta::Scheduler::Tick rel_tick, sparta::Scheduler *scheduler) override final
Schedule at time rel_tick.
virtual ~PhasedUniqueEvent()
Uniquely destroy.
PhasedUniqueEvent(TreeNode *event_set, const std::string &name, SchedulingPhase sched_phase, const SpartaHandler &consumer_event_handler, Clock::Cycle delay=0)
Create a PhasedUniqueEvent. The recommendation is to use the EventSet::createEvent method to create o...
const Scheduler * getScheduler(const bool must_exist=true) const
Get the scheduler this Scheduleable is assigned to.
A class that defines the basic scheduling interface to the Scheduler. Not intended to be used by mode...
virtual void scheduleRelativeTick(const Scheduler::Tick rel_tick, Scheduler *const scheduler)
Schedule this event on a relative scheduler tick.
void schedule()
Schedule this event with its pre-set delay using the pre-set Clock.
Scheduler * getScheduler(const bool must_exist=true)
Get the scheduler this Scheduleable is assigned to.
void setLabel(const char *label)
Set a new label for this Scheduleable – used in debugging.
PrecedenceSetup scheduler_
Cache a pointer to the scheduler used.
const Clock * local_clk_
A local clock for speed.
A class that lets you schedule events now and in the future.
Tick getCurrentTick() const noexcept
The current tick the Scheduler is working on or just finished.
uint64_t Tick
Typedef for our unit of time.
Node in a composite tree representing a sparta Tree item.
const Clock * getClock() override
Walks up parents (starting with self) until a parent with an associated local clock is found,...
const std::string & getName() const override
Gets the name of this node.
Macros for handling exponential backoff.
SchedulingPhase
The SchedulingPhases used for events (Tick, Update, PortUpdate, etc)