spinnman.extended package¶
Submodules¶
spinnman.extended.extended_transceiver module¶
- class spinnman.extended.extended_transceiver.ExtendedTransceiver[source]¶
Bases:
object
Allows a Transceiver to support extra method not currently needed.
All methods here are in danger of being removed if they become too hard to support and many are untested so use at your own risk. It is undetermined if these will work with Spin2 boards.
If any method here is considered important to keep please move it to Transceiver and its implementations
Typing is best effort as without use there is no way to check
- execute(x: int, y: int, processors: List[int], executable: BinaryIO | bytes | int | str, app_id: int, n_bytes: int | None = None, wait: bool = False) None [source]¶
Start an executable running on a single chip.
Warning
This method is currently deprecated and likely to be removed.
- Parameters:
x (int) – The x-coordinate of the chip on which to run the executable
y (int) – The y-coordinate of the chip on which to run the executable
processors (list(int)) – The cores on the chip on which to run the application
executable (RawIOBase or bytes or bytearray or str) –
The data that is to be executed. Should be one of the following:
An instance of RawIOBase
A bytearray/bytes
A filename of a file containing the executable (in which case is_filename must be set to True)
app_id (int) – The ID of the application with which to associate the executable
n_bytes (int) –
The size of the executable data in bytes. If not specified:
If executable is an RawIOBase, an error is raised
If executable is a bytearray, the length of the bytearray will be used
If executable is an int, 4 will be used
If executable is a str, the length of the file will be used
wait (bool) – True if the binary should enter a “wait” state on loading
- Raises:
If there is an error communicating with the board
If there is an error reading the executable
SpinnmanInvalidPacketException – If a packet is received that is not in the valid format
SpinnmanInvalidParameterException –
If x, y, p does not lead to a valid core
If app_id is an invalid application ID
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- execute_application(executable_targets: ExecutableTargets, app_id: int) None [source]¶
Execute a set of binaries that make up a complete application on specified cores, wait for them to be ready and then start all of the binaries.
Note
This will get the binaries into c_main but will not signal the barrier.
- Parameters:
executable_targets (ExecutableTargets) – The binaries to be executed and the cores to execute them on
app_id (int) – The app_id to give this application
- free_sdram(x: int, y: int, base_address: int) None [source]¶
Free allocated SDRAM.
Warning
This method is currently deprecated and likely to be removed.
- free_sdram_by_app_id(x: int, y: int, app_id: int) int | None [source]¶
Free all SDRAM allocated to a given app ID.
Warning
This method is currently deprecated and untested as there is no known use. Same functionality provided by ybug and bmpc. Retained in case needed for hardware debugging.
- get_heap(x: int, y: int, heap: SystemVariableDefinition = SystemVariableDefinition.sdram_heap_address) Sequence[HeapElement] [source]¶
Get the contents of the given heap on a given chip.
- Parameters:
x (int) – The x-coordinate of the chip
y (int) – The y-coordinate of the chip
heap (SystemVariableDefinition) – The SystemVariableDefinition which is the heap to read
- get_iobuf_from_core(x: int, y: int, p: int) IOBuffer [source]¶
Get the contents of IOBUF for a given core.
Warning
This method is currently deprecated and likely to be removed.
- Parameters:
- Returns:
An IOBUF buffer
- Return type:
- Raises:
SpinnmanIOException – If there is an error communicating with the board
SpinnmanInvalidPacketException – If a packet is received that is not in the valid format
SpinnmanInvalidParameterException –
If chip_and_cores contains invalid items
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- get_router_diagnostic_filter(x: int, y: int, position: int) DiagnosticFilter [source]¶
Gets a router diagnostic filter from a router.
- Parameters:
- Returns:
The diagnostic filter read
- Return type:
- Raises:
If there is an error communicating with the board
If there is an error reading the data
SpinnmanInvalidPacketException – If a packet is received that is not in the valid format
SpinnmanInvalidParameterException –
If x, y does not lead to a valid chip
If a packet is received that has invalid parameters
If position is less than 0 or more than 15
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- is_connected(connection: Connection | None = None) bool [source]¶
Determines if the board can be contacted via SCAMP
- Parameters:
connection (Connection) – The connection which is to be tested. If None, all Scamp connections will be tested, and the board will be considered to be connected if any one connection works.
- Returns:
True if the board can be contacted, False otherwise
- Return type:
- property number_of_boards_located: int¶
The number of boards currently configured.
Warning
This property is currently deprecated and likely to be removed.
- Return type:
- read_adc_data(board: int) ADCInfo [source]¶
Read the BMP ADC data.
Warning
This method is currently deprecated and untested as there is no known use. Same functionality provided by ybug and bmpc. Retained in case needed for hardware debugging.
- read_neighbour_memory(x: int, y: int, link: int, base_address: int, length: int, cpu: int = 0) bytearray [source]¶
Read some areas of memory on a neighbouring chip using a LINK_READ SCP command. If sent to a BMP, this command can be used to communicate with the FPGAs’ debug registers.
Warning
This method is currently deprecated and untested as there is no known use. Same functionality provided by ybug and bmpc. Retained in case needed for hardware debugging.
- Parameters:
x (int) – The x-coordinate of the chip whose neighbour is to be read from
y (int) – The y-coordinate of the chip whose neighbour is to be read from
cpu (int) – The CPU to use, typically 0 (or if a BMP, the slot number)
link (int) – The link index to send the request to (or if BMP, the FPGA number)
base_address (int) – The address in SDRAM where the region of memory to be read starts
length (int) – The length of the data to be read in bytes
- Returns:
An iterable of chunks of data read in order
- Return type:
- Raises:
SpinnmanIOException – If there is an error communicating with the board
SpinnmanInvalidPacketException – If a packet is received that is not in the valid format
SpinnmanInvalidParameterException –
If one of x, y, cpu, base_address or length is invalid
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- set_led(led: int | Iterable[int], action: LEDAction, board: int | Iterable[int]) None [source]¶
Set the LED state of a board in the machine.
Warning
This method is currently deprecated and untested as there is no known use. Same functionality provided by ybug and bmpc. Retained in case needed for hardware debugging.
- Parameters:
led (int or iterable(int)) – Number of the LED or an iterable of LEDs to set the state of (0-7)
action (LEDAction) – State to set the LED to, either on, off or toggle
board (int or iterable(int)) – Specifies the board to control the LEDs of. This may also be an iterable of multiple boards. The command will actually be sent to the first board in the iterable.
- set_leds(x: int, y: int, cpu: int, led_states: Mapping[int, int]) None [source]¶
Set LED states.
Warning
The set_leds is deprecated and untested due to no known use.
- Parameters:
- Raises:
SpinnmanIOException – If there is an error communicating with the board
SpinnmanInvalidPacketException – If a packet is received that is not in the valid format
SpinnmanInvalidParameterException – If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- set_watch_dog(watch_dog: int | bool) None [source]¶
Enable, disable or set the value of the watch dog timer.
Warning
This method is currently deprecated and untested as there is no known use. Same functionality provided by ybug and bmpc. Retained in case needed for hardware debugging.
- write_memory_flood(base_address: int, data: BinaryIO | str | int | bytes, n_bytes: int | None = None, offset: int = 0, is_filename: bool = False) None [source]¶
Write to the SDRAM of all chips.
- Parameters:
base_address (int) – The address in SDRAM where the region of memory is to be written
data (RawIOBase or bytes or bytearray or int or str) –
The data that is to be written. Should be one of the following:
An instance of RawIOBase
A byte-string
A single integer
A file name of a file to read (in which case is_filename should be set to True)
n_bytes (int) –
The amount of data to be written in bytes. If not specified:
If data is an RawIOBase, an error is raised
If data is a bytearray or bytes, the length of the bytearray will be used
If data is an int, 4 will be used
If data is a str, the size of the file will be used
offset (int) – The offset where the valid data starts; if data is an int, then the offset will be ignored and 0 is used.
is_filename (bool) – True if data should be interpreted as a file name
- Raises:
If there is an error communicating with the board
If there is an error reading the executable
SpinnmanInvalidPacketException – If a packet is received that is not in the valid format
SpinnmanInvalidParameterException –
If one of the specified chips is not valid
If app_id is an invalid application ID
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- write_neighbour_memory(x: int, y: int, link: int, base_address: int, data: BinaryIO | str | int | bytes, n_bytes: int | None = None, offset: int = 0, cpu: int = 0) None [source]¶
Write to the memory of a neighbouring chip using a LINK_READ SCP command. If sent to a BMP, this command can be used to communicate with the FPGAs’ debug registers.
Warning
This method is deprecated and untested due to no known use.
- Parameters:
x (int) – The x-coordinate of the chip whose neighbour is to be written to
y (int) – The y-coordinate of the chip whose neighbour is to be written to
link (int) – The link index to send the request to (or if BMP, the FPGA number)
base_address (int) – The address in SDRAM where the region of memory is to be written
data (RawIOBase or bytes or bytearray or int) –
The data to write. Should be one of the following:
An instance of RawIOBase
A bytearray/bytes
A single integer; will be written in little-endian byte order
n_bytes (int) –
The amount of data to be written in bytes. If not specified:
If data is an RawIOBase, an error is raised
If data is a bytearray, the length of the bytearray will be used
If data is an int, 4 will be used
offset (int) – The offset where the valid data starts (if data is an int then offset will be ignored and used 0)
cpu (int) – The CPU to use, typically 0 (or if a BMP, the slot number)
- Raises:
If there is an error communicating with the board
If there is an error reading the data
SpinnmanInvalidPacketException – If a packet is received that is not in the valid format
SpinnmanInvalidParameterException –
If x, y does not lead to a valid chip
If a packet is received that has invalid parameters
If base_address is not a positive integer
If data is an RawIOBase but n_bytes is not specified
If data is an int and n_bytes is more than 4
If n_bytes is less than 0
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
spinnman.extended.version3transceiver module¶
- class spinnman.extended.version3transceiver.ExtendedVersion3Transceiver(connections: List[Connection] | None = None, power_cycle: bool = False)[source]¶
Bases:
Version3Transceiver
,ExtendedTransceiver
A Transceiver specific for a 4 chip (spin 1) with the extended methods.
- Parameters:
connections (list(Connection)) – An iterable of connections to the board. If not specified, no communication will be possible until connections are found.
power_cycle (bool) – If True will power cycle the machine:
- Raises:
SpinnmanIOException – If there is an error communicating with the board, or if no connections to the board can be found (if connections is
None
)SpinnmanInvalidPacketException – If a packet is received that is not in the valid format
SpinnmanInvalidParameterException – If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
spinnman.extended.version5transceiver module¶
- class spinnman.extended.version5transceiver.ExtendedVersion5Transceiver(connections: List[Connection] | None = None, power_cycle: bool = False)[source]¶
Bases:
Version5Transceiver
,ExtendedTransceiver
A Transceiver specific for a 48 chip (spin 1) with the extended methods.
- Parameters:
connections (list(Connection)) – An iterable of connections to the board. If not specified, no communication will be possible until connections are found.
power_cycle (bool) – If True will power cycle the machine:
- Raises:
SpinnmanIOException – If there is an error communicating with the board, or if no connections to the board can be found (if connections is
None
)SpinnmanInvalidPacketException – If a packet is received that is not in the valid format
SpinnmanInvalidParameterException – If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
Module contents¶
- class spinnman.extended.BMPSetLed(led: int | Iterable[int], action: LEDAction, boards: int | Iterable[int])¶
Bases:
BMPRequest
Set the LED(s) of a board to either on, off or toggling.
This class is currently deprecated and untested as there is no known use except for Transceiver.set_led which is itself deprecated.
- Parameters:
led (int or list(int)) – Number of the LED or an iterable of LEDs to set the state of (0-7)
action (LEDAction) – State to set the LED to, either on, off or toggle
boards (int or list(int)) – Specifies the board to control the LEDs of. This may also be an iterable of multiple boards (in the same frame).
- class spinnman.extended.DeAllocSDRAMProcess(connection_selector: ConnectionSelector)¶
Bases:
AbstractMultiConnectionProcess
Warning
This class is currently deprecated and untested as there is no known use except for Transceiver.free_sdram and free_sdram_by_app_id which are both themselves deprecated.
- Parameters:
connection_selector (ConnectionSelector)
- class spinnman.extended.ReadADC(board: int)¶
Bases:
BMPRequest
[_SCPReadADCResponse
]SCP Request for the data from the BMP including voltages and temperature.
This class is currently deprecated and untested as there is no known use except for Transceiver.read_adc_data which is itself deprecated.
Note
The equivalent code in Java is not deprecated.
- Parameters:
board (int) – which board to request the ADC data from
- class spinnman.extended.SetLED(x: int, y: int, cpu: int, led_states: Mapping[int, int])¶
Bases:
AbstractSCPRequest
[CheckOKResponse
]A request to change the state of a chip’s LED.
This class is currently deprecated and untested as there is no known use except for Transceiver.set_led which is itself deprecated.
- Parameters:
- class spinnman.extended.WriteMemoryFloodProcess(next_connection_selector: ConnectionSelector)¶
Bases:
AbstractMultiConnectionProcess
A process for writing memory on multiple SpiNNaker chips at once.
- Parameters:
next_connection_selector (ConnectionSelector) – How to choose the connection.
n_retries (int) – The number of retries of a message to use. Passed to
SCPRequestPipeLine
timeout (float) – The timeout, in seconds. Passed to
SCPRequestPipeLine
n_channels (int) – The maximum number of channels to use when talking to a particular SCAMP instance. Passed to
SCPRequestPipeLine
intermediate_channel_waits (int) – The maximum number of outstanding message/reply pairs to have on a particular connection. Passed to
SCPRequestPipeLine
non_fail_retry_codes (Optional[Set[SCPResult]]) – Optional set of responses that result in retry but after retrying don’t then result in failure even if returned on the last call.