Otawa  0.10
otawa::ParExeStage Class Reference

Representation of a pipeline stage to be used to build a ParExeGraph. More...

#include <otawa/parexegraph/ParExeProc.h>

Classes

class  NodeIterator
 Iterator for the graph nodes related to the pipeline stage. More...
 

Public Types

enum  order_t { IN_ORDER, OUT_OF_ORDER }
 
enum  pipeline_stage_category_t {
  FETCH, DECODE, EXECUTE, COMMIT,
  DELAY, FU
}
 
typedef enum
otawa::ParExeStage::order_t 
order_policy_t
 
typedef enum
otawa::ParExeStage::pipeline_stage_category_t 
pipeline_stage_category_t
 

Public Member Functions

 ParExeStage (pipeline_stage_category_t category, int latency, int width, order_t policy, ParExeQueue *sq, ParExeQueue *dq, elm::String name, int index=0, const hard::PipelineUnit *unit=0)
 Constructor. More...
 
void addNode (ParExeNode *node)
 This function adds an execution graph (ParExeGraph) node to the list of nodes related to the pipeline stage. More...
 
void removeNode (ParExeNode *node)
 
const hard::PipelineUnitunit (void) const
 
order_t orderPolicy (void)
 
int width (void) const
 
elm::String name (void)
 
int index (void)
 
pipeline_stage_category_t category (void)
 
ParExeQueuesourceQueue (void)
 
ParExeQueuedestinationQueue (void)
 
int latency (void)
 
bool isFuStage (void)
 
void addFunctionalUnit (bool pipelined, int latency, int width, elm::String name, const hard::PipelineUnit *unit)
 Adds a functional unit (should be used with EXECUTE stages only). More...
 
int numFus (void)
 
ParExePipelinefu (int index)
 This function returns a pointer to a functional unit pipeline. More...
 
ParExeNodefirstNode (void)
 
ParExeNodelastNode (void)
 
bool hasNodes (void)
 Deletes all the nodes in the list. More...
 
void deleteNodes (void)
 
int numNodes (void)
 
ParExeNodenode (int index)
 Returns a pointer to a graph node related to the stage. More...
 
void addBinding (Inst::kind_t kind, ParExePipeline *fu)
 Binds a functional unit to an instruction kind. More...
 
ParExePipelinefindFU (Inst::kind_t kind)
 

Private Attributes

const hard::PipelineUnit_unit
 
pipeline_stage_category_t _category
 
int _latency
 
int _width
 
order_t _order_policy
 
ParExeQueue_source_queue
 
ParExeQueue_destination_queue
 
elm::String _name
 
int _index
 
Vector< Pair< Inst::kind_t,
ParExePipeline * > > 
_bindings
 
elm::genstruct::Vector
< ParExePipeline * > 
_fus
 
elm::genstruct::Vector
< ParExeNode * > 
_nodes
 

Detailed Description

Representation of a pipeline stage to be used to build a ParExeGraph.

See also
Parametric Execution Graph

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
IN_ORDER 
OUT_OF_ORDER 
Enumerator
FETCH 
DECODE 
EXECUTE 
COMMIT 
DELAY 
FU 

Constructor & Destructor Documentation

otawa::ParExeStage::ParExeStage ( pipeline_stage_category_t  category,
int  latency,
int  width,
order_t  policy,
ParExeQueue sq,
ParExeQueue dq,
elm::String  name,
int  index = 0,
const hard::PipelineUnit unit = 0 
)
inline

Constructor.

Parameters
categoryStage category
latencyLatency (i.e. number of cycles required to process an instruction)
widthNumber of instructions that can be processed in parallel
policyPolicy used to schedule instructions (only applies to EXECUTE stages)
sqSource queue (i.e. queue from which instructions to be processed are read - NULL if instructions directly come from the previous pipeline stage)
dqDestination queue (i.e. queue into which instructions will be inserted when they have been processed - NULL if instructions directly go to the next pipeline stage)
nameName of the pipeline stage (used for debugging purposes)
indexPosition of the stage in the pipeline (0 is for the first stage)

Referenced by addFunctionalUnit().

Member Function Documentation

void otawa::ParExeStage::addBinding ( Inst::kind_t  kind,
ParExePipeline fu 
)
inline

Binds a functional unit to an instruction kind.

This binding will be used to determine which functional unit will process an instruction (accrding to its kind). See function findFU().

Parameters
kindInstruction kind
fuPointer to the functional unit pipeline.

References elm::pair().

Referenced by otawa::ParExeProc::ParExeProc().

void otawa::ParExeStage::addFunctionalUnit ( bool  pipelined,
int  latency,
int  width,
elm::String  name,
const hard::PipelineUnit unit 
)
inline

Adds a functional unit (should be used with EXECUTE stages only).

Parameters
pipelinedTrue if the functional unit is pipelined.
latencyLatency of the functional unit. If the functional unit is pipelined, it will have as many stages as the value of its latency, each one with a single-cycle latency. If the functional unit is not pipelined, it will have a single stage with the specified latency.
widthNumber of identical functional units to add. In other words, number of instructions that can be processed in parallel par the functional unit.
nameName of the functional unit (used for debugging purposes).

References _, _destination_queue, _fus, _order_policy, _source_queue, otawa::ParExePipeline::addStage(), FU, fu(), IN_ORDER, latency(), and ParExeStage().

