Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
DDFForwardScheduler Class Reference

#include <DDFForwardScheduler.h>

Inheritance diagram for DDFForwardScheduler:
DDFSimpleSched DDFScheduler DynDFScheduler

Public Member Functions

 DDFForwardScheduler ()
 
 ~DDFForwardScheduler ()
 
void deadlockIteration (int flag)
 
int run ()
 
void setup ()
 
- Public Member Functions inherited from DDFSimpleSched
void deadlockIteration (int flag)
 
int run ()
 
void setup ()
 
- Public Member Functions inherited from DDFScheduler
const char * domain () const
 
void resetFlag ()
 
void setup ()
 
- Public Member Functions inherited from DynDFScheduler
StringList displaySchedule ()
 
double getStopTime ()
 
void resetStopTime (double v)
 
int run ()
 
void setParams (int numOver, double pd, int maxbsize)
 
void setStopTime (double limit)
 
void setup ()
 

Protected Types

typedef std::deque
< DataFlowStar * > 
DFStarList
 

Protected Member Functions

bool classifyPredecessor (DataFlowStar *pS)
 
bool classifyStar (DataFlowStar *pS)
 
bool classifySuccessor (DataFlowStar *pS)
 
DataFlowStar * findLeastDeferred ()
 
bool initialClassify ()
 
virtual bool isSource (const DataFlowStar &s) const
 
int pragmaRegistered (DataFlowStar *as)
 
int runStar (DataFlowStar *pS)
 
bool setupStars ()
 
- Protected Member Functions inherited from DDFSimpleSched
void initStructures ()
 
int isSource (DataFlowStar &)
 
- Protected Member Functions inherited from DynDFScheduler
virtual int checkBlocks ()
 
DFPortHole * checkInputOverflow (DataFlowStar &, int)
 
void reportArcOverflow (DFPortHole *, int)
 
void resetFlags ()
 

Protected Attributes

DFStarList * mCurrentReadyStars
 
DFStarList mEvenReadyStars
 
DFStarList * mNextReadyStars
 
DFStarList mOddReadyStars
 
DFStarList mPragmaStars
 
- Protected Attributes inherited from DDFSimpleSched
int firedOne
 
int runUntilDeadlock
 
- Protected Attributes inherited from DynDFScheduler
int galSize
 
int lazyDepth
 
int maxToken
 
SequentialList nonSourceBlocks
 
long long numFiring
 
int numOverlapped
 
DFPortHole * overFlowArc
 
SequentialList sourceBlocks
 
long long stopTime
 

Additional Inherited Members

- Public Attributes inherited from DynDFScheduler
double schedulePeriod
 

Detailed Description

Performance optimized DDF Scheduler. The behaviour is derived from DDFSimpleSched. A iteration is defined as in DDFSimpleSched. The buffer overflow condition is slightly different from this scheduler.

See Also
DDFSimpleSched
Author
Andreas Franck $d$
Version
$v$

Constructor & Destructor Documentation

DDFForwardScheduler::DDFForwardScheduler ( )

The constructor.

DDFForwardScheduler::~DDFForwardScheduler ( )

Destructor, frees dynamic storage.

Member Function Documentation

bool DDFForwardScheduler::classifyPredecessor ( DataFlowStar *  pS)
protected

Classify a star as Runnable, Not runnable or Deferred. This method is run after a star connected to an outport of pS was fired. In this special version of classifyStar, only the outports are classified anew.

Returns
true if successful.
bool DDFForwardScheduler::classifyStar ( DataFlowStar *  pS)
protected

Classify a star as Runnable, Not runnable or Deferred. This method is usually called in the setup method. At runtime, the following specialized methods are used.

Returns
true if succesful.
bool DDFForwardScheduler::classifySuccessor ( DataFlowStar *  pS)
protected

Classify a star as Runnable, Not runnable or Deferred. This method is run after a star connected to an inport of pS was fired. This is an optimized version of classifyStar, only the input portholes are tested.

Returns
false on error.
void DDFForwardScheduler::deadlockIteration ( int  flag)
inline

Turn on or off the feature where the scheduler runs in one iteration until it deadlocks.

Parameters
runUntilDeadlockFALSE for running a specified number of iterations, FALSE for running until a deadlock occurs.
DataFlowStar * DDFForwardScheduler::findLeastDeferred ( )
protected

Find the least deferred star. If there is no deferred star, the simulation is deadlocked.

Warning
This an expensive method, and it is assumed that it will not be called often.
Returns
Pointer to the least deferred star or NULL if nonen was found.
bool DDFForwardScheduler::initialClassify ( )
protected

Classifies the stars before the simulation starts. The stars are classified as not runnable, deferred or runnable. The lists of runnable Stars are initialized and filled for the first time, the respective pointers are set for the first iteration (iteration #0).

Returns
false if an error occured
bool DDFForwardScheduler::isSource ( const DataFlowStar &  s) const
protectedvirtual

Determine if the star is a source. The definition used here follows DDFSimpleSched, where a source is a star without inputs.

Warning
This method overrides DDFSimpleSched::isSource() to make this method as const as possible.
Parameters
sThe star in question return true if s is a source star.
int DDFForwardScheduler::pragmaRegistered ( DataFlowStar *  as)
protectedvirtual

Check to see whether a firingsPerIteration pragma is registered for the star. If so, parse that pragma and store it in the star. Also, add a pointer to the star to the pragmaStars list if the value of the pragma is non-zero.

Parameters
asThe star to be be parsed and possibly registered.
Returns
FALSE on error.

Reimplemented from DDFSimpleSched.

int DDFForwardScheduler::run ( )

The run function.

See Also
Scheduler
int DDFForwardScheduler::runStar ( DataFlowStar *  pS)
protected

Fire the specified star. This method calls the derived Str::run() methos checks the overflow condition. Also sets the state of this and the connected stars and schedules them for invocation.

void DDFForwardScheduler::setup ( )

The setup function.

bool DDFForwardScheduler::setupStars ( )
protected

Initialize the stars for simulation. This includes setting up the input and output caches of the stars and registering of the firingsPerIteration pragma. The input and output ports ports of every star are held in dynamically allocated arrays. This method has to be called in the setup() method and after a topology change, if supported.

Returns
true if successfull.

Member Data Documentation

DFStarList* DDFForwardScheduler::mCurrentReadyStars
protected

Pointer to the currently used list of ready Stars

DFStarList DDFForwardScheduler::mEvenReadyStars
protected

List of runnable stars. There are to alternating lists, This holds the ready stars in even iterations.

DFStarList* DDFForwardScheduler::mNextReadyStars
protected

Pointer to the list of stars to be fired in the next iteration

DFStarList DDFForwardScheduler::mOddReadyStars
protected

List of runnable stars. There are to alternating lists, This holds the ready stars in odd iterations.

DFStarList DDFForwardScheduler::mPragmaStars
protected

List to hold the stars with a registered pragma. The pragmaStars list from DDFSimpleSched is not used due to performance problems.