at.dms.kjc.backendSupport
Class BackEndScaffold

java.lang.Object
  extended by at.dms.kjc.backendSupport.BackEndScaffold
Direct Known Subclasses:
CellBackendScaffold

public class BackEndScaffold
extends Object

Create code for a partitioning of Slices on a collection of ComputeNodes. Connections between the ComputeNode s are returned as Buffers.

Author:
dimock

Field Summary
protected  BackEndFactory resources
          used to pass back-end factory around
 
Constructor Summary
BackEndScaffold()
           
 
Method Summary
protected  void afterScheduling(BasicSpaceTimeSchedule schedule, BackEndFactory resources)
          Use in subclasses to perform work after code is created for all schedules.
protected  void beforeScheduling(BasicSpaceTimeSchedule schedule, BackEndFactory resources)
          Use in subclasses to perform work before code is created.
protected  void betweenScheduling(BasicSpaceTimeSchedule schedule, BackEndFactory resources)
           
protected  boolean doNotCreateJoiner(InputSliceNode input)
          Use in subclass to indicate that no code needs to be created for this joiner.
protected  void iterateInorder(Slice[] slices, SchedulingPhase whichPhase, ComputeNodesI computeNodes)
          Iterate over the schedule of slices and over each node of each slice and generate the code necessary to fire the schedule.
 void run(BasicSpaceTimeSchedule schedule, BackEndFactory resources)
          Pass in a schedule, and get a set of ComputeNodes and a set of (underspecified) Buffers filled in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resources

protected BackEndFactory resources
used to pass back-end factory around

Constructor Detail

BackEndScaffold

public BackEndScaffold()
Method Detail

beforeScheduling

protected void beforeScheduling(BasicSpaceTimeSchedule schedule,
                                BackEndFactory resources)
Use in subclasses to perform work before code is created. Only needed if subclassing and need to share data generated in beforeScheduling code. for any schedule.

Parameters:
schedule -
resources - the BackEndFactory used to redirect to correct code generation routines.

betweenScheduling

protected void betweenScheduling(BasicSpaceTimeSchedule schedule,
                                 BackEndFactory resources)

afterScheduling

protected void afterScheduling(BasicSpaceTimeSchedule schedule,
                               BackEndFactory resources)
Use in subclasses to perform work after code is created for all schedules. Only needed if subclassing and need to share data generated beforeScheduling or schedule code.

Parameters:
schedule -
resources -

doNotCreateJoiner

protected boolean doNotCreateJoiner(InputSliceNode input)
Use in subclass to indicate that no code needs to be created for this joiner. Called in case of no software pipelining to determine if no code should be created for this joiner, but it is allowable to create code for the following filter(s) in the slice. Not called if software pipelining.
Historic leftover from RAW specetime schedule, which ignored file inputs (which came from off-chip).

Parameters:
input - InputSliceNode to consider for to a joiner.
Returns:

run

public void run(BasicSpaceTimeSchedule schedule,
                BackEndFactory resources)
Pass in a schedule, and get a set of ComputeNodes and a set of (underspecified) Buffers filled in.

Parameters:
schedule -
computeNodes -
resources - The instance of BackEndFactory to be used for callbacks, data.

iterateInorder

protected void iterateInorder(Slice[] slices,
                              SchedulingPhase whichPhase,
                              ComputeNodesI computeNodes)
Iterate over the schedule of slices and over each node of each slice and generate the code necessary to fire the schedule. Generate splitters and joiners intermixed with the trace execution...

Parameters:
slices - The schedule to execute.
whichPhase - True if the init stage.
computeNodes - The collection of compute nodes.