Referenced by otawa::ParExeProc::ParExeProc().

void otawa::ParExeStage::addNode ( ParExeNode node)
inline

This function adds an execution graph (ParExeGraph) node to the list of nodes related to the pipeline stage.

Parameters
nodePointer to the graph node.
pipeline_stage_category_t otawa::ParExeStage::category ( void  )
inline
Returns
Stage category.

Referenced by otawa::ParExeInst::addNode().

void otawa::ParExeStage::deleteNodes ( void  )
inline
ParExeQueue * otawa::ParExeStage::destinationQueue ( void  )
inline
Returns
Pointer to the queue into which processed instructions are to be inserted into (NULL if instructions go directly to the next pipeline stage.

Referenced by otawa::ParExePipeline::addStage().

ParExePipeline * otawa::ParExeStage::findFU ( Inst::kind_t  kind)
inline
Parameters
kindInstruction kind
Returns
Pointer to the functional unit pipeline that handles that kind of instructions.

Referenced by otawa::ParExeGraph::pipeline().

ParExeNode * otawa::ParExeStage::firstNode ( void  )
inline
Returns
Pointer to the first graph node related to the stage.

Referenced by otawa::ParExeGraph::addEdgesForFetch().

ParExePipeline * otawa::ParExeStage::fu ( int  index)
inline

This function returns a pointer to a functional unit pipeline.

Parameters
indexindex of the functional unit (functional units are numbered in the order they have been added to the EXECUTE stage)
Returns
Pointer to the indexed functional unit.

Referenced by otawa::ParExeGraph::addEdgesForDataDependencies(), otawa::ParExeGraph::addEdgesForMemoryOrder(), addFunctionalUnit(), otawa::ParExeGraph::findContendingNodes(), and otawa::ParExeProc::ParExeProc().

void otawa::ParExeStage::hasNodes ( void  )
inline

Deletes all the nodes in the list.

Returns
True if the list of nodes is not empty (pipeline stages belonging to functional units might have no nodes if they are not used by any instruction in the graph).

Referenced by otawa::ParExeProc::ParExeProc().

int otawa::ParExeStage::index ( void  )
inline
Returns
Stage index (its position in the pipeline - 0 is for the first stage).

Referenced by otawa::QueueResource::QueueResource().

bool otawa::ParExeStage::isFuStage ( void  )
inline
Returns
True if the stage is part of a functional unit.

References otawa::etime::FU.

ParExeNode * otawa::ParExeStage::lastNode ( void  )
inline
Returns
Pointer to the lastgraph node related to the stage.
int otawa::ParExeStage::latency ( void  )
inline
Returns
Stage latency (i.e. number of cycles required to process an instruction.

Referenced by addFunctionalUnit().

elm::String otawa::ParExeStage::name ( void  )
inline
ParExeNode * otawa::ParExeStage::node ( int  index)
inline

Returns a pointer to a graph node related to the stage.

Parameters
indexIndex of the node in the list (nodes are numbered in the order they have been added to the list).
Returns
Pointer to the indexed node.

Referenced by otawa::ParExeGraph::addEdgesForDataDependencies(), otawa::ParExeGraph::addEdgesForMemoryOrder(), otawa::ParExeGraph::addEdgesForQueues(), otawa::ParExeGraph::findContendingNodes(), and otawa::ParExeGraph::initDelays().

int otawa::ParExeStage::numFus ( void  )
inline
Returns
Number of functional units attached to the stage (relevant for EXECUTE stages only).

Referenced by otawa::ParExeGraph::addEdgesForDataDependencies(), otawa::ParExeGraph::addEdgesForMemoryOrder(), and otawa::ParExeProc::ParExeProc().

int otawa::ParExeStage::numNodes ( void  )
inline
order_t otawa::ParExeStage::orderPolicy ( void  )
inline
Returns
Instruction scheduling policy (relevant for EXECUTE stages only).
void otawa::ParExeStage::removeNode ( ParExeNode node)
inline
ParExeQueue* otawa::ParExeStage::sourceQueue ( void  )
inline
const hard::PipelineUnit* otawa::ParExeStage::unit ( void  ) const
inline
int otawa::ParExeStage::width ( void  ) const
inline

Member Data Documentation

Vector<Pair<Inst::kind_t, ParExePipeline *> > otawa::ParExeStage::_bindings
private
pipeline_stage_category_t otawa::ParExeStage::_category
private
ParExeQueue* otawa::ParExeStage::_destination_queue
private

Referenced by addFunctionalUnit().

elm::genstruct::Vector<ParExePipeline *> otawa::ParExeStage::_fus
private

Referenced by addFunctionalUnit().

int otawa::ParExeStage::_index
private
int otawa::ParExeStage::_latency
private
elm::String otawa::ParExeStage::_name
private
elm::genstruct::Vector<ParExeNode *> otawa::ParExeStage::_nodes
private
order_t otawa::ParExeStage::_order_policy
private

Referenced by addFunctionalUnit().

ParExeQueue* otawa::ParExeStage::_source_queue
private

Referenced by addFunctionalUnit().

const hard::PipelineUnit* otawa::ParExeStage::_unit
private
int otawa::ParExeStage::_width
private

The documentation for this class was generated from the following files: