caoss.simulator.instructions

## Class InstructionFactory

- java.lang.Object
- - caoss.simulator.instructions.InstructionFactory

-     public class InstructionFactory
      extends java.lang.Object

  Factory for the creation of instances of each instruction supported by the CPU cores
  Author:
    Herve Paulino

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InstructionFactory()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Computation` | `newComputation(int clockCycles)` Create an instance of a `computation instruction`
    `static Loop` | `newLoop(int numIterations, InstructionList instructionList)` Create an instance of a `loop instruction`
    `static MemoryAccess` | `newMemoryLoad(long address)` Create an instance of a `load instruction`
    `static MemoryAccess` | `newMemoryStore(long address)` Create an instance of a `store instruction`
    `static SysCall` | `newSysCall(java.lang.String sysCall, int[] arguments)` Create an instance of a `syscall instruction`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InstructionFactory

          public InstructionFactory()

  - ### Method Detail

    - #### newComputation

          public static Computation newComputation(int clockCycles)

      Create an instance of a `computation instruction`
      Parameters:
        `clockCycles` - Clock cycles the computation takes
      Returns:
        An instance of the `configured computation class`

    - #### newSysCall

          public static SysCall newSysCall(java.lang.String sysCall,
                                           int[] arguments)
                                    throws NoSuchSysCallException

      Create an instance of a `syscall instruction`
      Parameters:
        `sysCall` - The number/identifier of the system call
        `arguments` - The arguments of the system call
      Returns:
        An instance of the `configured system call class`
      Throws:
        `NoSuchSysCallException` - No such system call exception

    - #### newMemoryLoad

          public static MemoryAccess newMemoryLoad(long address)

      Create an instance of a `load instruction`
      Parameters:
        `address` - The source address
      Returns:
        An instance of the `configured memory load class`

    - #### newMemoryStore

          public static MemoryAccess newMemoryStore(long address)

      Create an instance of a `store instruction`
      Parameters:
        `address` - The destination address
      Returns:
        An instance of the `configured memory store class`

    - #### newLoop

          public static Loop newLoop(int numIterations,
                                     InstructionList instructionList)

      Create an instance of a `loop instruction`
      Parameters:
        `numIterations` - Number of iterations
        `instructionList` - The body of the loop
      Returns:
        An instance of the `class`