#include <Task.h>
Inheritance diagram for DREAM::Timer:
Public Member Functions | |
Timer (const std::string &id, DREAM::Thread *thread_ptr, uint period) | |
Constructor. | |
Timer (const std::string &id, DREAM::Thread *thread_ptr, uint period, uint bcperiod) | |
Constructor. | |
Timer (const DREAM::Timer &timer) | |
Copy constructor for Channels. | |
virtual | ~Timer () |
Destructor. | |
virtual uint | bcet () const |
Returns the best case period. | |
virtual void | branching_point () |
Sets the new execution time if branching points were found. | |
virtual DREAM::Context | context () const |
Returns whether the Timer uses the best case or worst case period for the simulation. | |
virtual void | context (DREAM::Context context) |
Sets the Timer to use the specified context (e.g. | |
virtual void | clock_exec_reset () |
Reset execution clock value - clock_exec_. | |
virtual void | clock_step (double clock_step) |
Models the passing of time - increments local clock clock_exec_. | |
virtual double | next_event () |
Tells when the Timer will generate the next event. | |
virtual void | next_et (double next_et) |
Sets the next execution time when the context is branchingpoint. | |
virtual uint | priority () const |
Returns the priority of the Timer. | |
virtual void | publish () |
Publishes an event to dependent tasks. | |
virtual void | take_transitions () |
Takes state transitions. | |
virtual void | visitor_if (DREAM::NODE_MAP *task_map, DREAM::NODE_MAP *channel_map, DREAM::NODE_MAP *timer_map, std::ofstream &f_stream) |
This function is part of the IF system description generator. | |
virtual void | visitor_map (DREAM::NODE_MAP *task_map, DREAM::NODE_MAP *channel_map, DREAM::NODE_MAP *timer_map) |
This function fills the IDs (names) of tasks, channels and timers to the parameter lists. | |
virtual void | visitor_uppaal (DREAM::NODE_MAP *task_map, DREAM::NODE_MAP *channel_map, DREAM::NODE_MAP *timer_map, std::ofstream &f_stream) |
This function is part of the Uppaal system description generator. | |
virtual uint | wcet () const |
Returns the period of the Timer. | |
Private Attributes | |
uint | bcperiod_ |
Best case period. | |
DREAM::Context | context_ |
Specifies whether best case, worst case, or a random value is used for the execution time during the simulation. | |
double | et_ |
The execution time. | |
double | next_et_ |
The next execution time when the context is branchingpoint. | |
uint | period_ |
Period of the Timer. |
This class is the implementation of the Timer in the DRE Semantic Domain.
Definition at line 460 of file Task.h.
DREAM::Timer::Timer | ( | const std::string & | id, | |
DREAM::Thread * | thread_ptr, | |||
uint | period | |||
) |
DREAM::Timer::Timer | ( | const std::string & | id, | |
DREAM::Thread * | thread_ptr, | |||
uint | period, | |||
uint | bcperiod | |||
) |
DREAM::Timer::Timer | ( | const DREAM::Timer & | timer | ) |
uint DREAM::Timer::bcet | ( | ) | const [inline, virtual] |
Returns the best case period.
bcet () name is used to provide a unique interface for DREAM::Node inherited classes.
Reimplemented from DREAM::Node.
void DREAM::Timer::branching_point | ( | ) | [inline, virtual] |
Sets the new execution time if branching points were found.
Reimplemented from DREAM::Node.
Definition at line 566 of file Task.cpp.
References DREAM::bestcase, and DREAM::branchingpoint.
DREAM::Context DREAM::Timer::context | ( | ) | const [inline, virtual] |
Returns whether the Timer uses the best case or worst case period for the simulation.
Reimplemented from DREAM::Node.
void DREAM::Timer::context | ( | DREAM::Context | context | ) | [inline, virtual] |
Sets the Timer to use the specified context (e.g.
in the simulation).
context | is the context assumed. |
Reimplemented from DREAM::Node.
void DREAM::Timer::clock_exec_reset | ( | ) | [inline, virtual] |
Reset execution clock value - clock_exec_.
Reimplemented from DREAM::Node.
Definition at line 603 of file Task.cpp.
References bcperiod_, DREAM::bestcase, DREAM::Node::clock_exec_, context_, et_, period_, DREAM::random(), DREAM::randomcase, and DREAM::worstcase.
void DREAM::Timer::clock_step | ( | double | clock_step | ) | [virtual] |
Models the passing of time - increments local clock clock_exec_.
clock_step | specifies by how much do we have to increment the time. |
Reimplemented from DREAM::Node.
Definition at line 616 of file Task.cpp.
References bcperiod_, Option::branching_, DREAM::branchingpoint, DREAM::Node::clock_exec_, context_, DREAM::Node::id_, next_et_, period_, DREAM::System::relevant_event(), DREAM::Node::remote_dep_, DREAM::Thread::scheduler(), DREAM::Scheduler::system(), DREAM::Node::thread_ptr_, DREAM::Thread::trace(), and DREAM::worstcase.
double DREAM::Timer::next_event | ( | ) | [inline, virtual] |
Tells when the Timer will generate the next event.
Reimplemented from DREAM::Node.
Definition at line 648 of file Task.cpp.
References DREAM::Node::clock_exec_, and et_.
void DREAM::Timer::next_et | ( | double | next_et | ) | [inline, virtual] |
uint DREAM::Timer::priority | ( | ) | const [virtual] |
void DREAM::Timer::publish | ( | ) | [inline, virtual] |
Publishes an event to dependent tasks.
This function models synchronous event propagation by calling the consume () functions of all the dependent Nodes.
Reimplemented from DREAM::Node.
Definition at line 696 of file Task.cpp.
References DREAM::Node::dependent_map_, DREAM::Node::id_, DREAM::NodeList::publish(), DREAM::System::relevant_event(), DREAM::Thread::scheduler(), DREAM::Scheduler::system(), DREAM::Node::thread_ptr_, DREAM::Thread::trace(), and Option::verbose1_.
void DREAM::Timer::take_transitions | ( | ) | [inline, virtual] |
Takes state transitions.
This function implements the state transitions of a Timer as specified by the DRE Semantic Domain. Transitions are triggered when clock_exec_ reaches the period.
Reimplemented from DREAM::Node.
void DREAM::Timer::visitor_if | ( | DREAM::NODE_MAP * | task_map, | |
DREAM::NODE_MAP * | channel_map, | |||
DREAM::NODE_MAP * | timer_map, | |||
std::ofstream & | f_stream | |||
) | [virtual] |
This function is part of the IF system description generator.
task_map | stores the Task pointers. | |
channel_map | stores the Channel pointers. | |
timer_map | stores the Timer pointers. | |
f_stream | is the output stream to be written to. |
Reimplemented from DREAM::Node.
void DREAM::Timer::visitor_map | ( | DREAM::NODE_MAP * | task_map, | |
DREAM::NODE_MAP * | channel_map, | |||
DREAM::NODE_MAP * | timer_map | |||
) | [virtual] |
This function fills the IDs (names) of tasks, channels and timers to the parameter lists.
The function is used to generate output for model checkers.
task_map | stores the Task pointers. | |
channel_map | stores the Channel pointers. | |
timer_map | stores the Timer pointers. |
Reimplemented from DREAM::Node.
void DREAM::Timer::visitor_uppaal | ( | DREAM::NODE_MAP * | task_map, | |
DREAM::NODE_MAP * | channel_map, | |||
DREAM::NODE_MAP * | timer_map, | |||
std::ofstream & | f_stream | |||
) | [virtual] |
This function is part of the Uppaal system description generator.
task_map | stores the Task pointers. | |
channel_map | stores the Channel pointers. | |
timer_map | stores the Timer pointers. | |
f_stream | is the output stream to be written. |
Reimplemented from DREAM::Node.
uint DREAM::Timer::wcet | ( | ) | const [inline, virtual] |
Returns the period of the Timer.
wcet () name is used to provide a unique interface for DREAM::Node inherited classes.
Reimplemented from DREAM::Node.
uint DREAM::Timer::bcperiod_ [private] |
Best case period.
This construct can be used to model event generators which publish events in a certain interval.
Definition at line 622 of file Task.h.
Referenced by clock_exec_reset(), clock_step(), and Timer().
DREAM::Context DREAM::Timer::context_ [private] |
Specifies whether best case, worst case, or a random value is used for the execution time during the simulation.
Definition at line 625 of file Task.h.
Referenced by clock_exec_reset(), and clock_step().
double DREAM::Timer::et_ [private] |
The execution time.
This value is from the interval [bcet, wcet] and is set according to the context.
Definition at line 630 of file Task.h.
Referenced by clock_exec_reset(), and next_event().
double DREAM::Timer::next_et_ [private] |
The next execution time when the context is branchingpoint.
This value is from the interval [bcet, wcet].
Definition at line 636 of file Task.h.
Referenced by clock_step().
uint DREAM::Timer::period_ [private] |
Period of the Timer.
Definition at line 640 of file Task.h.
Referenced by clock_exec_reset(), clock_step(), and Timer().