DREAM::Timer Class Reference

Timer model. More...

#include <Task.h>

Inheritance diagram for DREAM::Timer:

DREAM::Node List of all members.

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.

Detailed Description

Timer model.

This class is the implementation of the Timer in the DRE Semantic Domain.

Definition at line 460 of file Task.h.


Constructor & Destructor Documentation

DREAM::Timer::Timer ( const std::string &  id,
DREAM::Thread thread_ptr,
uint  period 
)

Constructor.

Parameters:
id specifies the name of the Timer.
thread_ptr defines the mapping of the Timer to a platform processor.
period specifies the period of the Timer.

Definition at line 502 of file Task.cpp.

DREAM::Timer::Timer ( const std::string &  id,
DREAM::Thread thread_ptr,
uint  period,
uint  bcperiod 
)

Constructor.

Parameters:
id specifies the name of the Timer.
thread_ptr defines the mapping of the Timer to a platform processor.
period specifies the worst case period of the Timer.
bcperiod specifies the best case period of the Timer.

Definition at line 516 of file Task.cpp.

DREAM::Timer::Timer ( const DREAM::Timer timer  ) 

Copy constructor for Channels.

Definition at line 532 of file Task.cpp.

References bcperiod_, and period_.

DREAM::Timer::~Timer (  )  [virtual]

Destructor.

Definition at line 547 of file Task.cpp.


Member Function Documentation

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.

Returns:
the best case period bcperiod_.

Reimplemented from DREAM::Node.

Definition at line 555 of file Task.cpp.

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.

Returns:
the context of the Timer.

Reimplemented from DREAM::Node.

Definition at line 587 of file Task.cpp.

void DREAM::Timer::context ( DREAM::Context  context  )  [inline, virtual]

Sets the Timer to use the specified context (e.g.

in the simulation).

Parameters:
context is the context assumed.

Reimplemented from DREAM::Node.

Definition at line 597 of file Task.cpp.

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_.

Parameters:
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.

Returns:
Time remaining till the next event generation (when clock_exec_ == period_).

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]

Sets the next execution time when the context is branchingpoint.

Reimplemented from DREAM::Node.

Definition at line 658 of file Task.cpp.

uint DREAM::Timer::priority (  )  const [virtual]

Returns the priority of the Timer.

The Timer's priority is the priority of its highest priority dependent Task. The function is used by the Uppaal interpreter.

Returns:
priority_ of the Thread which owns the Timer.

Reimplemented from DREAM::Node.

Definition at line 665 of file Task.cpp.

References maxuint.

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.

Definition at line 717 of file Task.cpp.

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.

Parameters:
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.

Definition at line 745 of file Task.cpp.

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.

Parameters:
task_map stores the Task pointers.
channel_map stores the Channel pointers.
timer_map stores the Timer pointers.

Reimplemented from DREAM::Node.

Definition at line 821 of file Task.cpp.

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.

Parameters:
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.

Definition at line 829 of file Task.cpp.

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.

Returns:
the period of the Timer period_.

Reimplemented from DREAM::Node.

Definition at line 841 of file Task.cpp.


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 18:30:04 2007 for DREAM by  doxygen 1.5.1