mapss.dif.csdf.sdf
Class SDFToSingleRateTransformerStrategy

java.lang.Object
  extended by mocgraph.analysis.strategy.CachedStrategy
      extended by mapss.dif.csdf.sdf.SDFToSingleRateTransformerStrategy
All Implemented Interfaces:
mocgraph.analysis.analyzer.Analyzer, mocgraph.analysis.analyzer.GraphAnalyzer, mocgraph.analysis.analyzer.Transformer
Direct Known Subclasses:
SDFToHSDFTransformerStrategy

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

A transformation to generate an SingleRateGraph from an SDFGraph.

Version:
$Id: SDFToSingleRateTransformerStrategy.java 406 2007-05-10 14:27:07Z plishker $
Author:
Shahrooz Shahparnia

Field Summary
protected  mocgraph.Graph _resultGraph
           
 
Constructor Summary
SDFToSingleRateTransformerStrategy(mocgraph.Graph graph)
          Construct a transformation for a given graph.
 
Method Summary
protected  mocgraph.Edge _addDataflowEdge(mocgraph.Node hSource, mocgraph.Node hSink, int newDelay)
          This method should be overridden in derived classes to change the way that edges are added to the graph constructed from an SDF graph.
protected  java.lang.Object _compute()
          Computes the transformation of an SDFGraph 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

SDFToSingleRateTransformerStrategy

public SDFToSingleRateTransformerStrategy(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 SDFGraph.

_addDataflowEdge

protected mocgraph.Edge _addDataflowEdge(mocgraph.Node hSource,
                                         mocgraph.Node hSink,
                                         int newDelay)
This method should be overridden in derived classes to change the way that edges are added to the graph constructed from an SDF 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 an SDFGraph to a SingleRateGraph. For more information on the algorithm See: Page40, Figure 3.6,

S. Sriram and S. S. Bhattacharyya. Embedded Multiprocessors: Scheduling and Synchronization. Marcel Dekker, Inc., 2000. 327 pages.

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.