Class Executor


  • public final class Executor
    extends java.lang.Object
    The role of the Executor class is to execute (simulate) instruction calls (concrete calls). It executes instruction by instruction, perform control transfers by labels (if needed) and prints information about important events to the simulator log (currently, the console).
    • Constructor Detail

      • Executor

        public Executor​(EngineContext context,
                        LabelManager labelManager,
                        boolean isPresimulation)
        Constructs an Executor object.
        Parameters:
        context - Generation engine context.
        labelManager - Label manager that stores all refined labels.
        isPresimulation - Flag that specifies whether the presimulation mode is on.
        Throws:
        java.lang.IllegalArgumentException - if the argument is null.
    • Method Detail

      • setPauseOnUndefinedLabel

        public void setPauseOnUndefinedLabel​(boolean value)
      • setSelfCheckMode

        public void setSelfCheckMode​(boolean value)
      • execute

        public Executor.Status execute​(Code code,
                                       long startAddress)
        Executes code starting from the specified address until (1) a break point is reached and no executable code follows after this point or (2) an attempt to jump to an undefined label is made.
        Parameters:
        code - Code to be executed.
        startAddress - Start address.
        Returns:
        Execution status (address or label).
        Throws:
        GenerationAbortedException - (1) if an endless loop is detected; (2) if execution jumped to an address that holds no executable instructions and no handling is provided for this situation; (3) if an error related to interaction with the model occurs.