at.dms.kjc.spacedynamic
Class SpdStreamGraph

java.lang.Object
  extended by at.dms.kjc.flatgraph.StreamGraph
      extended by at.dms.kjc.spacedynamic.SpdStreamGraph

public class SpdStreamGraph
extends StreamGraph

This class represents the entire stream graph of the application we are compiling. It is composed of StaticStreamGraphs in which all filters communicate over static rate channels. The connections between StaticStreamGraphs (SSGs) are dynamic rate. The StreamGraph includes objects (passes) that operate on it and store information for compilation, such as layout, FileState, etc. This extension to at.dms.kjc.flatgraph.StreamGraph is to allow layout and scheduling information to be associated with a StreamGraph and its associated StatisStreamGraph's It is a bit confusing casting something which already appears to be of type StreamGraph to StreamGraph, wh should have had different names.


Field Summary
 HashMap initSwitchSchedules
          Maps RawTile -> switch code schedule *
 JoinerSimulator joinerSimulator
          schedules of sending for all the joiners of the stream graph *
 HashMap steadySwitchSchedules
          Maps RawTile -> switch code schedule *
 
Fields inherited from class at.dms.kjc.flatgraph.StreamGraph
parentMap, staticSubGraphs
 
Constructor Summary
SpdStreamGraph(FlatNode top, RawChip rawChip)
          Create the static stream graph for the application that has
 
Method Summary
static SpdStreamGraph constructStreamGraph(FlatNode node)
          create a stream graph with only one filter (thus one SSG), it's not laid out yet.
static SpdStreamGraph constructStreamGraph(SIRFilter filter)
          create a stream graph with only one filter (thus one SSG).
 void dumpStreamGraph()
          print out some stats on each SSG to STDOUT *
 FileState getFileState()
          return the FileState object for this stream graph *
 Layout getLayout()
          return the layout object for this stream graph *
 RawChip getRawChip()
          return the Raw Chip we are compiling to *
 void handTileAssignment()
          Ask the user for the number of tiles to assign to each SSG *
 boolean isSimple()
           
 void layoutGraph()
          layout the entire Stream Graph on the RawChip *
protected  SpdStaticStreamGraph new_StaticStreamGraph(StreamGraph sg, FlatNode realTop)
          Use in place of "new StaticStreamGraph" for subclassing.
 void tileAssignment()
          for each sub-graph, assign a certain number of tiles to it *
 void tileAssignmentOneFilter()
          This will automatically assign the single tile of the raw chip to the one filter of the one SSG, all these conditions must be true
 
Methods inherited from class at.dms.kjc.flatgraph.StreamGraph
createStaticStreamGraphs, dumpStaticStreamGraph, dynamicEntry, dynamicExit, getParentSSG, getStaticSubGraphs, getTopLevel, recreateSIR
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

joinerSimulator

public JoinerSimulator joinerSimulator
schedules of sending for all the joiners of the stream graph *


initSwitchSchedules

public HashMap initSwitchSchedules
Maps RawTile -> switch code schedule *


steadySwitchSchedules

public HashMap steadySwitchSchedules
Maps RawTile -> switch code schedule *

Constructor Detail

SpdStreamGraph

public SpdStreamGraph(FlatNode top,
                      RawChip rawChip)
Create the static stream graph for the application that has
top
as the top level FlatNode, and compile it to
rawChip

Method Detail

new_StaticStreamGraph

protected SpdStaticStreamGraph new_StaticStreamGraph(StreamGraph sg,
                                                     FlatNode realTop)
Use in place of "new StaticStreamGraph" for subclassing. A subclass of StreamGraph may refer to a subclass of StaticStreamGraph. If we just used "new StaticStreamGraph" in this class we would only be making StaticStreamGraph's of the type in this package. Note that we are only able to overridet a method if the inputs match the type of the overridden method, so we expect a StreamGraph but have to claim that the input is a at.dms.kjc.flatgraph.StreamGraph

Overrides:
new_StaticStreamGraph in class StreamGraph
Parameters:
sg - a SpdStreamGraph
realTop - the top node
Returns:
a new SpdStaticStreamGraph

isSimple

public boolean isSimple()
Returns:
True if the graph is laid out with no overlapping routes, no routing tiles, and each joiner has at most 3 incoming nodes with no chained joiners, and each splitter has as most 3 outgoing nodes with no chained splitters.

tileAssignmentOneFilter

public void tileAssignmentOneFilter()
This will automatically assign the single tile of the raw chip to the one filter of the one SSG, all these conditions must be true


handTileAssignment

public void handTileAssignment()
Ask the user for the number of tiles to assign to each SSG *


tileAssignment

public void tileAssignment()
for each sub-graph, assign a certain number of tiles to it *


getFileState

public FileState getFileState()
return the FileState object for this stream graph *


getLayout

public Layout getLayout()
return the layout object for this stream graph *


layoutGraph

public void layoutGraph()
layout the entire Stream Graph on the RawChip *


getRawChip

public RawChip getRawChip()
return the Raw Chip we are compiling to *


dumpStreamGraph

public void dumpStreamGraph()
print out some stats on each SSG to STDOUT *


constructStreamGraph

public static SpdStreamGraph constructStreamGraph(SIRFilter filter)
create a stream graph with only one filter (thus one SSG).


constructStreamGraph

public static SpdStreamGraph constructStreamGraph(FlatNode node)
create a stream graph with only one filter (thus one SSG), it's not laid out yet.