Class FSMDirector

    • Constructor Detail

      • FSMDirector

        public FSMDirector​(FSMDirector component)
        Construct the code generator helper associated with the given modal controller.
        Parameters:
        component - The associated component.
    • Method Detail

      • generateFireCode

        public java.lang.String generateFireCode()
                                          throws IllegalActionException
        Generate the code for the firing of actors. In this base class, it is attempted to fire all the actors once. In subclasses such as the adapters for SDF and Giotto directors, the firings of actors observe the associated schedule. In addition, some special handling is needed, e.g., the iteration limit in SDF and time advancement in Giotto.
        Overrides:
        generateFireCode in class Director
        Returns:
        The generated code.
        Throws:
        IllegalActionException - If the adapter associated with an actor throws it while generating fire code for the actor.
      • 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 Director
        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 Director
        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.
      • getReference

        public java.lang.String getReference​(java.lang.String name,
                                             boolean isWrite,
                                             NamedProgramCodeGeneratorAdapter target)
                                      throws IllegalActionException
        Return the reference to the specified parameter or port of the associated actor. For a parameter, the returned string is in the form "fullName_parameterName". For a port, the returned string is in the form "fullName_portName[channelNumber][offset]", if any channel number or offset is given.
        Overrides:
        getReference in class Director
        Parameters:
        name - The name of the parameter or port
        isWrite - Whether to generate the write or read offset.
        target - The ProgramCodeGeneratorAdapter for which code needs to be generated.
        Returns:
        The reference to that parameter or port (a variable name, for example).
        Throws:
        IllegalActionException - If the parameter or port does not exist or does not have a value.