at.dms.kjc.spacetime
Class RawBackEndFactory

java.lang.Object
  extended by at.dms.kjc.backendSupport.BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
      extended by at.dms.kjc.spacetime.RawBackEndFactory

public class RawBackEndFactory
extends BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>

Factor out parts of RAW (at.dms.kjc.spacetime) back end that need matching types.

Author:
dimock
See Also:
BackEndFactory, BackEndAbsFactory

Constructor Summary
RawBackEndFactory()
           
RawBackEndFactory(RawChip rawChip, Layout<RawTile> layout)
           
 
Method Summary
 BackEndScaffold getBackEndMain()
          The converter from a Schedule to ComputeNode's with completed ComputeCodeStore's and Buffer's.
 Channel getChannel(Edge e)
          Back end needs to generate subclasses of channel.
 Channel getChannel(SliceNode src, SliceNode dst)
          Back end needs to generate subclasses of channel.
 CodeStoreHelper getCodeStoreHelper(SliceNode node)
          Eventually make RawExecutionCode a subclass of CodeStoreHelper, but unused for now.
 RawComputeCodeStore getComputeCodeStore(RawTile parent)
           
 RawTile getComputeNode(int[] xy)
          Get a specified compute node.
 RawChip getComputeNodes()
           
 Layout<RawTile> getLayout()
          Get saved copy of Layout.
 void processFilterSliceNode(FilterSliceNode filter, SchedulingPhase whichPhase, RawChip rawChip)
          Process a filter slice node: find the correct ProcElement(s) and add code and buffers.
 void processFilterSlices(Slice slice, SchedulingPhase whichPhase, RawChip rawChip)
          Process all filter slice nodes in a Slice (just one in a SimpleSlice): find the correct ProcElement(s) and add filter code.
 void processInputSliceNode(InputSliceNode input, SchedulingPhase whichPhase, RawChip rawChip)
          Process an input slice node: find the correct ProcElement(s) and add joiner code, and buffers.
 void processOutputSliceNode(OutputSliceNode output, SchedulingPhase whichPhase, RawChip rawChip)
          Process an output slice node: find the correct ProcElement(s) and add splitter code and buffers.
 void setLayout(Layout<RawTile> layout)
          Keep a copy of the Layout: the mapping from SliceNode to ComputeNode.
 
Methods inherited from class at.dms.kjc.backendSupport.BackEndFactory
getChannels, sliceHasDownstreamChannel, sliceHasUpstreamChannel, sliceNeedsJoinerCode, sliceNeedsJoinerWorkFunction, sliceNeedsPeekBuffer, sliceNeedsPokeBuffer, sliceNeedsSplitterCode, sliceNeedsSplitterWorkFunction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawBackEndFactory

public RawBackEndFactory()

RawBackEndFactory

public RawBackEndFactory(RawChip rawChip,
                         Layout<RawTile> layout)
Method Detail

getBackEndMain

public BackEndScaffold getBackEndMain()
The converter from a Schedule to ComputeNode's with completed ComputeCodeStore's and Buffer's.

Specified by:
getBackEndMain in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Returns:
Singleton to generate Channels and ComputeCodeStores for the ComputeNodes.
See Also:
Rawify

processInputSliceNode

public void processInputSliceNode(InputSliceNode input,
                                  SchedulingPhase whichPhase,
                                  RawChip rawChip)
Process an input slice node: find the correct ProcElement(s) and add joiner code, and buffers. please delegate work to some other object.

Specified by:
processInputSliceNode in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Parameters:
input - the InputSliceNode
whichPhase - INIT / PRIMEPUMP / STEADY
rawChip - the available compute nodes.

processFilterSlices

public void processFilterSlices(Slice slice,
                                SchedulingPhase whichPhase,
                                RawChip rawChip)
Process all filter slice nodes in a Slice (just one in a SimpleSlice): find the correct ProcElement(s) and add filter code. please delegate work to some other object.

Specified by:
processFilterSlices in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Parameters:
slice - Slice containing filters
whichPhase - INIT / PRIMEPUMP / STEADY
computeNodes - the available compute nodes.

processFilterSliceNode

public void processFilterSliceNode(FilterSliceNode filter,
                                   SchedulingPhase whichPhase,
                                   RawChip rawChip)
Process a filter slice node: find the correct ProcElement(s) and add code and buffers. please delegate work to some other object.

Specified by:
processFilterSliceNode in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Parameters:
filter - the FilterSliceNode.
whichPhase - INIT / PRIMEPUMP / STEADY
computeNodes - the available compute nodes.

processOutputSliceNode

public void processOutputSliceNode(OutputSliceNode output,
                                   SchedulingPhase whichPhase,
                                   RawChip rawChip)
Process an output slice node: find the correct ProcElement(s) and add splitter code and buffers. please delegate work to some other object.

Specified by:
processOutputSliceNode in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Parameters:
output - the OutputSliceNode.
whichPhase - INIT / PRIMEPUMP / STEADY
computeNodes - the available compute nodes.

getComputeNodes

public RawChip getComputeNodes()
Specified by:
getComputeNodes in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Returns:
Get the (unique) collection of nodes involved in computation.
See Also:
RawChip

getComputeNode

public RawTile getComputeNode(int[] xy)
Description copied from class: BackEndFactory
Get a specified compute node. Assumes that BackEndFactory.getComputeNodes() returns a collection of ComputeNode including the desired node.

Specified by:
getComputeNode in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Parameters:
xy - Different instantiations will have different number of arguments to specify which node, so a specifier (String, int, array[int]...) here.
Returns:
a (unique per specifier) ComputeNode
See Also:
RawTile

getComputeCodeStore

public RawComputeCodeStore getComputeCodeStore(RawTile parent)
Specified by:
getComputeCodeStore in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Returns:
A (unique per parent) ComputeCodeStore.
See Also:
RawComputeCodeStore

setLayout

public void setLayout(Layout<RawTile> layout)
Keep a copy of the Layout: the mapping from SliceNode to ComputeNode.

Overrides:
setLayout in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Parameters:
layout -

getLayout

public Layout<RawTile> getLayout()
Get saved copy of Layout.

Overrides:
getLayout in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Returns:

getChannel

public Channel getChannel(Edge e)
Description copied from class: BackEndFactory
Back end needs to generate subclasses of channel. Routine here to get a channel that implements communication over an edge.

Specified by:
getChannel in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Parameters:
e - the edge.
Returns:
a channel: preexisting or newly created.

getChannel

public Channel getChannel(SliceNode src,
                          SliceNode dst)
Description copied from class: BackEndFactory
Back end needs to generate subclasses of channel. Routine here to get a channel from a source to a destination.

Specified by:
getChannel in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Returns:
a channel: preexisting or newly created.

getCodeStoreHelper

public CodeStoreHelper getCodeStoreHelper(SliceNode node)
Eventually make RawExecutionCode a subclass of CodeStoreHelper, but unused for now.

Specified by:
getCodeStoreHelper in class BackEndFactory<RawChip,RawTile,RawComputeCodeStore,int[]>
Parameters:
node - the SliceNode.
Returns:
an instance of CodeStoreHelper