at.dms.kjc.cell
Class CellComputeCodeStore

java.lang.Object
  extended by at.dms.kjc.backendSupport.ComputeCodeStore<CellPU>
      extended by at.dms.kjc.cell.CellComputeCodeStore
All Implemented Interfaces:
SIRCodeUnit

public class CellComputeCodeStore
extends ComputeCodeStore<CellPU>


Field Summary
 
Fields inherited from class at.dms.kjc.backendSupport.ComputeCodeStore
cleanupBlock, CODE, fields, initBlock, mainMethod, mainName, methods, myMainName, parent, steadyLoop
 
Constructor Summary
CellComputeCodeStore(CellPU parent)
          Constructors
CellComputeCodeStore(CellPU parent, SliceNode s)
           
 
Method Summary
 void addCallBackFunction()
          Add callback function
 void addDataAddressField()
          Adds data address field for static scheduling case.
 void addDynamicFields()
          Dynamic scheduler specific fields
 void addFileReader(FilterSliceNode filterNode)
           
 void addFileWriter(FilterSliceNode filterNode)
           
 void addFilterLoad(InputSliceNode inputNode)
          Deprecated. 
 void addInitFunctionAddresses(FilterSliceNode filterNode)
          Deprecated. 
 void addInitFunctionAddressField()
          Deprecated. 
 void addInitFunctionCall(JMethodDeclaration init)
          Add the call the init function for a filter as the first statement in "main".
 void addInitFunctions()
           
 void addInputBufferAllocAttach(InputSliceNode inputNode)
          Deprecated. 
 void addIssueGroupAndWait()
          Deprecated. 
 void addIssueUnload()
          Deprecated. 
 void addNewGroupAndFilterUnload(OutputSliceNode outputNode)
          Deprecated. 
 void addNewGroupStatement()
          Deprecated. 
 void addOutputBufferAllocAttach(OutputSliceNode outputNode)
          Deprecated. 
 void addPPUInputBuffers(String inputName)
          Deprecated. 
 void addPPUOutputBuffers(String outputName)
          Deprecated. 
 void addPrintTicks()
          Deprecated. 
 void addSPUInit(SpaceTimeScheduleAndPartitioner schedule)
           
 void addSPUIters()
          Deprecated. 
 JBlock addSpulibPollWhile()
           
 void addStartSpuTicks()
          Deprecated. 
 void addStaticFields()
          Static scheduler specific fields
protected  void addSteadyLoop()
          Add a way of iterating steadyLoop to the main method.
 void addWorkFunctionAddressField()
          Add work function address field, for the actual work function and the work function used for the init schedule LS_ADDRESS wf = wf_[filtername]; LS_ADDRESS init_wf = wf_[filtername];
 void attachInputChannelArray(int filterId, LinkedList<Integer> inputIds, SchedulingPhase whichPhase)
          Initialize an array of input buffers for this slice and attaches each input buffer to the appropriate upstream channel.
 void attachOutputChannelArray(int filterId, LinkedList<Integer> outputIds)
          Initialize an array of output buffers for this slice and attaches each output buffer to the appropriate downstream channel.
 JBlock callExtPSP(SliceNode sliceNode)
          Call ext_ppu_spu_ppu_ex to run the filter asynchronously.
 JBlock callExtPSP(SliceNode sliceNode, int iters)
           
 void duplicateChannel(int channelId, int duplicateId)
          Duplicate channelId to duplicateId
 void duplicateChannel(int channelId, LinkedList<Integer> duplicateIds)
          Duplicate channelId to all the channels in duplicateIds.
 void dynamic()
           
 void dynSetupFilter(FilterSliceNode filterNode, int filternum, int inputs, int outputs, ArrayList<Integer> inputnums, ArrayList<Integer> outputnums)
          Deprecated. 
 SliceNode getSliceNode()
          Miscellaneous functions
static String idToFd(Integer id)
          Deprecated. 
 void initChannel(int channelId)
          Initialize the channel with this ID and allocate the buffer
 void initChannelArrays(FilterSliceNode filterNode, LinkedList<Integer> inputnums, LinkedList<Integer> outputnums)
          Deprecated. 
 void initDuplicateOutputChannelArray(int filterId)
          Deprecated. 
 void initDynamic()
           
 void initFileReader(FilterSliceNode filterNode)
          Adds the appropriate fopen(...) call for the file reader
 void initFileWriter(FilterSliceNode filterNode)
           
 void initOutputBufferFields(InputSliceNode inputNode)
          Deprecated. 
 void initSpulib()
           
 void newline()
          Insert a new line.
 void printStats()
          Add a group to print timing statistics after running is completed.
 JBlock setDone(int done)
           
 void setupDataAddress()
           
 void setupFilter(SliceNode sliceNode)
          Sets up filter's fields: state_size, num_inputs, num_outputs work_func will be either the init work func or the actual work func, depending on which is being run.
 JBlock setupFilterDescriptionWorkFunc(SliceNode sliceNode, SchedulingPhase whichPhase)
          Set the filter description's work func to be the appropriate work func depending on the phase (init or steady)
 void setupInputBufferAddress()
          Add fields for SPU input buffers, and set up their addresses.
 void setupOutputBufferAddress()
           
 void setupPSP(SliceNode sliceNode)
          Sets up most of the parameters for ext_psp, except for pop/peek_extra/push_bytes, which differ depending on INIT/STEADY stage
 JBlock setupPSPIOBytes(SliceNode sliceNode, SchedulingPhase whichPhase)
          Set up the [pop/peek_extra/push]_bytes for the PSP params.
 JBlock setupPSPNumIOputs(SliceNode sliceNode, SchedulingPhase whichPhase)
           
 JBlock setupPSPSpuId(SliceNode sliceNode, int spuId)
          Get the ID of the SPU that the filter has been assigned to, and set the spu_id parameter in ext_psp_layout.
 void setupWorkFunctionAddress(SliceNode sliceNode)
          Assigns work function address for the given slicenode.
 void startNewFilter(InputSliceNode inputNode)
          Deprecated. 
 
