at.dms.kjc.cluster
Class TapeFixedCircular

java.lang.Object
  extended by at.dms.kjc.cluster.TapeBase
      extended by at.dms.kjc.cluster.TapeFixedBase
          extended by at.dms.kjc.cluster.TapeFixedCircular
All Implemented Interfaces:
Tape

public class TapeFixedCircular
extends TapeFixedBase
implements Tape

Author:
dimock

Field Summary
protected  String maskName
           
 
Fields inherited from class at.dms.kjc.cluster.TapeFixedBase
bufferName, extra, headName, items, popArrayRefPrefix, popArrayRefSuffix, tailName
 
Fields inherited from class at.dms.kjc.cluster.TapeBase
dst, peek_name, pop_name, push_name, src, type, typeString
 
Constructor Summary
TapeFixedCircular(int source, int dest, CType type)
           
 
Method Summary
 String dataDeclaration()
          Data declaration: in .c file if needed else noop.
 String dataDeclarationH()
          Data declaration: in .h file if needed else noop.
protected  String headIncrementStmts()
           
 String peekPrefix()
          prefix to peek expression
 String peekSuffix()
          suffix to peek expression
 String popExpr()
          expression to pop an item: to end of statement.
 String popExprCleanup()
          if expression to pop an item requires statements to clean up then this is cleanup.
 String popExprNoCleanup()
          expression to pop an item, really an expression.
 String popNStmt(int N)
          prefix to pop N items discarding them.
 String pushPrefix()
          prefix before data expression to push.
 String pushSuffix()
          suffix after data expression to push.
protected  String tailIncrementStmts()
           
protected  String tailIncrementStmts(String numExpression)
           
protected  String tailOffsetExpr(String offset)
           
 String topOfWorkIteration()
          Code to emit at top of work iteration.
 
Methods inherited from class at.dms.kjc.cluster.TapeFixedBase
assignPeekToVar, assignPopToVar, downstreamCleanup, downstreamDeclaration, downstreamDeclarationExtern, getBufferName, getExtra, getHeadName, getItems, getTailName, pushbackCleanup, pushbackInit, pushbackPrefix, pushbackSuffix, upstreamCleanup, upstreamDeclaration, upstreamDeclarationExtern
 
Methods inherited from class at.dms.kjc.cluster.TapeBase
getDest, getPeekName, getPopName, getPushName, getSource, getType, newTape, popManyItems, pushManyItems
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface at.dms.kjc.cluster.Tape
assignPeekToVar, assignPopToVar, downstreamCleanup, downstreamDeclaration, downstreamDeclarationExtern, getDest, getPeekName, getPopName, getPushName, getSource, getType, popManyItems, pushbackCleanup, pushbackInit, pushbackPrefix, pushbackSuffix, pushManyItems, upstreamCleanup, upstreamDeclaration, upstreamDeclarationExtern
 

Field Detail

maskName

protected String maskName
Constructor Detail

TapeFixedCircular

public TapeFixedCircular(int source,
                         int dest,
                         CType type)
Parameters:
source -
dest -
type -
Method Detail

tailOffsetExpr

protected String tailOffsetExpr(String offset)
Specified by:
tailOffsetExpr in class TapeFixedBase
Returns:
string for expression for *offset* items from pop position on tape.

tailIncrementStmts

protected String tailIncrementStmts(String numExpression)
Specified by:
tailIncrementStmts in class TapeFixedBase
Returns:
string for statements that increment the pop position by *numPosition* items.

tailIncrementStmts

protected String tailIncrementStmts()
Specified by:
tailIncrementStmts in class TapeFixedBase
Returns:
string for statement(s) that increment the pop position by 1.

headIncrementStmts

protected String headIncrementStmts()
Specified by:
headIncrementStmts in class TapeFixedBase
Returns:
string for statement(s) that increment the push position by 1.

dataDeclarationH

public String dataDeclarationH()
Description copied from interface: Tape
Data declaration: in .h file if needed else noop.

Specified by:
dataDeclarationH in interface Tape
Specified by:
dataDeclarationH in class TapeBase
Returns:
TODO

dataDeclaration

public String dataDeclaration()
Description copied from interface: Tape
Data declaration: in .c file if needed else noop.

Specified by:
dataDeclaration in interface Tape
Specified by:
dataDeclaration in class TapeBase
Returns:
TODO

topOfWorkIteration

public String topOfWorkIteration()
Code to emit at top of work iteration.
None for circular buffer.

Specified by:
topOfWorkIteration in interface Tape
Specified by:
topOfWorkIteration in class TapeBase
Returns:
TODO
See Also:
at.dms.kjc.cluster.Tape#topOfWorkIteration(at.dms.kjc.common.CodegenPrintWriter)

pushPrefix

public String pushPrefix()
Description copied from interface: Tape
prefix before data expression to push.

Specified by:
pushPrefix in interface Tape
Specified by:
pushPrefix in class TapeBase
Returns:
TODO

pushSuffix

public String pushSuffix()
Description copied from interface: Tape
suffix after data expression to push.

Specified by:
pushSuffix in interface Tape
Specified by:
pushSuffix in class TapeBase
Returns:
TODO

popExpr

public String popExpr()
Description copied from interface: Tape
expression to pop an item: to end of statement.

Specified by:
popExpr in interface Tape
Specified by:
popExpr in class TapeBase
Returns:
TODO

popExprNoCleanup

public String popExprNoCleanup()
Description copied from interface: Tape
expression to pop an item, really an expression.

Specified by:
popExprNoCleanup in interface Tape
Specified by:
popExprNoCleanup in class TapeBase

popExprCleanup

public String popExprCleanup()
Description copied from interface: Tape
if expression to pop an item requires statements to clean up then this is cleanup.

Specified by:
popExprCleanup in interface Tape
Specified by:
popExprCleanup in class TapeBase

popNStmt

public String popNStmt(int N)
Description copied from interface: Tape
prefix to pop N items discarding them.

Specified by:
popNStmt in interface Tape
Specified by:
popNStmt in class TapeBase
Returns:
TODO

peekPrefix

public String peekPrefix()
Description copied from interface: Tape
prefix to peek expression

Specified by:
peekPrefix in interface Tape
Specified by:
peekPrefix in class TapeBase
Returns:
TODO

peekSuffix

public String peekSuffix()
Description copied from interface: Tape
suffix to peek expression

Specified by:
peekSuffix in interface Tape
Specified by:
peekSuffix in class TapeBase
Returns:
TODO