#include <Task.h>
Inheritance diagram for DREAM::Node:
Public Member Functions | |
Node (const std::string &id, DREAM::Thread *thread_ptr, bool executed) | |
Constructor. | |
Node (const DREAM::Node &node) | |
Copy constructor for Nodes. | |
virtual | ~Node () |
Destructor. | |
virtual void | add_dependent (DREAM::Node *node_ptr) |
Adds a dependent Node to the current Node. | |
virtual uint | bcet () const |
Generic nodes do not have best case execution times. | |
virtual void | bcet (uint bcet) |
Generic nodes do not have best case execution times. | |
virtual void | branching_point () |
Generic nodes do not have branching points. | |
virtual DREAM::Context | context () const |
Generic nodes do not have context. | |
virtual void | context (DREAM::Context context) |
Generic nodes do not have context. | |
virtual double | clock_dl () const |
Generic nodes do not have deadline clocks. | |
virtual double | clock_dl_reset () const |
Generic nodes do not have deadline clocks. | |
virtual double | clock_exec () const |
Measures time spent executing. | |
virtual void | clock_exec_reset () |
Reset execution clock value - clock_exec_. | |
virtual void | clock_step (double clock_step) |
Models the passing of time. | |
virtual void | consume () |
Generic nodes do not consume events. | |
virtual uint | deadline () const |
Generic nodes do not have deadlines. | |
virtual void | deadline (uint deadline) |
Generic nodes do not have deadlines. | |
virtual void | deploy (DREAM::Thread *thread_ptr) |
Deploys a Node to a Thread. | |
virtual void | execute () |
Generic Nodes do not execute. | |
virtual bool | executed () const |
Checks whether the Node has already been executed. | |
virtual void | executed (bool executed) |
Sets the Node to be executed. | |
virtual DREAM::Node * | get_dependent (const std::string &id) const |
Returns a dependent from the list. | |
virtual const DREAM::NODE_MAP * | get_dependent_map () const |
Returns the whole map for manipulation. | |
virtual const DREAM::Node * | get_source (DREAM::NODE_MAP *task_map, DREAM::NODE_MAP *channel_map, DREAM::NODE_MAP *timer_map) const throw (DREAM::Exception) |
Returns a pointer to the source Node. | |
virtual std::string | id () const |
Returns the name of the Node. | |
virtual bool | isidle () const |
Generic nodes do not have deadlines. | |
virtual double | next_event () |
Generic nodes do not generate events. | |
virtual void | next_et (double next_et) |
Generic nodes do not have clocks. | |
virtual void | publish () |
Publishes an event to dependent tasks. | |
virtual void | preempt () |
Generic nodes cannot be preempted. | |
virtual uint | priority () const |
Generic nodes do not have priorities. | |
virtual void | priority (uint priority) |
Generic nodes do not have priorities. | |
virtual bool | remote_dep () const |
Returns the remote_dep_ flag of the Node. | |
virtual void | remote_dep (bool flag) |
Sets the remote_dep_ flag of the Node. | |
virtual void | remove_dependent (const std::string &id) |
Removes a dependent from the list. | |
virtual void | reset () |
Resets node (when restarting the simulation). | |
virtual DREAM::Scheduler * | scheduler () const |
Returns a pointer to the Scheduler. | |
virtual uint | subpriority () const |
Generic nodes do not have subpriorities. | |
virtual void | subpriority (uint subpriority) |
Generic nodes do not have subpriorities. | |
virtual void | take_transitions () |
Generic nodes do not take 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 does not work for generic nodes. | |
virtual void | visitor_task_avltree (DREAM::TASK_AVLTREE *task_avltree) |
This function does not work for generic nodes. | |
virtual void | visitor_update_task_avltree (DREAM::TASK_AVLTREE *task_avltree) |
This function does not work for generic nodes. | |
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 does not work for generic nodes. | |
virtual uint | wcet () const |
Generic nodes do not have worst case execution times. | |
virtual void | wcet (uint wcet) |
Generic nodes do not have worst case execution times. | |
Protected Attributes | |
double | clock_exec_ |
Execution clock. | |
DREAM::NodeList * | dependent_map_ |
Dependent tasks. | |
bool | executed_ |
Executed flag is used to check unreachable tasks. | |
std::string | id_ |
ID. | |
DREAM::Thread * | thread_ptr_ |
Pointer to the Thread. | |
bool | remote_dep_ |
If this flag is true, the Node has dependents on remote CPUs and has to check branching points during the trace-based verification. |
This class is the base class for every element in the DRE Semantic Domain.
Definition at line 75 of file Task.h.
DREAM::Node::Node | ( | const std::string & | id, | |
DREAM::Thread * | thread_ptr, | |||
bool | executed | |||
) |
Constructor.
id | specifies the name of the Node. | |
thread_ptr | defines the mapping of the Node to a platform processor. | |
executed | is used to check unexecuted tasks in a frame. |
Definition at line 62 of file Task.cpp.
References DREAM::NodeList::add(), and dependent_map_.
DREAM::Node::Node | ( | const DREAM::Node & | node | ) |
Copy constructor for Nodes.
node | is the pointer to the Node to be copied. |
Definition at line 74 of file Task.cpp.
References DREAM::NodeList::add(), dependent_map_, and thread_ptr_.
DREAM::Node::~Node | ( | ) | [virtual] |
void DREAM::Node::add_dependent | ( | DREAM::Node * | node_ptr | ) | [inline, virtual] |
Adds a dependent Node to the current Node.
node_ptr | is a pointer to the dependent Node to be added. |
Reimplemented in DREAM::Channel.
Definition at line 91 of file Task.cpp.
References DREAM::NodeList::add(), and dependent_map_.
uint DREAM::Node::bcet | ( | ) | const [virtual] |
Generic nodes do not have best case execution times.
Inherited classes may implement this feature.
Reimplemented in DREAM::Timer, DREAM::Channel, and DREAM::Task.
void DREAM::Node::bcet | ( | uint | bcet | ) | [virtual] |
Generic nodes do not have best case execution times.
Inherited classes may implement this feature.
Reimplemented in DREAM::Task.
void DREAM::Node::branching_point | ( | ) | [virtual] |
Generic nodes do not have branching points.
Inherited classes may implement this feature.
Reimplemented in DREAM::Timer, DREAM::Channel, and DREAM::Task.
DREAM::Context DREAM::Node::context | ( | ) | const [virtual] |
Generic nodes do not have context.
Inherited classes may implement this feature.
Reimplemented in DREAM::Timer, DREAM::Channel, and DREAM::Task.
Definition at line 136 of file Task.cpp.
References DREAM::randomcase.
void DREAM::Node::context | ( | DREAM::Context | context | ) | [virtual] |
Generic nodes do not have context.
Inherited classes may implement this feature.
Reimplemented in DREAM::Timer, DREAM::Channel, and DREAM::Task.
double DREAM::Node::clock_dl | ( | ) | const [virtual] |
Generic nodes do not have deadline clocks.
Inherited classes may implement this feature.
Reimplemented in DREAM::Task.
double DREAM::Node::clock_dl_reset | ( | ) | const [virtual] |
double DREAM::Node::clock_exec | ( | ) | const [inline, virtual] |
Measures time spent executing.
Definition at line 190 of file Task.cpp.
References clock_exec_.
void DREAM::Node::clock_exec_reset | ( | ) | [inline, virtual] |
Reset execution clock value - clock_exec_.
Reimplemented in DREAM::Timer, DREAM::Channel, and DREAM::Task.
Definition at line 195 of file Task.cpp.
References clock_exec_.
Referenced by reset().
void DREAM::Node::clock_step | ( | double | clock_step | ) | [inline, 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 in DREAM::Timer, DREAM::Channel, and DREAM::Task.
Definition at line 200 of file Task.cpp.
References clock_exec_.
void DREAM::Node::consume | ( | ) | [virtual] |
Generic nodes do not consume events.
Inherited classes may implement this feature.
Reimplemented in DREAM::Channel, and DREAM::Task.
uint DREAM::Node::deadline | ( | ) | const [virtual] |
Generic nodes do not have deadlines.
Inherited classes may implement this feature.
Reimplemented in DREAM::Task.
void DREAM::Node::deadline | ( | uint | deadline | ) | [virtual] |
Generic nodes do not have deadlines.
Inherited classes may implement this feature.
Reimplemented in DREAM::Task.
void DREAM::Node::deploy | ( | DREAM::Thread * | thread_ptr | ) | [virtual] |
This function updates the thread_ptr in the Node.
Definition at line 243 of file Task.cpp.
References DREAM::NodeList::add(), DREAM::NodeList::erase(), id_, and thread_ptr_.
virtual void DREAM::Node::execute | ( | ) | [inline, virtual] |
bool DREAM::Node::executed | ( | ) | const [inline, virtual] |
Checks whether the Node has already been executed.
Definition at line 252 of file Task.cpp.
References executed_.
Referenced by DREAM::Task::reset().
void DREAM::Node::executed | ( | bool | executed | ) | [inline, virtual] |
Node * DREAM::Node::get_dependent | ( | const std::string & | id | ) | const [inline, virtual] |
Returns a dependent from the list.
id | specifies which dependent are we looking for. |
Definition at line 262 of file Task.cpp.
References dependent_map_, and DREAM::NodeList::find().
const NODE_MAP * DREAM::Node::get_dependent_map | ( | ) | const [inline, virtual] |
Returns the whole map for manipulation.
Definition at line 267 of file Task.cpp.
References dependent_map_, and DREAM::NodeList::get_map().
const DREAM::Node * DREAM::Node::get_source | ( | DREAM::NODE_MAP * | task_map, | |
DREAM::NODE_MAP * | channel_map, | |||
DREAM::NODE_MAP * | timer_map | |||
) | const throw (DREAM::Exception) [virtual] |
std::string DREAM::Node::id | ( | ) | const [inline, virtual] |
Returns the name of the Node.
Definition at line 314 of file Task.cpp.
References id_.
Referenced by DREAM::NodeList::add(), DREAM::Scheduler::add_error(), DREAM::IFInterpreter::create_fixedpriority_exec_assignment(), DREAM::UppaalInterpreter::create_fixedpriority_guard(), DREAM::IFInterpreter::create_fixedpriority_guard(), DREAM::Thread::dequeue(), DREAM::Thread::enqueue(), DREAM::Scheduler::erase(), and DREAM::FixedPriorityScheduler::schedule().
bool DREAM::Node::isidle | ( | ) | const [virtual] |
Generic nodes do not have deadlines.
Inherited classes may implement this feature.
Reimplemented in DREAM::Task.
double DREAM::Node::next_event | ( | ) | [inline, virtual] |
Generic nodes do not generate events.
No Exception is thrown.
Reimplemented in DREAM::Timer, DREAM::Channel, and DREAM::Task.
void DREAM::Node::next_et | ( | double | next_et | ) | [virtual] |
Generic nodes do not have clocks.
Inherited classes may implement this feature.
Reimplemented in DREAM::Timer, DREAM::Channel, and DREAM::Task.
void DREAM::Node::publish | ( | ) | [inline, virtual] |
Publishes an event to dependent tasks.
This virtual function models synchronous event propagation. The derived classes call the consume () function of all the dependent Nodes.
Reimplemented in DREAM::Timer, DREAM::Channel, and DREAM::Task.
Definition at line 390 of file Task.cpp.
References dependent_map_, id_, DREAM::NodeList::publish(), DREAM::System::relevant_event(), DREAM::Thread::scheduler(), DREAM::Scheduler::system(), thread_ptr_, DREAM::Thread::trace(), and Option::verbose1_.
void DREAM::Node::preempt | ( | ) | [virtual] |
Generic nodes cannot be preempted.
Inherited classes may implement this feature.
Reimplemented in DREAM::Task.
uint DREAM::Node::priority | ( | ) | const [virtual] |
Generic nodes do not have priorities.
Inherited classes may implement this feature.
Reimplemented in DREAM::Timer, and DREAM::Task.
Definition at line 364 of file Task.cpp.
Referenced by DREAM::IFInterpreter::create_fixedpriority_back_guard(), DREAM::IFInterpreter::create_fixedpriority_exec_assignment(), DREAM::UppaalInterpreter::create_fixedpriority_guard(), DREAM::IFInterpreter::create_fixedpriority_guard(), DREAM::IFInterpreter::create_fixedpriority_preemption_guard(), DREAM::FixedPriorityScheduler::highestpriority(), and DREAM::FixedPriorityScheduler::lowestpriority().
void DREAM::Node::priority | ( | uint | priority | ) | [virtual] |
Generic nodes do not have priorities.
Inherited classes may implement this feature.
Reimplemented in DREAM::Task.
bool DREAM::Node::remote_dep | ( | ) | const [inline, virtual] |
Returns the remote_dep_ flag of the Node.
Definition at line 411 of file Task.cpp.
References remote_dep_.
void DREAM::Node::remote_dep | ( | bool | flag | ) | [inline, virtual] |
Sets the remote_dep_ flag of the Node.
Definition at line 416 of file Task.cpp.
References remote_dep_.
void DREAM::Node::remove_dependent | ( | const std::string & | id | ) | [inline, virtual] |
Removes a dependent from the list.
id | specifies the dependent to be removed. |
Definition at line 406 of file Task.cpp.
References dependent_map_, and DREAM::NodeList::erase().
void DREAM::Node::reset | ( | ) | [inline, virtual] |
Resets node (when restarting the simulation).
Reimplemented in DREAM::Channel, and DREAM::Task.
Definition at line 421 of file Task.cpp.
References clock_exec_reset().
DREAM::Scheduler * DREAM::Node::scheduler | ( | ) | const [inline, virtual] |
Returns a pointer to the Scheduler.
Used in output generation
Definition at line 427 of file Task.cpp.
References DREAM::Thread::scheduler(), and thread_ptr_.
Referenced by DREAM::UppaalInterpreter::highestpriority(), DREAM::IFInterpreter::highestpriority(), DREAM::UppaalInterpreter::lowestpriority(), DREAM::IFInterpreter::lowestpriority(), and DREAM::Task::zero_delay_race_condition().
uint DREAM::Node::subpriority | ( | ) | const [virtual] |
Generic nodes do not have subpriorities.
Inherited classes may implement this feature.
Reimplemented in DREAM::Task.
Definition at line 432 of file Task.cpp.
Referenced by DREAM::IFInterpreter::create_fixedpriority_back_guard(), DREAM::UppaalInterpreter::create_fixedpriority_guard(), DREAM::IFInterpreter::create_fixedpriority_guard(), and DREAM::FixedPriorityScheduler::schedule().
void DREAM::Node::subpriority | ( | uint | subpriority | ) | [virtual] |
Generic nodes do not have subpriorities.
Inherited classes may implement this feature.
Reimplemented in DREAM::Task.
void DREAM::Node::take_transitions | ( | ) | [virtual] |
Generic nodes do not take transitions.
Inherited classes may implement this feature.
Reimplemented in DREAM::Timer, DREAM::Channel, and DREAM::Task.
virtual void DREAM::Node::visitor_if | ( | DREAM::NODE_MAP * | task_map, | |
DREAM::NODE_MAP * | channel_map, | |||
DREAM::NODE_MAP * | timer_map, | |||
std::ofstream & | f_stream | |||
) | [inline, 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 in DREAM::Timer, and DREAM::Task.
virtual void DREAM::Node::visitor_map | ( | DREAM::NODE_MAP * | task_map, | |
DREAM::NODE_MAP * | channel_map, | |||
DREAM::NODE_MAP * | timer_map | |||
) | [inline, virtual] |
This function does not work for generic nodes.
Inherited classes may implement this feature.
task_map | stores the Task pointers. | |
channel_map | stores the Channel pointers. | |
timer_map | stores the Timer pointers. |
Reimplemented in DREAM::Timer, DREAM::Channel, and DREAM::Task.
virtual void DREAM::Node::visitor_task_avltree | ( | DREAM::TASK_AVLTREE * | task_avltree | ) | [inline, virtual] |
This function does not work for generic nodes.
Inherited classes may implement this feature.
task_avltree | stores the Task pointers. |
Reimplemented in DREAM::Task.
virtual void DREAM::Node::visitor_update_task_avltree | ( | DREAM::TASK_AVLTREE * | task_avltree | ) | [inline, virtual] |
This function does not work for generic nodes.
Inherited classes may implement this feature.
task_avltree | stores the Task pointers. |
Reimplemented in DREAM::Task.
virtual void DREAM::Node::visitor_uppaal | ( | DREAM::NODE_MAP * | task_map, | |
DREAM::NODE_MAP * | channel_map, | |||
DREAM::NODE_MAP * | timer_map, | |||
std::ofstream & | f_stream | |||
) | [inline, virtual] |
This function does not work for generic nodes.
Inherited classes may implement this feature.
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 in DREAM::Timer, DREAM::Channel, and DREAM::Task.
uint DREAM::Node::wcet | ( | ) | const [virtual] |
Generic nodes do not have worst case execution times.
Inherited classes may implement this feature.
Reimplemented in DREAM::Timer, DREAM::Channel, and DREAM::Task.
void DREAM::Node::wcet | ( | uint | wcet | ) | [virtual] |
Generic nodes do not have worst case execution times.
Inherited classes may implement this feature.
Reimplemented in DREAM::Task.
double DREAM::Node::clock_exec_ [protected] |
Execution clock.
Definition at line 439 of file Task.h.
Referenced by clock_exec(), DREAM::Task::clock_exec_reset(), DREAM::Channel::clock_exec_reset(), DREAM::Timer::clock_exec_reset(), clock_exec_reset(), DREAM::Task::clock_step(), DREAM::Channel::clock_step(), DREAM::Timer::clock_step(), clock_step(), DREAM::Task::next_event(), DREAM::Channel::next_event(), and DREAM::Timer::next_event().
DREAM::NodeList* DREAM::Node::dependent_map_ [protected] |
Dependent tasks.
Definition at line 442 of file Task.h.
Referenced by add_dependent(), get_dependent(), get_dependent_map(), Node(), DREAM::Timer::publish(), publish(), remove_dependent(), and ~Node().
bool DREAM::Node::executed_ [protected] |
Executed flag is used to check unreachable tasks.
Definition at line 445 of file Task.h.
Referenced by executed().
std::string DREAM::Node::id_ [protected] |
ID.
Definition at line 448 of file Task.h.
Referenced by DREAM::Task::clock_step(), DREAM::Channel::clock_step(), DREAM::Timer::clock_step(), deploy(), id(), DREAM::Task::operator=(), DREAM::Task::operator==(), DREAM::Timer::publish(), and publish().
DREAM::Thread* DREAM::Node::thread_ptr_ [protected] |
Pointer to the Thread.
Definition at line 451 of file Task.h.
Referenced by DREAM::Task::clock_step(), DREAM::Channel::clock_step(), DREAM::Timer::clock_step(), deploy(), Node(), DREAM::Timer::publish(), publish(), and scheduler().
bool DREAM::Node::remote_dep_ [protected] |
If this flag is true, the Node has dependents on remote CPUs and has to check branching points during the trace-based verification.
Definition at line 454 of file Task.h.
Referenced by DREAM::Task::clock_step(), DREAM::Channel::clock_step(), DREAM::Timer::clock_step(), and remote_dep().