Class Processor

java.lang.Object
uk.ac.manchester.spinnaker.machine.Processor
All Implemented Interfaces:
Comparable<Processor>

@Immutable
public final class Processor
extends Object
implements Comparable<Processor>
A processor object included in a SpiNNaker chip.

Note: There is no public constructor; instead use a static factory method.

Author:
Christian-B
See Also:
Python Version
  • Field Summary

    Fields 
    Modifier and Type Field Description
    int clockSpeed
    The clock speed of the processor in cycles per second.
    int dtcmAvailable
    The amount of DTCM available on this processor.
    boolean isMonitor
    Determines if the processor is the monitor, and therefore not to be allocated.
    @uk.ac.manchester.spinnaker.machine.ValidP int processorId
    The ID of the processor.
  • Method Summary

    Modifier and Type Method Description
    Processor cloneAsSystemProcessor()
    Provides a clone of this processor but changing it to a system processor.
    int compareTo​(Processor other)  
    int cpuCyclesAvailable()
    The number of CPU cycles available from this processor per millisecond.
    boolean equals​(Object obj)  
    static Processor factory​(int processorId)
    Obtain a non-monitor processor object for this ID.
    static Processor factory​(int processorId, boolean isMonitor)
    Obtain a processor object for this ID, which could be a monitor.
    static Processor factory​(int processorId, int clockSpeed, int dtcmAvailable, boolean isMonitor)
    Obtain a processor for this ID and with these properties.
    int hashCode()  
    String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • processorId

      @ValidP public final @uk.ac.manchester.spinnaker.machine.ValidP int processorId
      The ID of the processor.
    • clockSpeed

      public final int clockSpeed
      The clock speed of the processor in cycles per second.
    • isMonitor

      public final boolean isMonitor
      Determines if the processor is the monitor, and therefore not to be allocated.
    • dtcmAvailable

      public final int dtcmAvailable
      The amount of DTCM available on this processor.
  • Method Details

    • cpuCyclesAvailable

      public int cpuCyclesAvailable()
      The number of CPU cycles available from this processor per millisecond.
      Returns:
      The number of CPU cycles available from this processor per ms.
    • cloneAsSystemProcessor

      public Processor cloneAsSystemProcessor()
      Provides a clone of this processor but changing it to a system processor.
      Returns:
      A different Processor with all the same parameter values EXCEPT isMonitor which will always be true.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals​(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo​(Processor other)
      Specified by:
      compareTo in interface Comparable<Processor>
    • factory

      public static Processor factory​(int processorId, int clockSpeed, int dtcmAvailable, boolean isMonitor) throws IllegalArgumentException
      Obtain a processor for this ID and with these properties.
      Parameters:
      processorId - ID of the processor in the chip.
      clockSpeed - The number of CPU cycles per second of the processor.
      dtcmAvailable - Data Tightly Coupled Memory (DTCM) available.
      isMonitor - Determines if the processor is considered the monitor processor, and so should not be otherwise allocated.
      Returns:
      A Processor object with these properties
      Throws:
      IllegalArgumentException - If a nonsense parameter is given.
    • factory

      public static Processor factory​(int processorId, boolean isMonitor)
      Obtain a processor object for this ID, which could be a monitor.
      Parameters:
      processorId - ID of the processor in the chip.
      isMonitor - Determines if the processor is considered the monitor processor, and so should not be otherwise allocated.
      Returns:
      A default processor object with this ID and monitor state
    • factory

      public static Processor factory​(int processorId)
      Obtain a non-monitor processor object for this ID.
      Parameters:
      processorId - ID of the processor in the chip.
      Returns:
      A default processor object with this ID