at.dms.kjc.spacetime
Class OffChipBuffer

java.lang.Object
  extended by at.dms.kjc.backendSupport.Channel
      extended by at.dms.kjc.spacetime.OffChipBuffer
Direct Known Subclasses:
InterSliceBuffer, IntraSliceBuffer

public abstract class OffChipBuffer
extends Channel

This abstract class represents a buffer in the partitioner slice graph. A buffer appears between slices and inside slices between the input node and the first filter and between the last filter and the output node. Now derived from Buffer. Assumes all buffers are actuall OffChipBuffers.

Author:
mgordon

Field Summary
protected  StreamingDram dram
          the dram that we are reading/writing
protected  ComputeNode owner
          The sending or receiving tile
protected  Address sizeSteady
          the size of the buffer in the steady stage
 
Fields inherited from class at.dms.kjc.backendSupport.Channel
bufferStore, extraCount, ident, rotationLength, theEdge, unique_id
 
Constructor Summary
protected OffChipBuffer(Edge edge)
           
protected OffChipBuffer(SliceNode src, SliceNode dst)
           
 
Method Summary
static boolean areAllAssigned()
           
protected abstract  void calculateSize()
           
 StreamingDram getDRAM()
          Return the dram assignment of this buffer.
 String getIdent()
          return the prefix buffer name for this buffer
 String getIdent(boolean read)
           
 String getIdent(int i)
           
abstract  OffChipBuffer getNonRedundant()
          if this buffer is redundant return the first upstream buffer that is not redundant, return null if this is a input->filter buffer with no input or a filter->output buffer with no output
 RawTile getOwner()
          return the owner tile of the dram this buffer is assigned to, this is set in the static section of this class.
 int getRotationLength()
           
 Address getSize()
           
 boolean isAssigned()
           
 boolean isInterSlice()
           
 boolean isIntraSlice()
           
abstract  boolean redundant()
           
static void resetDRAMAssignment()
          Reset all the dram assignments of the buffers to null.
 void setDRAM(StreamingDram DRAM)
           
static void setRotationLengths(BasicSpaceTimeSchedule spaceTime)
          Iterate over all the buffers and set the rotation length of each buffer based on the prime pump schedule and the multiplicity difference between the source node and the dest node.
 String toString()
           
static Address totalBufferSizeInBytes()
          Return the total number of bytes used by the offchip buffers.
static boolean unnecessary(InputSliceNode input)
           
static boolean unnecessary(OutputSliceNode output)
           
 void unsetDRAM()
          Remove the dram assignment of this buffer.
 
Methods inherited from class at.dms.kjc.backendSupport.Channel
addChannel, assignFromPeekMethod, assignFromPeekMethodName, assignFromPopMethod, assignFromPopMethodName, beginInitRead, beginInitWrite, beginSteadyRead, beginSteadyWrite, dataDecls, dataDeclsH, endInitRead, endInitWrite, endSteadyRead, endSteadyWrite, findChannel, getBuffers, getDest, getExtraCount, getSource, getType, peekMethod, peekMethodName, popManyMethod, popManyMethodName, popMethod, popMethodName, postPreworkInitRead, printBuffers, pushMethod, pushMethodName, readDecls, readDeclsExtern, reset, setExtralength, topOfWorkSteadyRead, topOfWorkSteadyWrite, writeDecls, writeDeclsExtern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

owner

protected ComputeNode owner
The sending or receiving tile


sizeSteady

protected Address sizeSteady
the size of the buffer in the steady stage


dram

protected StreamingDram dram
the dram that we are reading/writing

Constructor Detail

OffChipBuffer

protected OffChipBuffer(SliceNode src,
                        SliceNode dst)

OffChipBuffer

protected OffChipBuffer(Edge edge)
Method Detail

redundant

public abstract boolean redundant()

getNonRedundant

public abstract OffChipBuffer getNonRedundant()
if this buffer is redundant return the first upstream buffer that is not redundant, return null if this is a input->filter buffer with no input or a filter->output buffer with no output


unnecessary

public static boolean unnecessary(InputSliceNode input)

unnecessary

public static boolean unnecessary(OutputSliceNode output)

setDRAM

public void setDRAM(StreamingDram DRAM)

isAssigned

public boolean isAssigned()
Returns:
true if we have assigned a dram to this buffer.

unsetDRAM

public void unsetDRAM()
Remove the dram assignment of this buffer.


getDRAM

public StreamingDram getDRAM()
Return the dram assignment of this buffer.

Returns:
the dram assignment of this buffer.

getIdent

public String getIdent(int i)
Parameters:
i -
Returns:
The string for the rotation structure for
node

getIdent

public String getIdent(boolean read)
Parameters:
read -
Returns:
return the rotating buffer structure name that is used for either reading or writing. Reading and writing have separate rotation structures.

getIdent

public String getIdent()
return the prefix buffer name for this buffer

Overrides:
getIdent in class Channel

resetDRAMAssignment

public static void resetDRAMAssignment()
Reset all the dram assignments of the buffers to null.


getSize

public Address getSize()

getRotationLength

public int getRotationLength()

calculateSize

protected abstract void calculateSize()

getOwner

public RawTile getOwner()
return the owner tile of the dram this buffer is assigned to, this is set in the static section of this class.


toString

public String toString()
Overrides:
toString in class Object

isIntraSlice

public boolean isIntraSlice()

isInterSlice

public boolean isInterSlice()

setRotationLengths

public static void setRotationLengths(BasicSpaceTimeSchedule spaceTime)
Iterate over all the buffers and set the rotation length of each buffer based on the prime pump schedule and the multiplicity difference between the source node and the dest node. This method also counts the number of intertracebuffers that are assigned to each dram and stores it in the dramToBuffer's hashmap in intertracebuffer.

Parameters:
spaceTime - The BasicSpaceTimeSchedule

areAllAssigned

public static boolean areAllAssigned()
Returns:
True if all of the buffers of this program are assigned to drams.

totalBufferSizeInBytes

public static Address totalBufferSizeInBytes()
Return the total number of bytes used by the offchip buffers.

Returns:
the total number of bytes used by the offchip buffers.