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()
-
Field Details
-
processorId
The ID of the processor. -
clockSpeed
public final int clockSpeedThe clock speed of the processor in cycles per second. -
isMonitor
public final boolean isMonitorDetermines if the processor is the monitor, and therefore not to be allocated. -
dtcmAvailable
public final int dtcmAvailableThe 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
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
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Processor>
-
factory
public static Processor factory(int processorId, int clockSpeed, int dtcmAvailable, boolean isMonitor) throws IllegalArgumentExceptionObtain 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
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
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
-