caoss.simulator.hardware

## Class SimpleCPUCore

- java.lang.Object
- - caoss.simulator.hardware.CPUCore
  - - caoss.simulator.hardware.SimpleCPUCore

- All Implemented Interfaces:
    Clockable

      public class SimpleCPUCore
      extends CPUCore

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleCPUCore()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getDescription()` Textual description of the hardware
    `<T> T` | `getRegister(int i)` Obtain the value of a given register
    `java.lang.Object[]` | `getRegisters()` Obtain the core's register array
    `void` | `handleInterrupt(Interrupt interrupt)` Handle an interrupt
    `void` | `load(Context context)` Load context to the core
    `void` | `setRegisters(int register, java.lang.Object... values)` Set the value of a sequence of registers
    `void` | `tick()` The fetch-decode-execute loop
    `java.lang.String` | `toString()`

    - ### Methods inherited from class caoss.simulator.hardware.CPUCore

      `getContext`

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

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

- - ### Constructor Detail

    - #### SimpleCPUCore

          public SimpleCPUCore()

  - ### Method Detail

    - #### load

          public void load(Context context)

      Description copied from class: `CPUCore`
      Load context to the core
      Overrides:
        `load` in class `CPUCore`
      Parameters:
        `context` - The context

    - #### tick

          public void tick()

      The fetch-decode-execute loop

    - #### getDescription

          public java.lang.String getDescription()

      Description copied from interface: `Clockable`
      Textual description of the hardware
      Returns:
        The textual description

    - #### handleInterrupt

          public void handleInterrupt(Interrupt interrupt)
                               throws java.lang.Exception

      Description copied from class: `CPUCore`
      Handle an interrupt
      Specified by:
        `handleInterrupt` in class `CPUCore`
      Parameters:
        `interrupt` - The interrupt to handle
      Throws:
        `java.lang.Exception`

    - #### setRegisters

          public void setRegisters(int register,
                                   java.lang.Object... values)
                            throws InvalidRegisterException

      Description copied from class: `CPUCore`
      Set the value of a sequence of registers
      Specified by:
        `setRegisters` in class `CPUCore`
      Parameters:
        `register` - The initial register to affect
        `values` - The values to store
      Throws:
        `InvalidRegisterException` - Thrown if the sequence of registers to affect goes beyond the number of registers supported by the CPU core

    - #### getRegister

          public <T> T getRegister(int i)
                            throws InvalidRegisterException

      Description copied from class: `CPUCore`
      Obtain the value of a given register
      Specified by:
        `getRegister` in class `CPUCore`
      Parameters:
        `i` - The number of the register to read
      Returns:
        The value stored in register(number)
      Throws:
        `InvalidRegisterException` - Thrown if number is not a valid register

    - #### getRegisters

          public java.lang.Object[] getRegisters()

      Description copied from class: `CPUCore`
      Obtain the core's register array
      Specified by:
        `getRegisters` in class `CPUCore`
      Returns:
        The array of registers

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`