|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.flatgraph.StaticStreamGraph
public class StaticStreamGraph
A representation of a portion of a FlatGraph where all comunication is static rate. A StaticStreamGraph represents a subgraph of the application's StreamGraph where communication within the SSG is over static rate channels. The input/output (if either exists) of an SSG is dynamic, but the sources and sinks have their input/output rates zeroed, repectively. A SSG can be modified and replaced in the graph structure by calling setTopLevelSIR with the modified SSG. Modification must preserve the following: it must not change the number of inputs and outputs of the SSG. If a SSG has multiple inputs (resp. outputs), there must be a round-robin splitter (resp. joiner) with 0 edge weights creating a single root (resp. exit) for the SSG and connecting to the actual inputs (resp. outputs).
Field Summary | |
---|---|
protected LinkedList<FlatNode> |
flatNodes
|
protected GraphFlattener |
graphFlattener
the graph flattener used to convert SIR to FlatGraph |
int |
id
|
protected FlatNode[] |
inputs
arrays representing the inputs and output of this ssg from top to bottom (left to right)... |
protected HashMap<SIRFilter,SIRFilter> |
nexts
|
protected List<StaticStreamGraph> |
nextSSGs
SSGs that this SSG has edges to. |
protected FlatNode[] |
outputs
|
protected HashMap<SIRFilter,SIRFilter> |
prevs
These Hashmaps map flatnode -> flatnode. |
protected FlatNode |
topLevel
the top level FlatNode Used in debugging from subclasses. |
protected SIRStream |
topLevelSIR
the top level SIR node. |
Constructor Summary | |
---|---|
protected |
StaticStreamGraph()
|
|
StaticStreamGraph(StreamGraph sg,
FlatNode realTop)
create a static stream graph with realTop as the first node that the implicit splitter points to |
Method Summary | |
---|---|
void |
accept(StreamGraphVisitor s,
HashSet<StaticStreamGraph> visited,
boolean newHash)
accept a stream graph visitor * |
void |
addNext(FlatNode node,
FlatNode next)
When constructing this SSG, add a new connection from node->next to the nexts hash map and add the |
void |
addPrev(FlatNode node,
FlatNode source)
When constructing this SSG, add a new connection from node->source to the prevs hash map and add node to the inputs array |
void |
check()
|
void |
createSIRGraph()
Given the current toplevel flatnode, create the SIR graph, also regenerating the flatgraph * |
int |
filterCount()
get the number of filters of this SSG * |
List<FlatNode> |
getFlatNodes()
return a list of the flatnodes of this SSG * |
GraphFlattener |
getGraphFlattener()
return the graph flattener object that was used to flatten. |
int |
getInputNum(FlatNode node)
given an input, source, for this SSG, get the input number, index to inputs[] and inputSSGEdges[] |
CType |
getInputType(FlatNode node)
get the input type for a node of this SSG, we want to use this because we set the input type of the head of this SSG to null, even though it may receive data over the dynamic network |
HashSet<SIRFilter> |
getIOFilters()
get all the SIRFilters that are either sinks or sources of this SSG. |
FlatNode |
getNext(FlatNode flatNode)
given a dynamic sink for this SSG, get the node in the downstream SSG that it connects to |
int |
getOutputNum(FlatNode node)
given an output (sink) for this SSG, get the output number, index to outputs[] and outputSSGEdges[] |
FlatNode[] |
getOutputs()
get the dynamic outputs of this ssg * |
CType |
getOutputType(FlatNode node)
get the output type for |
Map<FlatNode,StaticStreamGraph> |
getParentMap()
returns a map of flatnodes to this SSG, so that others can remember the parent mapping of flat nodes. |
FlatNode |
getPrev(FlatNode flatNode)
give a dynamic source for this SSG, get the node in the upstream SSG that it connects to |
StreamGraph |
getStreamGraph()
get the parent stream graph of SSG * |
FlatNode |
getTopLevel()
get the top level flatnode of this SSG* |
SIRStream |
getTopLevelSIR()
get the toplevel SIR of this SSG * |
boolean |
hasOutput()
does this ssg have dynamic output * |
boolean |
isInput(FlatNode node)
is node a dynamic source for this SSG * |
boolean |
isOutput(FlatNode node)
is node a dynamic sink for this SSG * |
static void |
printCounts(HashMap counts)
|
void |
reconnectOutputs()
connect flatgraph with weight-1 edges to nodes in other ssg's flatgraphs based on this ssg's outputs. |
void |
setTopLevelSIR(SIRStream newTop)
set a new TopLevelSIR stream and flatten it, can only be called before layout! |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected HashMap<SIRFilter,SIRFilter> prevs
protected HashMap<SIRFilter,SIRFilter> nexts
protected List<StaticStreamGraph> nextSSGs
protected FlatNode[] inputs
protected FlatNode[] outputs
protected SIRStream topLevelSIR
protected FlatNode topLevel
protected GraphFlattener graphFlattener
protected LinkedList<FlatNode> flatNodes
public int id
Constructor Detail |
---|
protected StaticStreamGraph()
public StaticStreamGraph(StreamGraph sg, FlatNode realTop)
StreamGraph
- sg: the StreamGraph that the created StaticStreamGraph will be part of.realTop:
- the top node for the StaticStreamGraph (there is an internal fake top node)Method Detail |
---|
public int getOutputNum(FlatNode node)
public int getInputNum(FlatNode node)
public HashSet<SIRFilter> getIOFilters()
public void setTopLevelSIR(SIRStream newTop)
public void createSIRGraph()
public GraphFlattener getGraphFlattener()
public Map<FlatNode,StaticStreamGraph> getParentMap()
public void addPrev(FlatNode node, FlatNode source)
public void addNext(FlatNode node, FlatNode next)
nodeto the outputs array.
public boolean hasOutput()
public boolean isInput(FlatNode node)
public boolean isOutput(FlatNode node)
public FlatNode[] getOutputs()
public FlatNode getNext(FlatNode flatNode)
public FlatNode getPrev(FlatNode flatNode)
public List<FlatNode> getFlatNodes()
public FlatNode getTopLevel()
public SIRStream getTopLevelSIR()
public String toString()
toString
in class Object
public void check()
public static void printCounts(HashMap counts)
public StreamGraph getStreamGraph()
public CType getInputType(FlatNode node)
public CType getOutputType(FlatNode node)
nodeof this SSG *
public int filterCount()
public void accept(StreamGraphVisitor s, HashSet<StaticStreamGraph> visited, boolean newHash)
public void reconnectOutputs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |