mapss.dif.csdf
Class CSDFToSingleRateTransformerStrategy

java.lang.Object
  extended by mocgraph.analysis.strategy.CachedStrategy
      extended by mapss.dif.csdf.CSDFToSingleRateTransformerStrategy
All Implemented Interfaces:
mocgraph.analysis.analyzer.Analyzer, mocgraph.analysis.analyzer.GraphAnalyzer, mocgraph.analysis.analyzer.Transformer

public class CSDFToSingleRateTransformerStrategy
extends mocgraph.analysis.strategy.CachedStrategy
implements mocgraph.analysis.analyzer.Transformer

A transformation to generate an SingleRateGraph from a CSDFGraph. The computeRepetitions in CSDFGraph does not * period. In Cyclo-Static Dataflow paper, Eq1, repetition vector is different than CSDF repetition vector in DIF. So according to CSDF paper, we multiply period of each node to each repetition.

For more information on the algorithm See: Page403, Figure 9, Greet Bilsen, Marc Engels, Rudy Lauwereins, and Jean Peperstraete. Cyclo-Static Dataflow, IEEE Transaction On Signal Processing, Feb 1996.

Version:
$Id: CSDFToSingleRateTransformerStrategy.java 406 2007-05-10 14:27:07Z plishker $
Author:
Chia-Jui Hsu

Field Summary
protected  mocgraph.Graph _resultGraph
           
 
Constructor Summary
CSDFToSingleRateTransformerStrategy(mocgraph.Graph graph)
          Construct a transformation for a given graph.
 
Method Summary
protected  mocgraph.Edge _addDataflowEdge(mocgraph.Node hSource, mocgraph.Node hSink, int rate, int newDelay)
          This method should be overridden in derived classes to change the way that edges are added to the graph constructed from a CSDF graph.
protected  java.lang.Object _compute()
          Computes the transformation of a CSDFGraph to a SingleRateGraph.
protected  void _resetResultGraph()
          This method should be overridden in derived classes to change the type of graph the resulting graph is reset to.
 boolean hasBackwardMapping()
          Specify if this transformation has a mapping from the transformed version to the original version or not.
 boolean hasForwardMapping()
          Specify if this transformation has a mapping from the original version to the transformed version or not.
 java.lang.Object originalVersionOf(java.lang.Object transformedObject)
          Return the original version of given object in the transformed graph.
 java.lang.Object result()
          Return the resulting graph after the transformation.
 java.lang.String toString()
          Return a description of the analysis.
 java.lang.Object transformedVersionOf(java.lang.Object originalObject)
          Return the transformed version of a given object in the original graph.
 boolean valid()
          Check compatibility for between the analysis and the given graph.
 
Methods inherited from class mocgraph.analysis.strategy.CachedStrategy
_convertResult, _result, cachingStatus, disableCaching, enableCaching, getCachedResult, graph, obsolete, reset, setCachedResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mocgraph.analysis.analyzer.GraphAnalyzer
graph
 

Field Detail

_resultGraph

protected mocgraph.Graph _resultGraph
Constructor Detail

CSDFToSingleRateTransformerStrategy

public CSDFToSingleRateTransformerStrategy(mocgraph.Graph graph)
Construct a transformation for a given graph.

Parameters:
graph - The given graph.
Method Detail

hasBackwardMapping

public boolean hasBackwardMapping()
Specify if this transformation has a mapping from the transformed version to the original version or not.

Specified by:
hasBackwardMapping in interface mocgraph.analysis.analyzer.Transformer
Returns:
True If the implementation of the transformer supports backward mapping.

hasForwardMapping

public boolean hasForwardMapping()
Specify if this transformation has a mapping from the original version to the transformed version or not.

Specified by:
hasForwardMapping in interface mocgraph.analysis.analyzer.Transformer
Returns:
True If the implementation of the transformer supports forward mapping.

originalVersionOf

public java.lang.Object originalVersionOf(java.lang.Object transformedObject)
Return the original version of given object in the transformed graph. The method should be overridden in derived classes to return the original version of the given object. The transformed objects and a mapping between the original and the transformed objects are created during the tranformation process, when the _compute method is being overriden by the derived classes. If not overridden the base class returns a node for each transformed node and an edge for each transformed edge. The transformed objects are from the resulting graph.

Specified by:
originalVersionOf in interface mocgraph.analysis.analyzer.Transformer
Parameters:
transformedObject - The given object in the transformed graph.
Returns:
Return the original version the given object.

result

public java.lang.Object result()
Return the resulting graph after the transformation.

Returns:
Return the resulting graph after the transformation.

toString

public java.lang.String toString()
Return a description of the analysis. This method simply returns a description of the associated graph. It should be overridden in derived classes to include details associated with the associated analyses.

Specified by:
toString in interface mocgraph.analysis.analyzer.Analyzer
Overrides:
toString in class mocgraph.analysis.strategy.CachedStrategy
Returns:
A description of the analysis.

transformedVersionOf

public java.lang.Object transformedVersionOf(java.lang.Object originalObject)
Return the transformed version of a given object in the original graph. The method should be overridden in derived classes to return the transformed version of the given object. The transformed objects and a mapping between the original and the transformed objects are created during the tranformation process, when the _compute method is being overriden by the derived classes. If not overridden the base class returns a Set of nodes for each original node and a Set of edges for each original edge. The objects objects are from the original SDFGraph being transformed.

Specified by:
transformedVersionOf in interface mocgraph.analysis.analyzer.Transformer
Parameters:
originalObject - The given object in the original graph.
Returns:
Return the transformed version the given object.

valid

public boolean valid()
Check compatibility for between the analysis and the given graph.

Specified by:
valid in interface mocgraph.analysis.analyzer.Analyzer
Returns:
True if the graph is a CSDFGraph.

_addDataflowEdge

protected mocgraph.Edge _addDataflowEdge(mocgraph.Node hSource,
                                         mocgraph.Node hSink,
                                         int rate,
                                         int newDelay)
This method should be overridden in derived classes to change the way that edges are added to the graph constructed from a CSDF graph.

Parameters:
hSource - The source node
hSink - The sink node
newDelay - The delay on the edge

_compute

protected java.lang.Object _compute()
Computes the transformation of a CSDFGraph to a SingleRateGraph. For more information on the algorithm See: Page403, Figure 9,

Greet Bilsen, Marc Engels, Rudy Lauwereins, and Jean Peperstraete. Cyclo-Static Dataflow, IEEE Transaction On Signal Processing, Feb 1996.

Overrides:
_compute in class mocgraph.analysis.strategy.CachedStrategy

_resetResultGraph

protected void _resetResultGraph()
This method should be overridden in derived classes to change the type of graph the resulting graph is reset to. If not overridden the default graph would be SingleRateGraph.