Class PtidesPreemptiveEDFDirector

    • Constructor Detail

      • PtidesPreemptiveEDFDirector

        public PtidesPreemptiveEDFDirector​(PtidesDirector ptidesPreemptiveEDFDirector)
        Construct the code generator adapter associated with the given PtidesDirector.
        Parameters:
        ptidesPreemptiveEDFDirector - The associated director ptolemy.domains.ptides.kernel.PtidesDirector
    • Method Detail

      • generateFireCode

        public java.lang.String generateFireCode()
                                          throws IllegalActionException
        Generate the director fire code. The code creates a new task for each actor according to their specified parameters (e.g. stack depth, priority, and etc.). The code also initiates the task scheduler.
        Overrides:
        generateFireCode in class Director
        Returns:
        The generated fire code.
        Throws:
        IllegalActionException - Not thrown in this class.
      • generateFireFunctionCode

        public java.lang.String generateFireFunctionCode()
                                                  throws IllegalActionException
        Generate the fire function code. The code contains the function code for each actor. It is a collection of global functions, one for each actor that is visible to this director adapter. Creating each new task requires one of these function as parameter. It is the code that the task executes. When the inline parameter is checked, the task function code is generated in generatePreinitializeCode() which is outside the main function.
        Overrides:
        generateFireFunctionCode in class Director
        Returns:
        The fire function code.
        Throws:
        IllegalActionException - If there is an exception in generating the task function code.
      • generateInitializeCode

        public java.lang.String generateInitializeCode()
                                                throws IllegalActionException
        Generate the initialize code. This generates the hardware initialization code and creates the queues for all referrable port channels.
        Overrides:
        generateInitializeCode in class PtidesPreemptiveEDFDirector
        Returns:
        The generated initialize code.
        Throws:
        IllegalActionException - If the adapter associated with an actor throws it while generating initialize code for the actor.
      • generateVariableInitialization

        public java.lang.String generateVariableInitialization()
                                                        throws IllegalActionException
        Generate variable initialization for the referenced parameters. This overrides the super class method and returns an empty string. It avoids generating any offset variables.
        Overrides:
        generateVariableInitialization in class Director
        Returns:
        code The empty string.
        Throws:
        IllegalActionException - Not thrown in this class.
      • getSharedCode

        public java.util.Set getSharedCode()
                                    throws IllegalActionException
        Generate the shared code. This is the first generate method invoked out of all, so any initialization of variables of this adapter should be done in this method. In this base class, return an empty set. Subclasses may generate code for variable declaration, defining constants, etc.
        Overrides:
        getSharedCode in class PtidesPreemptiveEDFDirector
        Returns:
        An empty set in this base class.
        Throws:
        IllegalActionException - Not thrown in this base class.
      • _generateInitializeHardwareCode

        protected java.lang.String _generateInitializeHardwareCode()
                                                            throws IllegalActionException
        Generate the initialization code for any hardware component that is used.
        Returns:
        code initialization code for hardware peripherals
        Throws:
        IllegalActionException - If thrown by the super class.
      • _generateSensorFuncProtoCode

        protected java.lang.String _generateSensorFuncProtoCode()
        Generate the function prototype.
        Returns:
        The function prototype.