|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.codegen.kernel.CodeGeneratorHelper
ptolemy.codegen.actor.Director
ptolemy.codegen.java.actor.sched.StaticSchedulingDirector
ptolemy.codegen.java.domains.sdf.kernel.SDFDirector
public class SDFDirector
Code generator helper associated with the SDFDirector class. This class is also associated with a code generator.
Red (eal) |
Yellow (zgang) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.codegen.kernel.CodeGeneratorHelper |
---|
CodeGeneratorHelper.Channel, CodeGeneratorHelper.VariableScope |
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
private int |
_portNumber
|
Fields inherited from class ptolemy.codegen.actor.Director |
---|
_director, _eol, _INDENT1, _INDENT2, _INDENT3, _INDENT4 |
Fields inherited from class ptolemy.codegen.kernel.CodeGeneratorHelper |
---|
_codeGenerator, _codeStream, _parseTreeCodeGenerator, _portConversions, _referencedParameters |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Constructor Summary | |
---|---|
SDFDirector(SDFDirector sdfDirector)
Construct the code generator helper associated with the given SDFDirector. |
Method Summary | |
---|---|
protected java.lang.String |
_createDynamicOffsetVariables(IOPort port)
Create offset variables for the channels of the given port. |
protected java.lang.String |
_createOffsetVariablesIfNeeded()
Check to see if variables are needed to represent read and write offsets for the ports in the director's container. |
protected java.lang.String |
_createOffsetVariablesIfNeeded(IOPort port,
int channelNumber,
int readTokens,
int writeTokens)
Check for the given channel of the given port to see if variables are needed for recording read offset and write offset. |
private int |
_padBuffer(IOPort port,
int channelNumber)
Pad the buffer for the channel of the given port with the given channel number to a power of two. |
protected void |
_updatePortBufferSize()
Check to see if the buffer size for the current schedule is greater than the previous size. |
java.lang.String |
createOffsetVariablesIfNeeded()
Generate code for declaring read and write offset variables if needed. |
java.lang.String |
generateInitializeCode()
Generate the initialize code for the associated SDF director. |
java.lang.String |
generatePreinitializeCode()
Generate the preinitialize code for this director. |
void |
generateTransferInputsCode(IOPort inputPort,
java.lang.StringBuffer code)
Generate code for transferring enough tokens to complete an internal iteration. |
void |
generateTransferOutputsCode(IOPort outputPort,
java.lang.StringBuffer code)
Generate code for transferring enough tokens to fulfill the output production rate. |
int |
getBufferSize(IOPort port,
int channelNumber)
Return the buffer size of a given channel (i.e, a given port and a given channel number). |
Methods inherited from class ptolemy.codegen.java.actor.sched.StaticSchedulingDirector |
---|
generateFireCode, generateMainLoop, generateVariableDeclaration |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int _portNumber
Constructor Detail |
---|
public SDFDirector(SDFDirector sdfDirector)
sdfDirector
- The associated
ptolemy.domains.sdf.kernel.SDFDirectorMethod Detail |
---|
public java.lang.String createOffsetVariablesIfNeeded() throws IllegalActionException
createOffsetVariablesIfNeeded
in interface ActorCodeGenerator
createOffsetVariablesIfNeeded
in class Director
IllegalActionException
- If thrown while creating
offset variables.public java.lang.String generateInitializeCode() throws IllegalActionException
generateInitializeCode
in interface ComponentCodeGenerator
generateInitializeCode
in class Director
IllegalActionException
- If the helper associated with
an actor throws it while generating initialize code for the actor.public java.lang.String generatePreinitializeCode() throws IllegalActionException
generatePreinitializeCode
in interface ActorCodeGenerator
generatePreinitializeCode
in class StaticSchedulingDirector
IllegalActionException
- If getting the helper fails,
or if generating the preinitialize code for a helper fails,
or if there is a problem getting the buffer size of a port.public void generateTransferInputsCode(IOPort inputPort, java.lang.StringBuffer code) throws IllegalActionException
generateTransferInputsCode
in class Director
inputPort
- The port to transfer tokens.code
- The string buffer that the generated code is appended to.
IllegalActionException
- If thrown while transferring tokens.public void generateTransferOutputsCode(IOPort outputPort, java.lang.StringBuffer code) throws IllegalActionException
generateTransferOutputsCode
in class Director
outputPort
- The port to transfer tokens.code
- The string buffer that the generated code is appended to.
IllegalActionException
- If thrown while transferring tokens.public int getBufferSize(IOPort port, int channelNumber) throws IllegalActionException
getBufferSize
in class Director
port
- The given port.channelNumber
- The given channel number.
IllegalActionException
- If the channel number is
out of range or if the port is neither an input nor an
output.CodeGeneratorHelper.setBufferSize(IOPort, int, int)
protected java.lang.String _createDynamicOffsetVariables(IOPort port) throws IllegalActionException
port
- The port whose offset variables are generated.
IllegalActionException
- If getting the rate or
reading parameters throws it.protected java.lang.String _createOffsetVariablesIfNeeded() throws IllegalActionException
IllegalActionException
- If getting the rate or
reading parameters throws it.protected java.lang.String _createOffsetVariablesIfNeeded(IOPort port, int channelNumber, int readTokens, int writeTokens) throws IllegalActionException
port
- The port to be checked.channelNumber
- The channel number.readTokens
- The number of tokens read.writeTokens
- The number of tokens written.
IllegalActionException
- If getting the rate or
reading parameters throws it.protected void _updatePortBufferSize() throws IllegalActionException
IllegalActionException
- If thrown while getting helper
or buffer size.private int _padBuffer(IOPort port, int channelNumber) throws IllegalActionException
port
- The port which has the buffer to pad.channelNumber
- The number of the channel which has the buffer
to pad.
IllegalActionException
- If thrown when getting the port's helper.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |