Class SDFDirector

    • Constructor Detail

      • SDFDirector

        public SDFDirector​(SDFDirector sdfDirector)
        Construct the code generator adapter associated with the given SDFDirector.
        Parameters:
        sdfDirector - The associated ptolemy.domains.sdf.kernel.SDFDirector
    • Method Detail

      • generateFireCode

        public java.lang.String generateFireCode()
                                          throws IllegalActionException
        Generate the code for the firing of actors according to the SDF schedule.
        Overrides:
        generateFireCode in class StaticSchedulingDirector
        Returns:
        The generated fire code.
        Throws:
        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.
      • generateTransferInputsCode

        public void generateTransferInputsCode​(IOPort inputPort,
                                               java.lang.StringBuffer code)
                                        throws IllegalActionException
        Generate code for transferring enough tokens to complete an internal iteration.
        Overrides:
        generateTransferInputsCode in class SDFDirector
        Parameters:
        inputPort - The port to transfer tokens.
        code - The string buffer that the generated code is appended to.
        Throws:
        IllegalActionException - If thrown while transferring tokens.
      • generateTransferOutputsCode

        public void generateTransferOutputsCode​(IOPort outputPort,
                                                java.lang.StringBuffer code)
                                         throws IllegalActionException
        Generate code for transferring enough tokens to fulfill the output production rate.
        Overrides:
        generateTransferOutputsCode in class SDFDirector
        Parameters:
        outputPort - The port to transfer tokens.
        code - The string buffer that the generated code is appended to.
        Throws:
        IllegalActionException - If thrown while transferring tokens.
      • generateVariableDeclaration

        public java.lang.String generateVariableDeclaration()
                                                     throws IllegalActionException
        Generate variable declarations for inputs and outputs and parameters. Append the declarations to the given string buffer.
        Overrides:
        generateVariableDeclaration in class SDFDirector
        Returns:
        code The generated code.
        Throws:
        IllegalActionException - If the adapter class for the model director cannot be found.
      • getReference

        public java.lang.String getReference​(TypedIOPort port,
                                             java.lang.String[] channelAndOffset,
                                             boolean forComposite,
                                             boolean isWrite,
                                             NamedProgramCodeGeneratorAdapter target)
                                      throws IllegalActionException
        Return an unique label for the given port channel referenced by the given adapter. By default, this delegates to the adapter to generate the reference. Subclass may override this method to generate the desire label according to the given parameters.
        Overrides:
        getReference in class PortDirector
        Parameters:
        port - The given port.
        channelAndOffset - The given channel and offset.
        forComposite - Whether the given adapter is associated with a CompositeActor
        isWrite - The type of the reference. True if this is a write reference; otherwise, this is a read reference.
        target - The ProgramCodeGeneratorAdapter for which code needs to be generated.
        Returns:
        an unique reference label for the given port channel.
        Throws:
        IllegalActionException - If the adapter throws it while generating the label.
      • _updatePortBufferSize

        protected void _updatePortBufferSize()
                                      throws IllegalActionException
        Check to see if the buffer size for the current schedule is greater than the previous size. If so, set the buffer size to the current buffer size needed.
        Overrides:
        _updatePortBufferSize in class SDFDirector
        Throws:
        IllegalActionException - If thrown while getting adapter or buffer size.