Methods inherited from class at.dms.kjc.backendSupport.ComputeCodeStore
addCleanupStatement, addField, addFields, addInitStatement, addInitStatementFirst, addMethod, addMethods, addSteadyLoop, addSteadyLoopStatement, getFields, getMainFunction, getMethods, getMyMainName, hasMethod, setFields, setMethods, setMyMainName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellComputeCodeStore

public CellComputeCodeStore(CellPU parent)
Constructors


CellComputeCodeStore

public CellComputeCodeStore(CellPU parent,
                            SliceNode s)
Method Detail

addWorkFunctionAddressField

public void addWorkFunctionAddressField()
Add work function address field, for the actual work function and the work function used for the init schedule LS_ADDRESS wf = wf_[filtername]; LS_ADDRESS init_wf = wf_[filtername];


addStaticFields

public void addStaticFields()
Static scheduler specific fields


addDataAddressField

public void addDataAddressField()
Adds data address field for static scheduling case. SPU_ADDRESS da;


addDynamicFields

public void addDynamicFields()
Dynamic scheduler specific fields


initDynamic

public void initDynamic()

dynamic

public void dynamic()

initChannel

public void initChannel(int channelId)
Initialize the channel with this ID and allocate the buffer

Parameters:
channelId -

setupFilter

public void setupFilter(SliceNode sliceNode)
Sets up filter's fields: state_size, num_inputs, num_outputs work_func will be either the init work func or the actual work func, depending on which is being run. Thus, work_func will be set later.

Parameters:
sliceNode -

setupFilterDescriptionWorkFunc

public JBlock setupFilterDescriptionWorkFunc(SliceNode sliceNode,
                                             SchedulingPhase whichPhase)
Set the filter description's work func to be the appropriate work func depending on the phase (init or steady)

Parameters:
sliceNode -
whichPhase -
Returns:
TODO

setupPSPNumIOputs

public JBlock setupPSPNumIOputs(SliceNode sliceNode,
                                SchedulingPhase whichPhase)

setupWorkFunctionAddress

public void setupWorkFunctionAddress(SliceNode sliceNode)
Assigns work function address for the given slicenode. Also assigns work function address for init function of the given slicenode. RR splitters and joiners are made into separate filters with their own work functions, and thus need to be initialized here. wf = &wf_[init_][slicename] wf = &wf_[init_]joiner_[joinername] wf = &wf_[init_]splitter_[splittername]

Parameters:
sliceNode -

setupPSP

public void setupPSP(SliceNode sliceNode)
Sets up most of the parameters for ext_psp, except for pop/peek_extra/push_bytes, which differ depending on INIT/STEADY stage

Parameters:
sliceNode -

setupPSPIOBytes

public JBlock setupPSPIOBytes(SliceNode sliceNode,
                              SchedulingPhase whichPhase)
Set up the [pop/peek_extra/push]_bytes for the PSP params. These values may differ between the init and steady states due to different multiplicities.

Parameters:
sliceNode -
whichPhase -
Returns:
TODO

setupPSPSpuId

public JBlock setupPSPSpuId(SliceNode sliceNode,
                            int spuId)
Get the ID of the SPU that the filter has been assigned to, and set the spu_id parameter in ext_psp_layout.

Parameters:
sliceNode -
spuId -
Returns:
TODO

callExtPSP

public JBlock callExtPSP(SliceNode sliceNode)
Call ext_ppu_spu_ppu_ex to run the filter asynchronously.

Parameters:
sliceNode -
Returns:
TODO

callExtPSP

public JBlock callExtPSP(SliceNode sliceNode,
                         int iters)

setDone

public JBlock setDone(int done)

addSpulibPollWhile

public JBlock addSpulibPollWhile()

duplicateChannel

public void duplicateChannel(int channelId,
                             LinkedList<Integer> duplicateIds)
Duplicate channelId to all the channels in duplicateIds.

Parameters:
channelId -
duplicateIds -

