at.dms.kjc.rstream
Class SplitterFusionState

java.lang.Object
  extended by at.dms.kjc.rstream.FusionState
      extended by at.dms.kjc.rstream.SplitterFusionState

public class SplitterFusionState
extends FusionState

This class represent the state and conversion necessary to convert a splitter FlatNode into imperative SIR code so it can be added to the application's SIR code. For duplicate splitters, we just create a loop that will copy items from the incoming buffer to each outgoing buffer. For round-robin splitters we create an outer loop that contains assignments from the incoming buffer to the outgoing buffer in order and frequency given by the round-robin weights

Author:
Michael Gordon

Field Summary
static String DUPLICATECOUNTER
           
static String RRCOUNTER
           
static String RRINNERVAR
           
 
Fields inherited from class at.dms.kjc.rstream.FusionState
BACKUPCOUNTER, BUFFERNAME, bufferVar, fusionState, myUniqueID, necessary, node, remaining
 
Constructor Summary
protected SplitterFusionState(FlatNode node)
           
 
Method Summary
 int getBufferSize(FlatNode prev, boolean init)
          return the outgoing buffersize
 JVariableDefinition getBufferVar(FlatNode prev, boolean init)
          return the outgoing buffer var for this splitter
 int getRemaining(FlatNode prev, boolean isInit)
          return the items remaining on the incoming buffer after the init stage
 JStatement[] getWork(JBlock enclosingBlock, boolean isInit)
          Return the block containing imperative SIR code that will perform the splitting of the incoming buffer.
 void initTasks(Vector<JFieldDeclaration> fields, Vector<JMethodDeclaration> functions, JBlock initFunctionCalls, JBlock main)
          perform any initialization tasks, including setting the downstream buffers to be this splitter's incoming buffer if this splitter is unnecessary (thereby bypassing it) and declaring the incoming buffer
 
Methods inherited from class at.dms.kjc.rstream.FusionState
getFusionState, getNode, intAssignStm, isNecesary, makeBuffer, remainingBackupLoop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DUPLICATECOUNTER

public static String DUPLICATECOUNTER

RRCOUNTER

public static String RRCOUNTER

RRINNERVAR

public static String RRINNERVAR
Constructor Detail

SplitterFusionState

protected SplitterFusionState(FlatNode node)
Method Detail

initTasks

public void initTasks(Vector<JFieldDeclaration> fields,
                      Vector<JMethodDeclaration> functions,
                      JBlock initFunctionCalls,
                      JBlock main)
perform any initialization tasks, including setting the downstream buffers to be this splitter's incoming buffer if this splitter is unnecessary (thereby bypassing it) and declaring the incoming buffer

Specified by:
initTasks in class FusionState

getWork

public JStatement[] getWork(JBlock enclosingBlock,
                            boolean isInit)
Return the block containing imperative SIR code that will perform the splitting of the incoming buffer. For duplicate splitters, we just create a loop that will copy items from the incoming buffer to each outgoing buffer. For round-robin splitters we create an outer loop that contains assignments from the incoming buffer to the outgoing buffer in order and frequency given by the round-robin weights

Specified by:
getWork in class FusionState

getBufferSize

public int getBufferSize(FlatNode prev,
                         boolean init)
return the outgoing buffersize

Specified by:
getBufferSize in class FusionState

getBufferVar

public JVariableDefinition getBufferVar(FlatNode prev,
                                        boolean init)
return the outgoing buffer var for this splitter

Specified by:
getBufferVar in class FusionState

getRemaining

public int getRemaining(FlatNode prev,
                        boolean isInit)
return the items remaining on the incoming buffer after the init stage

Specified by:
getRemaining in class FusionState