public class StaticSchedulingDirector extends PortDirector
Red (eal) |
Yellow (zgang) |
NamedProgramCodeGeneratorAdapter.VariableScope
ProgramCodeGeneratorAdapter.Channel
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CURRENTTIME_DECLARATION
The declaration for the _currentTime variable.
|
_sanitizedDirectorName, ports
_component, _defaultBlocks, _eol, _templateParser
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
StaticSchedulingDirector(StaticSchedulingDirector staticSchedulingDirector)
Construct the code generator adapter associated with the given
StaticSchedulingDirector.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_generateUpdatePortOffsetCode(java.lang.StringBuffer code,
Actor actor)
Generate the code that updates the input/output port offset.
|
protected java.lang.String |
_getParameter(NamedProgramCodeGeneratorAdapter target,
Attribute attribute,
java.lang.String[] channelAndOffset)
Return an unique label for the given attribute referenced
by the given adapter.
|
protected void |
_updateConnectedPortsOffset(IOPort port,
java.lang.StringBuffer code,
int rate)
Update the offsets of the buffers associated with the ports connected
with the given port in its downstream.
|
protected void |
_updatePortOffset(IOPort port,
java.lang.StringBuffer code,
int rate)
Update the read offsets of the buffer associated with the given port.
|
java.lang.Boolean |
allowDynamicMultiportReference()
Return whether the channels in multiports can be dynamically
referenced using the $ref macro.
|
DecoratorAttributes |
createDecoratorAttributes(NamedObj target,
GenericCodeGenerator genericCodeGenerator)
Create and return the decorated attributes for the
corresponding Ptolemy component.
|
java.lang.String |
generateFireCode()
Generate the code for the firing of actors according to the SDF
schedule.
|
java.lang.String |
generateInitializeCode()
Generate the initialize code for this director.
|
java.lang.String |
generateMainLoop()
Generate a main loop for an execution under the control of
this director.
|
java.lang.String |
generatePortName(TypedIOPort port)
Generate sanitized name for the given named object.
|
java.lang.String |
generatePreinitializeCode()
Generate the preinitialize code for this director.
|
java.lang.String |
generateVariableDeclaration()
Generate a variable declaration for the period parameter,
if there is one.
|
java.lang.Boolean |
padBuffers()
Return whether we need to pad buffers or not.
|
_checkLocal, _checkRemote, _generateChannelOffset, _generatePortReference, _getCastType, _getChannelAndOffset, _getRefName, _getRefType, getReference, getReference, getSanitizedDirectorName
_ceilToPowerOfTwo, _generateVariableDeclaration, _generateVariableInitialization, generateCodeForGet, generateCodeForSend, generateConstructorCode, generateFireFunctionCode, generateModeTransitionCode, generatePostfireCode, generatePreinitializeMethodBodyCode, generateTransferInputsCode, generateTransferInputsCode, generateTransferOutputsCode, generateTransferOutputsCode, generateVariableDeclaration, generateVariableInitialization, generateVariableInitialization, generateWrapupCode, getComponent, getIncludeDirectories, getLibraries, getLibraryDirectories, getModifiedVariables, getParameter
_generateFireCode, _generateTypeConvertStatement, analyzeTypeConvert, copyFilesToCodeDirectory, generatePrefireCode, generateSimpleName, generateTypeConvertFireCode, generateTypeConvertFireCode, getAddTimeString, getBufferSize, getBufferSize, getDeclareSharedCode, getDefaultBlocks, getFireFunctionParameters, getHeaderFiles, getName, getParameterValue, getReference, getReference, getSharedCode, getSinkChannels, getSourceTimeString, getTimeSourcePortName, getTypeConvertChannels, getTypeConvertReference, getTypeConvertSinkChannels, setupAdapter, targetType
_generateBlockByName, getAdapter, getCodeGenerator, getTemplateParser, processCode, setCodeGenerator, setTemplateParser, toString
generateName
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getContainedObject, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateExistence, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getContainer, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setName, setPersistent, setSource, sortContainedObjects, toplevel, uniqueName, validateSettables, workspace
public static final java.lang.String CURRENTTIME_DECLARATION
public StaticSchedulingDirector(StaticSchedulingDirector staticSchedulingDirector)
staticSchedulingDirector
- The associated
ptolemy.actor.sched.StaticSchedulingDirectorpublic final java.lang.Boolean allowDynamicMultiportReference() throws IllegalActionException
allowDynamicMultiportReference
in class PortDirector
IllegalActionException
- If the expression cannot
be parsed or cannot be evaluated, or if the result of evaluation
violates type constraints, or if the result of evaluation is null
and there are variables that depend on this one.public DecoratorAttributes createDecoratorAttributes(NamedObj target, GenericCodeGenerator genericCodeGenerator)
createDecoratorAttributes
in class CodeGeneratorAdapter
target
- The corresponding Ptolemy Component.genericCodeGenerator
- The code generator that is the
decorator for the corresponding Ptolemy Component.public java.lang.String generateFireCode() throws IllegalActionException
generateFireCode
in class Director
IllegalActionException
- If the SDF director does not have an
attribute called "iterations" or a valid schedule, or the actor to be
fired cannot find its associated adapter.public java.lang.String generateInitializeCode() throws IllegalActionException
generateInitializeCode
in class Director
IllegalActionException
- If the adapter associated with
an actor throws it while generating initialize code for the actor.public java.lang.String generateMainLoop() throws IllegalActionException
generateMainLoop
in class NamedProgramCodeGeneratorAdapter
IllegalActionException
- If something goes wrong.public java.lang.String generatePortName(TypedIOPort port) throws IllegalActionException
generatePortName
in class PortDirector
port
- The port for which the name is generated.IllegalActionException
- If the variablesAsArrays parameter
cannot be read or if the buffer size of the port cannot be read.public java.lang.String generatePreinitializeCode() throws IllegalActionException
generatePreinitializeCode
in class Director
IllegalActionException
- If getting the adapter fails,
or if generating the preinitialize code for a adapter fails,
or if there is a problem getting the buffer size of a port.public java.lang.String generateVariableDeclaration() throws IllegalActionException
generateVariableDeclaration
in class Director
IllegalActionException
- If the adapter class for the model
director cannot be found.public final java.lang.Boolean padBuffers() throws IllegalActionException
padBuffers
in class PortDirector
IllegalActionException
- If the expression cannot
be parsed or cannot be evaluated, or if the result of evaluation
violates type constraints, or if the result of evaluation is null
and there are variables that depend on this one.protected void _generateUpdatePortOffsetCode(java.lang.StringBuffer code, Actor actor) throws IllegalActionException
code
- The given code buffer.actor
- The given actor.IllegalActionException
- Thrown if
_updatePortOffset(IOPort, StringBuffer, int) or getRate(IOPort)
throw it.protected java.lang.String _getParameter(NamedProgramCodeGeneratorAdapter target, Attribute attribute, java.lang.String[] channelAndOffset) throws IllegalActionException
_getParameter
in class Director
target
- The ProgramCodeGeneratorAdapter for which code
needs to be generated.attribute
- The given attribute.channelAndOffset
- The given channel and offset.IllegalActionException
- If the adapter throws it while
generating the label.protected final void _updateConnectedPortsOffset(IOPort port, java.lang.StringBuffer code, int rate) throws IllegalActionException
port
- The port whose directly connected downstream actors update
their write offsets.code
- The string buffer that the generated code is appended to.rate
- The rate, which must be greater than or equal to 0.IllegalActionException
- If thrown while reading or writing
offsets, or getting the buffer size, or if the rate is less than 0.protected void _updatePortOffset(IOPort port, java.lang.StringBuffer code, int rate) throws IllegalActionException
port
- The port whose read offset is to be updated.code
- The string buffer that the generated code is appended to.rate
- The rate, which must be greater than or equal to 0.IllegalActionException
- If thrown while reading or writing
offsets, or getting the buffer size, or if the rate is less than 0.