duplicateChannel

public void duplicateChannel(int channelId,
                             int duplicateId)
Duplicate channelId to duplicateId

Parameters:
channelId -
duplicateId -

addSPUInit

public void addSPUInit(SpaceTimeScheduleAndPartitioner schedule)

initSpulib

public void initSpulib()

setupInputBufferAddress

public void setupInputBufferAddress()
Add fields for SPU input buffers, and set up their addresses.

Parameters:
inputNode -

setupOutputBufferAddress

public void setupOutputBufferAddress()

addSPUIters

@Deprecated
public void addSPUIters()
Deprecated. 


attachInputChannelArray

public void attachInputChannelArray(int filterId,
                                    LinkedList<Integer> inputIds,
                                    SchedulingPhase whichPhase)
Initialize an array of input buffers for this slice and attaches each input buffer to the appropriate upstream channel.

Parameters:
filterId -
inputIds -

attachOutputChannelArray

public void attachOutputChannelArray(int filterId,
                                     LinkedList<Integer> outputIds)
Initialize an array of output buffers for this slice and attaches each output buffer to the appropriate downstream channel.

Parameters:
filterId -
outputIds -

setupDataAddress

public void setupDataAddress()

initFileReader

public void initFileReader(FilterSliceNode filterNode)
Adds the appropriate fopen(...) call for the file reader

Parameters:
filterNode -

addFileReader

public void addFileReader(FilterSliceNode filterNode)

initFileWriter

public void initFileWriter(FilterSliceNode filterNode)

addFileWriter

public void addFileWriter(FilterSliceNode filterNode)

getSliceNode

public SliceNode getSliceNode()
Miscellaneous functions


addSteadyLoop

protected void addSteadyLoop()
Description copied from class: ComputeCodeStore
Add a way of iterating steadyLoop to the main method. If you do not want the steady state to loop infinitely then you should override this method.

Overrides:
addSteadyLoop in class ComputeCodeStore<CellPU>

addInitFunctionCall

public void addInitFunctionCall(JMethodDeclaration init)
Description copied from class: ComputeCodeStore
Add the call the init function for a filter as the first statement in "main".

Overrides:
addInitFunctionCall in class ComputeCodeStore<CellPU>
Parameters:
init - the init function, a call to it will be added.

addInitFunctions

public void addInitFunctions()

printStats

public void printStats()
Add a group to print timing statistics after running is completed.


addCallBackFunction

public void addCallBackFunction()
Add callback function


newline

public void newline()
Insert a new line.


startNewFilter

@Deprecated
public void startNewFilter(InputSliceNode inputNode)
Deprecated. 


addNewGroupStatement

@Deprecated
public void addNewGroupStatement()
Deprecated. 


addNewGroupAndFilterUnload

@Deprecated
public void addNewGroupAndFilterUnload(OutputSliceNode outputNode)
Deprecated. 


addInputBufferAllocAttach

@Deprecated
public void addInputBufferAllocAttach(InputSliceNode inputNode)
Deprecated. 


addOutputBufferAllocAttach

@Deprecated
public void addOutputBufferAllocAttach(OutputSliceNode outputNode)
Deprecated. 


addIssueGroupAndWait

@Deprecated
public void addIssueGroupAndWait()
Deprecated. 


idToFd

@Deprecated
public static String idToFd(Integer id)
Deprecated. 


addFilterLoad

@Deprecated
public void addFilterLoad(InputSliceNode inputNode)
Deprecated. 


addInitFunctionAddressField

@Deprecated
public void addInitFunctionAddressField()
Deprecated. 

Add init function address field: LS_ADDRESS init_[i];


addInitFunctionAddresses

@Deprecated
public void addInitFunctionAddresses(FilterSliceNode filterNode)
Deprecated. 


addIssueUnload

@Deprecated
public void addIssueUnload()
Deprecated. 


addStartSpuTicks

@Deprecated
public void addStartSpuTicks()
Deprecated. 


addPrintTicks

@Deprecated
public void addPrintTicks()
Deprecated. 


initDuplicateOutputChannelArray

@Deprecated
public void initDuplicateOutputChannelArray(int filterId)
Deprecated. 


initChannelArrays

@Deprecated
public void initChannelArrays(FilterSliceNode filterNode,
                                         LinkedList<Integer> inputnums,
                                         LinkedList<Integer> outputnums)
Deprecated. 


addPPUInputBuffers

@Deprecated
public void addPPUInputBuffers(String inputName)
Deprecated. 


addPPUOutputBuffers

@Deprecated
public void addPPUOutputBuffers(String outputName)
Deprecated. 


initOutputBufferFields

@Deprecated
public void initOutputBufferFields(InputSliceNode inputNode)
Deprecated. 


dynSetupFilter

@Deprecated
public void dynSetupFilter(FilterSliceNode filterNode,
                                      int filternum,
                                      int inputs,
                                      int outputs,
                                      ArrayList<Integer> inputnums,
                                      ArrayList<Integer> outputnums)
Deprecated.