spinnman.transceiver package¶
Submodules¶
spinnman.transceiver.base_transceiver module¶
- class spinnman.transceiver.base_transceiver.BaseTransceiver(connections: List[Connection] | None = None, power_cycle: bool = False)[source]¶
Bases:
ExtendableTransceiver
A base for all the code shared by all Version of the Transceiver.
- 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
- add_cpu_information_from_core(cpu_infos: CPUInfos, x: int, y: int, p: int, states: Iterable[CPUState]) None [source]¶
Adds information about a specific processor on the board to the info
- Parameters:
cpu_infos (CPUInfos) – Info to add data for this core to
x (int) – The x-coordinate of the chip containing the processor
y (int) – The y-coordinate of the chip containing the processor
p (int) – The ID of the processor to get the information about
states (list(CPUState)) – If provided will only add the info if in one of the states
- Returns:
The CPU information for the selected core
- 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 x, y, p is not a valid processor
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- add_scamp_connections(connections: Dict[Tuple[int, int], str]) None [source]¶
Check connections to the board and store these for future use.
Note
An exception will be thrown if no initial connections can be found to the board.
- Parameters:
connections (dict((int,int),str)) – Dict of (x,`y`) to IP address
- 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
- property bmp_selector: FixedConnectionSelector[BMPConnection] | None¶
Returns the BMP selector
- Return type:
AbstractMultiConnectionProcessConnectionSelector
- abstract property boot_led_0_value: int¶
The Values to be set in SpinnakerBootMessages for led_0
- Rtype int:
- clear_ip_tag(tag: int, board_address: str | None = None) None [source]¶
Clear the setting of an IP tag.
- 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 the tag is not a valid tag
If the connection cannot send SDP messages
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- clear_multicast_routes(x: int, y: int) None [source]¶
Remove all the multicast routes on a chip.
- 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
- clear_router_diagnostic_counters(x: int, y: int) None [source]¶
Clear router diagnostic information on a chip.
- 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 or a counter ID is out of range
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- control_sync(do_sync: bool) None [source]¶
Control the synchronisation of the chips.
- Parameters:
do_sync (bool) – Whether to synchronise or not
- discover_scamp_connections() None [source]¶
Find connections to the board and store these for future use.
Note
An exception will be thrown if no initial connections can be found to the board.
- 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
- execute_flood(core_subsets: CoreSubsets, executable: BinaryIO | bytes | str, app_id: int, *, n_bytes: int | None = None, wait: bool = False) None [source]¶
Start an executable running on multiple places on the board. This will be optimised based on the selected cores, but it may still require a number of communications with the board to execute.
- Parameters:
core_subsets (CoreSubsets) – Which cores on which chips to start the executable
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 * A filename of an executable
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 a str, the length of the file will be used
wait (bool) – True if the processors 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 one of the specified cores is not valid
If app_id is an invalid application ID
If a packet is received that has invalid parameters
If executable is an RawIOBase but n_bytes is not specified
If executable 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
- get_connections() Set[Connection] [source]¶
Get the currently known connections to the board, made up of those passed in to the transceiver and those that are discovered during calls to discover_connections. No further discovery is done here.
- Returns:
An iterable of connections known to the transceiver
- Return type:
- get_core_state_count(app_id: int, state: CPUState, xys: Iterable[Tuple[int, int]] | None = None) int [source]¶
Get a count of the number of cores which have a given state.
- Parameters:
- Returns:
A count of the cores with the given status
- 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 state is not a valid status
If app_id is not a valid application ID
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- get_cpu_infos(core_subsets: CoreSubsets | None = None, states: CPUState | Iterable[CPUState] | None = None, include: bool = True) CPUInfos [source]¶
Get information about the processors on the board.
- Parameters:
core_subsets (CoreSubsets) – A set of chips and cores from which to get the information. If not specified, the information from all of the cores on all of the chips on the board are obtained.
states (None, CPUState or iterable(CPUState)) – The state or states to filter on (if any)
include (bool) – If True includes only infos in the requested state(s). If False includes only infos not in the requested state(s). Ignored if states is None.
- Returns:
The CPU information for the selected cores and States, or all cores/states if core_subsets/states is not specified
- 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_iobuf(core_subsets: CoreSubsets | None = None) Iterable[IOBuffer] [source]¶
Get the contents of the IOBUF buffer for a number of processors.
- Parameters:
core_subsets (CoreSubsets) – A set of chips and cores from which to get the buffers. If not specified, the buffers from all of the cores on all of the chips on the board are obtained.
- Returns:
An iterable of the buffers, which may not be in the order of core_subsets
- Return type:
iterable(IOBuffer)
- 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_machine_details() Machine [source]¶
Get the details of the machine made up of chips on a board and how they are connected to each other.
- Returns:
A machine description
- 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 a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- get_multicast_routes(x: int, y: int, app_id: int | None = None) List[MulticastRoutingEntry] [source]¶
Get the current multicast routes set up on a chip.
- Parameters:
- Returns:
An iterable of multicast routes
- 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 a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- get_region_base_address(x: int, y: int, p: int) int [source]¶
Gets the base address of the Region Table
- Parameters:
- Returns:
The address of the Region table for the selected core
- 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 x, y, p is not a valid processor
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- get_router_diagnostics(x: int, y: int) RouterDiagnostics [source]¶
Get router diagnostic information from a chip.
- Parameters:
- Returns:
The router diagnostic information
- 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 a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- get_scamp_connection_selector() MostDirectConnectionSelector [source]¶
Returns the most direct scamp connections
- Return type:
MostDirectConnectionSelecto
- get_tags(connection: SCAMPConnection | None = None) Iterable[AbstractTag] [source]¶
Get the current set of tags that have been set on the board.
- Parameters:
connection (AbstractSCPConnection) – Connection from which the tags should be received. If not specified, all AbstractSCPConnection connections will be queried and the response will be combined.
- Returns:
An iterable of tags
- Return type:
iterable(AbstractTag)
- 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 the connection cannot send SDP messages
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- load_fixed_route(x: int, y: int, fixed_route: RoutingEntry, app_id: int) None [source]¶
Loads a fixed route routing table entry onto a chip’s router.
- Parameters:
x (int) – The x-coordinate of the chip onto which to load the routes
y (int) – The y-coordinate of the chip onto which to load the routes
fixed_route (RoutingEntry) – the route for the fixed route entry on this chip
app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
- 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 any of the routes are invalid
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- load_multicast_routes(x: int, y: int, routes: Collection[MulticastRoutingEntry], app_id: int) None [source]¶
Load a set of multicast routes on to a chip.
- Parameters:
x (int) – The x-coordinate of the chip onto which to load the routes
y (int) – The y-coordinate of the chip onto which to load the routes
routes (iterable(MulticastRoutingEntry)) – An iterable of multicast routes to load
app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
- 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 any of the routes are invalid
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- malloc_sdram(x: int, y: int, size: int, app_id: int, tag: int = 0) int [source]¶
Allocates a chunk of SDRAM on a chip on the machine.
- Parameters:
x (int) – The x-coordinate of the chip onto which to ask for memory
y (int) – The y-coordinate of the chip onto which to ask for memory
size (int) – the amount of memory to allocate in bytes
app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
tag (int) – the tag for the SDRAM, a 8-bit (chip-wide) tag that can be looked up by a SpiNNaker application to discover the address of the allocated block. If 0 then no tag is applied.
- Returns:
the base address of the allocated memory
- Return type:
- read_bmp_version(board: int) VersionInfo [source]¶
Read the BMP version.
- Parameters:
board (int) – which board to request the data from
- Returns:
the version_info from the BMP
- read_fixed_route(x: int, y: int, app_id: int) RoutingEntry [source]¶
Reads a fixed route routing table entry from a chip’s router.
- Parameters:
- Returns:
the route as a fixed route entry
- read_fpga_register(fpga_num: int, register: int, board: int = 0) int [source]¶
Read a register on a FPGA of a board. The meaning of the register’s contents will depend on the FPGA’s configuration.
- read_memory(x: int, y: int, base_address: int, length: int, cpu: int = 0) bytearray [source]¶
Read some areas of memory (usually SDRAM) from the board.
- Parameters:
x (int) – The x-coordinate of the chip where the memory is to be read from
y (int) – The y-coordinate of the chip where the memory is to be read from
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
cpu (int) – the core ID used to read the memory of; should usually be 0 when reading from SDRAM, but may be other values when reading from DTCM.
- Returns:
A bytearray of data read
- 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
- read_user(x: int, y: int, p: int, user: UserRegister) int [source]¶
Get the contents of the this user register for the given processor.
Note
Conventionally, user_0 usually holds the address of the table of memory regions.
- Parameters:
- 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 x, y, p does not identify a valid processor
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- read_word(x: int, y: int, base_address: int, cpu: int = 0) int [source]¶
Read a word (usually of SDRAM) from the board.
- Parameters:
x (int) – The x-coordinate of the chip where the word is to be read from
y (int) – The y-coordinate of the chip where the word is to be read from
base_address (int) – The address (usually in SDRAM) where the word to be read starts
cpu (int) – the core ID used to read the word; should usually be 0 when reading from SDRAM, but may be other values when reading from DTCM.
- Returns:
The unsigned integer value at
base_address
- 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 or base_address is invalid
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- property scamp_connection_selector: MostDirectConnectionSelector¶
Returns the scamp selector
- Return type:
AbstractMultiConnectionProcessConnectionSelector
- send_chip_update_provenance_and_exit(x: int, y: int, p: int) None [source]¶
Sends a signal to update the provenance and exit
- send_sdp_message(message: SDPMessage, connection: SDPConnection | None = None) None [source]¶
Sends an SDP message using one of the connections.
- Parameters:
message (SDPMessage) – The message to send
connection (SDPConnection) – An optional connection to use
- send_signal(app_id: int, signal: Signal) None [source]¶
Send a signal to an application.
- 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 signal is not a valid signal
If app_id is not a valid application ID
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- set_ip_tag(ip_tag: IPTag, use_sender: bool = False) None [source]¶
Set up an IP tag.
- 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 the IP tag fields are incorrect
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- set_reverse_ip_tag(reverse_ip_tag: ReverseIPTag) None [source]¶
Set up a reverse IP tag.
- Parameters:
reverse_ip_tag (ReverseIPTag) –
The reverse tag to set up.
Note
The board_address field can be None, in which case, the tag will be assigned to all boards.
- 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 the reverse IP tag fields are incorrect
If a packet is received that has invalid parameters
- If the UDP port is one that is already used by SpiNNaker for
system functions
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- set_router_diagnostic_filter(x: int, y: int, position: int, diagnostic_filter: DiagnosticFilter) None [source]¶
Sets a router diagnostic filter in a router.
- Parameters:
x (int) – The X address of the router in which this filter is being set.
y (int) – The Y address of the router in which this filter is being set.
position (int) – The position in the list of filters where this filter is to be added.
diagnostic_filter (DiagnosticFilter) –
The diagnostic filter being set in the placed, between 0 and 15.
Note
Positions 0 to 11 are used by the default filters, and setting these positions will result in a warning.
- 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 position is less than 0 or more than 15
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- stop_application(app_id: int) None [source]¶
Sends a stop request for an app_id.
- Parameters:
app_id (int) – The ID of the application to send to
- 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 app_id is not a valid application ID
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- update_provenance_and_exit(x: int, y: int, p: int) None [source]¶
Sends a command to update provenance and exit
- wait_for_cores_to_be_in_state(all_core_subsets: CoreSubsets, app_id: int, cpu_states: CPUState | Iterable[CPUState], *, timeout: float | None = None, time_between_polls: float = 0.1, error_states: FrozenSet[CPUState] = frozenset({CPUState.RUN_TIME_EXCEPTION, CPUState.WATCHDOG}), counts_between_full_check: int = 100, progress_bar: ProgressBar | None = None) None [source]¶
Waits for the specified cores running the given application to be in some target state or states. Handles failures.
- Parameters:
all_core_subsets (CoreSubsets) – the cores to check are in a given sync state
app_id (int) – the application ID that being used by the simulation
cpu_states (CPUState or iterable(CPUState)) – The expected states once the applications are ready; success is when each application is in one of these states
timeout (float) – The amount of time to wait in seconds for the cores to reach one of the states
time_between_polls (float) – Time between checking the state
error_states (set(CPUState)) – Set of states that the application can be in that indicate an error, and so should raise an exception
counts_between_full_check (int) – The number of times to use the count signal before instead using the full CPU state check
progress_bar (ProgressBar or None) – Possible progress bar to update.
- Raises:
SpinnmanTimeoutException – If a timeout is specified and exceeded.
- write_fpga_register(fpga_num: int, register: int, value: int, board: int = 0) None [source]¶
Write a register on a FPGA of a board. The meaning of setting the register’s contents will depend on the FPGA’s configuration.
- write_memory(x: int, y: int, base_address: int, data: BinaryIO | bytes | int | str, *, n_bytes: int | None = None, offset: int = 0, cpu: int = 0, get_sum: bool = False) Tuple[int, int] [source]¶
Write to the SDRAM on the board.
- Parameters:
x (int) – The x-coordinate of the chip where the memory is to be written to
y (int) – The y-coordinate of the chip where the memory is to be written to
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 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
A string - the filename of a data file
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
If data is a str, the length of the file will be used
offset (int) – The offset from which the valid data begins
cpu (int) – The optional CPU to write to
get_sum (bool) – whether to return a checksum or 0
- Returns:
The number of bytes written, the checksum (0 if get_sum=False)
- 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 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
- write_user(x: int, y: int, p: int, user: UserRegister, value: int) None [source]¶
Write to the user N “register” for the given processor.
Note
Conventionally, user_0 usually holds the address of the table of memory regions.
- 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 x, y, p does not identify a valid processor
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
spinnman.transceiver.extendable_transceiver module¶
- class spinnman.transceiver.extendable_transceiver.ExtendableTransceiver[source]¶
Bases:
Transceiver
Support Functions to allow a Transceiver to also be an ExtendedTransceiver
If supporting these is too difficult the methods that require these may be removed.
- abstract property bmp_selector: FixedConnectionSelector[BMPConnection] | None¶
Returns the BMP selector
- Return type:
AbstractMultiConnectionProcessConnectionSelector
- abstract property scamp_connection_selector: ConnectionSelector¶
Returns the scamp selector
- Return type:
AbstractMultiConnectionProcessConnectionSelector
spinnman.transceiver.version3transceiver module¶
- class spinnman.transceiver.version3transceiver.Version3Transceiver(connections: List[Connection] | None = None, power_cycle: bool = False)[source]¶
Bases:
BaseTransceiver
Implementation of the Transceiver classes for Version 3 boards
This class should ONLY be created via by transceiver_factory.py
- 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.transceiver.version5transceiver module¶
- class spinnman.transceiver.version5transceiver.Version5Transceiver(connections: List[Connection] | None = None, power_cycle: bool = False)[source]¶
Bases:
BaseTransceiver
Implementation of the Transceiver classes for Version 5 boards
This class should ONLY be created via by transceiver_factory.py
- 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.transceiver.virtual5transceiver module¶
- class spinnman.transceiver.virtual5transceiver.Virtual5Transceiver(connections: List[Connection] | None = None, power_cycle: bool = False)[source]¶
Bases:
Version5Transceiver
Overwrites the standard Version 5 Transceiver to intercept the sending of messages.
This is just enough different to pass know tests. Extend for new tests!
- 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
- get_cpu_infos(core_subsets: CoreSubsets | None = None, states: CPUState | Iterable[CPUState] | None = None, include: bool = True) CPUInfos [source]¶
Get information about the processors on the board.
- Parameters:
core_subsets (CoreSubsets) – A set of chips and cores from which to get the information. If not specified, the information from all of the cores on all of the chips on the board are obtained.
states (None, CPUState or iterable(CPUState)) – The state or states to filter on (if any)
include (bool) – If True includes only infos in the requested state(s). If False includes only infos not in the requested state(s). Ignored if states is None.
- Returns:
The CPU information for the selected cores and States, or all cores/states if core_subsets/states is not specified
- 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_machine_details() Machine [source]¶
Get the details of the machine made up of chips on a board and how they are connected to each other.
- Returns:
A machine description
- 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 a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- read_memory(x: int, y: int, base_address: int, length: int, cpu: int = 0) bytearray [source]¶
Read some areas of memory (usually SDRAM) from the board.
- Parameters:
x (int) – The x-coordinate of the chip where the memory is to be read from
y (int) – The y-coordinate of the chip where the memory is to be read from
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
cpu (int) – the core ID used to read the memory of; should usually be 0 when reading from SDRAM, but may be other values when reading from DTCM.
- Returns:
A bytearray of data read
- 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
Module contents¶
- class spinnman.transceiver.MockableTransceiver¶
Bases:
ExtendableTransceiver
A based for Mock Transceivers
- add_cpu_information_from_core(cpu_infos: CPUInfos, x: int, y: int, p: int, states: Iterable[CPUState]) None [source]¶
Adds information about a specific processor on the board to the info
- Parameters:
cpu_infos (CPUInfos) – Info to add data for this core to
x (int) – The x-coordinate of the chip containing the processor
y (int) – The y-coordinate of the chip containing the processor
p (int) – The ID of the processor to get the information about
states (list(CPUState)) – If provided will only add the info if in one of the states
- Returns:
The CPU information for the selected core
- 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 x, y, p is not a valid processor
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- add_scamp_connections(connections: Dict[Tuple[int, int], str]) None [source]¶
Check connections to the board and store these for future use.
Note
An exception will be thrown if no initial connections can be found to the board.
- Parameters:
connections (dict((int,int),str)) – Dict of (x,`y`) to IP address
- 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
- property bmp_selector: FixedConnectionSelector[BMPConnection] | None¶
Returns the BMP selector
- Return type:
AbstractMultiConnectionProcessConnectionSelector
- clear_ip_tag(tag: int, board_address: str | None = None) None [source]¶
Clear the setting of an IP tag.
- 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 the tag is not a valid tag
If the connection cannot send SDP messages
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- clear_multicast_routes(x: int, y: int) None [source]¶
Remove all the multicast routes on a chip.
- 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
- clear_router_diagnostic_counters(x: int, y: int) None [source]¶
Clear router diagnostic information on a chip.
- 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 or a counter ID is out of range
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- control_sync(do_sync: bool) None [source]¶
Control the synchronisation of the chips.
- Parameters:
do_sync (bool) – Whether to synchronise or not
- discover_scamp_connections() None [source]¶
Find connections to the board and store these for future use.
Note
An exception will be thrown if no initial connections can be found to the board.
- 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
- execute_flood(core_subsets: CoreSubsets, executable: BinaryIO | bytes | str, app_id: int, *, n_bytes: int | None = None, wait: bool = False) None [source]¶
Start an executable running on multiple places on the board. This will be optimised based on the selected cores, but it may still require a number of communications with the board to execute.
- Parameters:
core_subsets (CoreSubsets) – Which cores on which chips to start the executable
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 * A filename of an executable
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 a str, the length of the file will be used
wait (bool) – True if the processors 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 one of the specified cores is not valid
If app_id is an invalid application ID
If a packet is received that has invalid parameters
If executable is an RawIOBase but n_bytes is not specified
If executable 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
- get_connections() Set[Connection] [source]¶
Get the currently known connections to the board, made up of those passed in to the transceiver and those that are discovered during calls to discover_connections. No further discovery is done here.
- Returns:
An iterable of connections known to the transceiver
- Return type:
- get_core_state_count(app_id: int, state: CPUState, xys: Iterable[Tuple[int, int]] | None = None) int [source]¶
Get a count of the number of cores which have a given state.
- Parameters:
- Returns:
A count of the cores with the given status
- 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 state is not a valid status
If app_id is not a valid application ID
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- get_cpu_infos(core_subsets: CoreSubsets | None = None, states: CPUState | Iterable[CPUState] | None = None, include: bool = True) CPUInfos [source]¶
Get information about the processors on the board.
- Parameters:
core_subsets (CoreSubsets) – A set of chips and cores from which to get the information. If not specified, the information from all of the cores on all of the chips on the board are obtained.
states (None, CPUState or iterable(CPUState)) – The state or states to filter on (if any)
include (bool) – If True includes only infos in the requested state(s). If False includes only infos not in the requested state(s). Ignored if states is None.
- Returns:
The CPU information for the selected cores and States, or all cores/states if core_subsets/states is not specified
- 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_iobuf(core_subsets: CoreSubsets | None = None) Iterable[IOBuffer] [source]¶
Get the contents of the IOBUF buffer for a number of processors.
- Parameters:
core_subsets (CoreSubsets) – A set of chips and cores from which to get the buffers. If not specified, the buffers from all of the cores on all of the chips on the board are obtained.
- Returns:
An iterable of the buffers, which may not be in the order of core_subsets
- Return type:
iterable(IOBuffer)
- 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_machine_details() Machine [source]¶
Get the details of the machine made up of chips on a board and how they are connected to each other.
- Returns:
A machine description
- 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 a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- get_multicast_routes(x: int, y: int, app_id: int | None = None) List[MulticastRoutingEntry] [source]¶
Get the current multicast routes set up on a chip.
- Parameters:
- Returns:
An iterable of multicast routes
- 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 a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- get_region_base_address(x: int, y: int, p: int) int [source]¶
Gets the base address of the Region Table
- Parameters:
- Returns:
The address of the Region table for the selected core
- 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 x, y, p is not a valid processor
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- get_router_diagnostics(x: int, y: int) RouterDiagnostics [source]¶
Get router diagnostic information from a chip.
- Parameters:
- Returns:
The router diagnostic information
- 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 a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- get_scamp_connection_selector() MostDirectConnectionSelector [source]¶
Returns the most direct scamp connections
- Return type:
MostDirectConnectionSelecto
- get_tags(connection: SCAMPConnection | None = None) Iterable[AbstractTag] [source]¶
Get the current set of tags that have been set on the board.
- Parameters:
connection (AbstractSCPConnection) – Connection from which the tags should be received. If not specified, all AbstractSCPConnection connections will be queried and the response will be combined.
- Returns:
An iterable of tags
- Return type:
iterable(AbstractTag)
- 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 the connection cannot send SDP messages
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- load_fixed_route(x: int, y: int, fixed_route: RoutingEntry, app_id: int) None [source]¶
Loads a fixed route routing table entry onto a chip’s router.
- Parameters:
x (int) – The x-coordinate of the chip onto which to load the routes
y (int) – The y-coordinate of the chip onto which to load the routes
fixed_route (RoutingEntry) – the route for the fixed route entry on this chip
app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
- 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 any of the routes are invalid
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- load_multicast_routes(x: int, y: int, routes: Collection[MulticastRoutingEntry], app_id: int) None [source]¶
Load a set of multicast routes on to a chip.
- Parameters:
x (int) – The x-coordinate of the chip onto which to load the routes
y (int) – The y-coordinate of the chip onto which to load the routes
routes (iterable(MulticastRoutingEntry)) – An iterable of multicast routes to load
app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
- 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 any of the routes are invalid
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- malloc_sdram(x: int, y: int, size: int, app_id: int, tag: int = 0) int [source]¶
Allocates a chunk of SDRAM on a chip on the machine.
- Parameters:
x (int) – The x-coordinate of the chip onto which to ask for memory
y (int) – The y-coordinate of the chip onto which to ask for memory
size (int) – the amount of memory to allocate in bytes
app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
tag (int) – the tag for the SDRAM, a 8-bit (chip-wide) tag that can be looked up by a SpiNNaker application to discover the address of the allocated block. If 0 then no tag is applied.
- Returns:
the base address of the allocated memory
- Return type:
- read_bmp_version(board: int) VersionInfo [source]¶
Read the BMP version.
- Parameters:
board (int) – which board to request the data from
- Returns:
the version_info from the BMP
- read_fixed_route(x: int, y: int, app_id: int) RoutingEntry [source]¶
Reads a fixed route routing table entry from a chip’s router.
- Parameters:
- Returns:
the route as a fixed route entry
- read_fpga_register(fpga_num: int, register: int, board: int = 0) int [source]¶
Read a register on a FPGA of a board. The meaning of the register’s contents will depend on the FPGA’s configuration.
- read_memory(x: int, y: int, base_address: int, length: int, cpu: int = 0) bytearray [source]¶
Read some areas of memory (usually SDRAM) from the board.
- Parameters:
x (int) – The x-coordinate of the chip where the memory is to be read from
y (int) – The y-coordinate of the chip where the memory is to be read from
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
cpu (int) – the core ID used to read the memory of; should usually be 0 when reading from SDRAM, but may be other values when reading from DTCM.
- Returns:
A bytearray of data read
- 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
- read_user(x: int, y: int, p: int, user: UserRegister) int [source]¶
Get the contents of the this user register for the given processor.
Note
Conventionally, user_0 usually holds the address of the table of memory regions.
- Parameters:
- 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 x, y, p does not identify a valid processor
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- read_word(x: int, y: int, base_address: int, cpu: int = 0) int [source]¶
Read a word (usually of SDRAM) from the board.
- Parameters:
x (int) – The x-coordinate of the chip where the word is to be read from
y (int) – The y-coordinate of the chip where the word is to be read from
base_address (int) – The address (usually in SDRAM) where the word to be read starts
cpu (int) – the core ID used to read the word; should usually be 0 when reading from SDRAM, but may be other values when reading from DTCM.
- Returns:
The unsigned integer value at
base_address
- 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 or base_address is invalid
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- property scamp_connection_selector: ConnectionSelector¶
Returns the scamp selector
- Return type:
AbstractMultiConnectionProcessConnectionSelector
- send_chip_update_provenance_and_exit(x: int, y: int, p: int) None [source]¶
Sends a signal to update the provenance and exit
- send_sdp_message(message: SDPMessage, connection: SDPConnection | None = None) None [source]¶
Sends an SDP message using one of the connections.
- Parameters:
message (SDPMessage) – The message to send
connection (SDPConnection) – An optional connection to use
- send_signal(app_id: int, signal: Signal) None [source]¶
Send a signal to an application.
- 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 signal is not a valid signal
If app_id is not a valid application ID
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- set_ip_tag(ip_tag: IPTag, use_sender: bool = False) None [source]¶
Set up an IP tag.
- 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 the IP tag fields are incorrect
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- set_reverse_ip_tag(reverse_ip_tag: ReverseIPTag) None [source]¶
Set up a reverse IP tag.
- Parameters:
reverse_ip_tag (ReverseIPTag) –
The reverse tag to set up.
Note
The board_address field can be None, in which case, the tag will be assigned to all boards.
- 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 the reverse IP tag fields are incorrect
If a packet is received that has invalid parameters
- If the UDP port is one that is already used by SpiNNaker for
system functions
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- set_router_diagnostic_filter(x: int, y: int, position: int, diagnostic_filter: DiagnosticFilter) None [source]¶
Sets a router diagnostic filter in a router.
- Parameters:
x (int) – The X address of the router in which this filter is being set.
y (int) – The Y address of the router in which this filter is being set.
position (int) – The position in the list of filters where this filter is to be added.
diagnostic_filter (DiagnosticFilter) –
The diagnostic filter being set in the placed, between 0 and 15.
Note
Positions 0 to 11 are used by the default filters, and setting these positions will result in a warning.
- 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 position is less than 0 or more than 15
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- stop_application(app_id: int) None [source]¶
Sends a stop request for an app_id.
- Parameters:
app_id (int) – The ID of the application to send to
- 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 app_id is not a valid application ID
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- update_provenance_and_exit(x: int, y: int, p: int) None [source]¶
Sends a command to update provenance and exit
- wait_for_cores_to_be_in_state(all_core_subsets: CoreSubsets, app_id: int, cpu_states: CPUState | Iterable[CPUState], *, timeout: float | None = None, time_between_polls: float = 0.1, error_states: FrozenSet[CPUState] = frozenset({CPUState.RUN_TIME_EXCEPTION, CPUState.WATCHDOG}), counts_between_full_check: int = 100, progress_bar: ProgressBar | None = None) None [source]¶
Waits for the specified cores running the given application to be in some target state or states. Handles failures.
- Parameters:
all_core_subsets (CoreSubsets) – the cores to check are in a given sync state
app_id (int) – the application ID that being used by the simulation
cpu_states (CPUState or iterable(CPUState)) – The expected states once the applications are ready; success is when each application is in one of these states
timeout (float) – The amount of time to wait in seconds for the cores to reach one of the states
time_between_polls (float) – Time between checking the state
error_states (set(CPUState)) – Set of states that the application can be in that indicate an error, and so should raise an exception
counts_between_full_check (int) – The number of times to use the count signal before instead using the full CPU state check
progress_bar (ProgressBar or None) – Possible progress bar to update.
- Raises:
SpinnmanTimeoutException – If a timeout is specified and exceeded.
- write_fpga_register(fpga_num: int, register: int, value: int, board: int = 0) None [source]¶
Write a register on a FPGA of a board. The meaning of setting the register’s contents will depend on the FPGA’s configuration.
- write_memory(x: int, y: int, base_address: int, data: BinaryIO | bytes | int | str, *, n_bytes: int | None = None, offset: int = 0, cpu: int = 0, get_sum: bool = False) Tuple[int, int] [source]¶
Write to the SDRAM on the board.
- Parameters:
x (int) – The x-coordinate of the chip where the memory is to be written to
y (int) – The y-coordinate of the chip where the memory is to be written to
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 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
A string - the filename of a data file
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
If data is a str, the length of the file will be used
offset (int) – The offset from which the valid data begins
cpu (int) – The optional CPU to write to
get_sum (bool) – whether to return a checksum or 0
- Returns:
The number of bytes written, the checksum (0 if get_sum=False)
- 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 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
- write_user(x: int, y: int, p: int, user: UserRegister, value: int) None [source]¶
Write to the user N “register” for the given processor.
Note
Conventionally, user_0 usually holds the address of the table of memory regions.
- 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 x, y, p does not identify a valid processor
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- written_memory¶
- class spinnman.transceiver.Transceiver¶
Bases:
object
An encapsulation of various communications with the SpiNNaker board.
The methods of this class are designed to be thread-safe (provided they do not access a BMP, as access to those is never thread-safe); thus you can make multiple calls to the same (or different) methods from multiple threads and expect each call to work as if it had been called sequentially, although the order of returns is not guaranteed.
Note
With multiple connections to the board, using multiple threads in this way may result in an increase in the overall speed of operation, since the multiple calls may be made separately over the set of given connections.
- abstract add_cpu_information_from_core(cpu_infos: CPUInfos, x: int, y: int, p: int, states: Iterable[CPUState]) None [source]¶
Adds information about a specific processor on the board to the info
- Parameters:
cpu_infos (CPUInfos) – Info to add data for this core to
x (int) – The x-coordinate of the chip containing the processor
y (int) – The y-coordinate of the chip containing the processor
p (int) – The ID of the processor to get the information about
states (list(CPUState)) – If provided will only add the info if in one of the states
- Returns:
The CPU information for the selected core
- 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 x, y, p is not a valid processor
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract add_scamp_connections(connections: Dict[Tuple[int, int], str]) None [source]¶
Check connections to the board and store these for future use.
Note
An exception will be thrown if no initial connections can be found to the board.
- Parameters:
connections (dict((int,int),str)) – Dict of (x,`y`) to IP address
- 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
- abstract clear_ip_tag(tag: int, board_address: str | None = None) None [source]¶
Clear the setting of an IP tag.
- 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 the tag is not a valid tag
If the connection cannot send SDP messages
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract clear_multicast_routes(x: int, y: int) None [source]¶
Remove all the multicast routes on a chip.
- 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
- abstract clear_router_diagnostic_counters(x: int, y: int) None [source]¶
Clear router diagnostic information on a chip.
- 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 or a counter ID is out of range
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract control_sync(do_sync: bool) None [source]¶
Control the synchronisation of the chips.
- Parameters:
do_sync (bool) – Whether to synchronise or not
- abstract discover_scamp_connections() None [source]¶
Find connections to the board and store these for future use.
Note
An exception will be thrown if no initial connections can be found to the board.
- 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
- abstract execute_flood(core_subsets: CoreSubsets, executable: BinaryIO | bytes | str, app_id: int, *, n_bytes: int | None = None, wait: bool = False) None [source]¶
Start an executable running on multiple places on the board. This will be optimised based on the selected cores, but it may still require a number of communications with the board to execute.
- Parameters:
core_subsets (CoreSubsets) – Which cores on which chips to start the executable
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 * A filename of an executable
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 a str, the length of the file will be used
wait (bool) – True if the processors 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 one of the specified cores is not valid
If app_id is an invalid application ID
If a packet is received that has invalid parameters
If executable is an RawIOBase but n_bytes is not specified
If executable 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
- abstract get_connections() Set[Connection] [source]¶
Get the currently known connections to the board, made up of those passed in to the transceiver and those that are discovered during calls to discover_connections. No further discovery is done here.
- Returns:
An iterable of connections known to the transceiver
- Return type:
- abstract get_core_state_count(app_id: int, state: CPUState, xys: Iterable[Tuple[int, int]] | None = None) int [source]¶
Get a count of the number of cores which have a given state.
- Parameters:
- Returns:
A count of the cores with the given status
- 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 state is not a valid status
If app_id is not a valid application ID
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract get_cpu_infos(core_subsets: CoreSubsets | None = None, states: CPUState | Iterable[CPUState] | None = None, include: bool = True) CPUInfos [source]¶
Get information about the processors on the board.
- Parameters:
core_subsets (CoreSubsets) – A set of chips and cores from which to get the information. If not specified, the information from all of the cores on all of the chips on the board are obtained.
states (None, CPUState or iterable(CPUState)) – The state or states to filter on (if any)
include (bool) – If True includes only infos in the requested state(s). If False includes only infos not in the requested state(s). Ignored if states is None.
- Returns:
The CPU information for the selected cores and States, or all cores/states if core_subsets/states is not specified
- 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
- abstract get_iobuf(core_subsets: CoreSubsets | None = None) Iterable[IOBuffer] [source]¶
Get the contents of the IOBUF buffer for a number of processors.
- Parameters:
core_subsets (CoreSubsets) – A set of chips and cores from which to get the buffers. If not specified, the buffers from all of the cores on all of the chips on the board are obtained.
- Returns:
An iterable of the buffers, which may not be in the order of core_subsets
- Return type:
iterable(IOBuffer)
- 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
- abstract get_machine_details() Machine [source]¶
Get the details of the machine made up of chips on a board and how they are connected to each other.
- Returns:
A machine description
- 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 a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract get_multicast_routes(x: int, y: int, app_id: int | None = None) List[MulticastRoutingEntry] [source]¶
Get the current multicast routes set up on a chip.
- Parameters:
- Returns:
An iterable of multicast routes
- 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 a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract get_region_base_address(x: int, y: int, p: int) int [source]¶
Gets the base address of the Region Table
- Parameters:
- Returns:
The address of the Region table for the selected core
- 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 x, y, p is not a valid processor
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract get_router_diagnostics(x: int, y: int) RouterDiagnostics [source]¶
Get router diagnostic information from a chip.
- Parameters:
- Returns:
The router diagnostic information
- 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 a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract get_scamp_connection_selector() MostDirectConnectionSelector [source]¶
Returns the most direct scamp connections
- Return type:
MostDirectConnectionSelecto
- abstract get_tags(connection: SCAMPConnection | None = None) Iterable[AbstractTag] [source]¶
Get the current set of tags that have been set on the board.
- Parameters:
connection (AbstractSCPConnection) – Connection from which the tags should be received. If not specified, all AbstractSCPConnection connections will be queried and the response will be combined.
- Returns:
An iterable of tags
- Return type:
iterable(AbstractTag)
- 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 the connection cannot send SDP messages
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract load_fixed_route(x: int, y: int, fixed_route: RoutingEntry, app_id: int) None [source]¶
Loads a fixed route routing table entry onto a chip’s router.
- Parameters:
x (int) – The x-coordinate of the chip onto which to load the routes
y (int) – The y-coordinate of the chip onto which to load the routes
fixed_route (RoutingEntry) – the route for the fixed route entry on this chip
app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
- 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 any of the routes are invalid
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract load_multicast_routes(x: int, y: int, routes: Collection[MulticastRoutingEntry], app_id: int) None [source]¶
Load a set of multicast routes on to a chip.
- Parameters:
x (int) – The x-coordinate of the chip onto which to load the routes
y (int) – The y-coordinate of the chip onto which to load the routes
routes (iterable(MulticastRoutingEntry)) – An iterable of multicast routes to load
app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
- 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 any of the routes are invalid
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract malloc_sdram(x: int, y: int, size: int, app_id: int, tag: int = 0) int [source]¶
Allocates a chunk of SDRAM on a chip on the machine.
- Parameters:
x (int) – The x-coordinate of the chip onto which to ask for memory
y (int) – The y-coordinate of the chip onto which to ask for memory
size (int) – the amount of memory to allocate in bytes
app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
tag (int) – the tag for the SDRAM, a 8-bit (chip-wide) tag that can be looked up by a SpiNNaker application to discover the address of the allocated block. If 0 then no tag is applied.
- Returns:
the base address of the allocated memory
- Return type:
- abstract read_bmp_version(board: int) VersionInfo [source]¶
Read the BMP version.
- Parameters:
board (int) – which board to request the data from
- Returns:
the version_info from the BMP
- abstract read_fixed_route(x: int, y: int, app_id: int) RoutingEntry [source]¶
Reads a fixed route routing table entry from a chip’s router.
- Parameters:
- Returns:
the route as a fixed route entry
- abstract read_fpga_register(fpga_num: int, register: int, board: int = 0) int [source]¶
Read a register on a FPGA of a board. The meaning of the register’s contents will depend on the FPGA’s configuration.
- abstract read_memory(x: int, y: int, base_address: int, length: int, cpu: int = 0) bytearray [source]¶
Read some areas of memory (usually SDRAM) from the board.
- Parameters:
x (int) – The x-coordinate of the chip where the memory is to be read from
y (int) – The y-coordinate of the chip where the memory is to be read from
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
cpu (int) – the core ID used to read the memory of; should usually be 0 when reading from SDRAM, but may be other values when reading from DTCM.
- Returns:
A bytearray of data read
- 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
- abstract read_user(x: int, y: int, p: int, user: UserRegister) int [source]¶
Get the contents of the this user register for the given processor.
Note
Conventionally, user_0 usually holds the address of the table of memory regions.
- Parameters:
- 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 x, y, p does not identify a valid processor
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract read_word(x: int, y: int, base_address: int, cpu: int = 0) int [source]¶
Read a word (usually of SDRAM) from the board.
- Parameters:
x (int) – The x-coordinate of the chip where the word is to be read from
y (int) – The y-coordinate of the chip where the word is to be read from
base_address (int) – The address (usually in SDRAM) where the word to be read starts
cpu (int) – the core ID used to read the word; should usually be 0 when reading from SDRAM, but may be other values when reading from DTCM.
- Returns:
The unsigned integer value at
base_address
- 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 or base_address is invalid
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract send_chip_update_provenance_and_exit(x: int, y: int, p: int) None [source]¶
Sends a signal to update the provenance and exit
- abstract send_sdp_message(message: SDPMessage, connection: SDPConnection | None = None) None [source]¶
Sends an SDP message using one of the connections.
- Parameters:
message (SDPMessage) – The message to send
connection (SDPConnection) – An optional connection to use
- abstract send_signal(app_id: int, signal: Signal) None [source]¶
Send a signal to an application.
- 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 signal is not a valid signal
If app_id is not a valid application ID
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract set_ip_tag(ip_tag: IPTag, use_sender: bool = False) None [source]¶
Set up an IP tag.
- 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 the IP tag fields are incorrect
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract set_reverse_ip_tag(reverse_ip_tag: ReverseIPTag) None [source]¶
Set up a reverse IP tag.
- Parameters:
reverse_ip_tag (ReverseIPTag) –
The reverse tag to set up.
Note
The board_address field can be None, in which case, the tag will be assigned to all boards.
- 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 the reverse IP tag fields are incorrect
If a packet is received that has invalid parameters
- If the UDP port is one that is already used by SpiNNaker for
system functions
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract set_router_diagnostic_filter(x: int, y: int, position: int, diagnostic_filter: DiagnosticFilter) None [source]¶
Sets a router diagnostic filter in a router.
- Parameters:
x (int) – The X address of the router in which this filter is being set.
y (int) – The Y address of the router in which this filter is being set.
position (int) – The position in the list of filters where this filter is to be added.
diagnostic_filter (DiagnosticFilter) –
The diagnostic filter being set in the placed, between 0 and 15.
Note
Positions 0 to 11 are used by the default filters, and setting these positions will result in a warning.
- 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 position is less than 0 or more than 15
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract stop_application(app_id: int) None [source]¶
Sends a stop request for an app_id.
- Parameters:
app_id (int) – The ID of the application to send to
- 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 app_id is not a valid application ID
If a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- abstract update_provenance_and_exit(x: int, y: int, p: int) None [source]¶
Sends a command to update provenance and exit
- abstract wait_for_cores_to_be_in_state(all_core_subsets: CoreSubsets, app_id: int, cpu_states: CPUState | Iterable[CPUState], *, timeout: float | None = None, time_between_polls: float = 0.1, error_states: FrozenSet[CPUState] = frozenset({CPUState.RUN_TIME_EXCEPTION, CPUState.WATCHDOG}), counts_between_full_check: int = 100, progress_bar: ProgressBar | None = None) None [source]¶
Waits for the specified cores running the given application to be in some target state or states. Handles failures.
- Parameters:
all_core_subsets (CoreSubsets) – the cores to check are in a given sync state
app_id (int) – the application ID that being used by the simulation
cpu_states (CPUState or iterable(CPUState)) – The expected states once the applications are ready; success is when each application is in one of these states
timeout (float) – The amount of time to wait in seconds for the cores to reach one of the states
time_between_polls (float) – Time between checking the state
error_states (set(CPUState)) – Set of states that the application can be in that indicate an error, and so should raise an exception
counts_between_full_check (int) – The number of times to use the count signal before instead using the full CPU state check
progress_bar (ProgressBar or None) – Possible progress bar to update.
- Raises:
SpinnmanTimeoutException – If a timeout is specified and exceeded.
- abstract write_fpga_register(fpga_num: int, register: int, value: int, board: int = 0) None [source]¶
Write a register on a FPGA of a board. The meaning of setting the register’s contents will depend on the FPGA’s configuration.
- abstract write_memory(x: int, y: int, base_address: int, data: BinaryIO | bytes | int | str, *, n_bytes: int | None = None, offset: int = 0, cpu: int = 0, get_sum: bool = False) Tuple[int, int] [source]¶
Write to the SDRAM on the board.
- Parameters:
x (int) – The x-coordinate of the chip where the memory is to be written to
y (int) – The y-coordinate of the chip where the memory is to be written to
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 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
A string - the filename of a data file
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
If data is a str, the length of the file will be used
offset (int) – The offset from which the valid data begins
cpu (int) – The optional CPU to write to
get_sum (bool) – whether to return a checksum or 0
- Returns:
The number of bytes written, the checksum (0 if get_sum=False)
- 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 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
- abstract write_user(x: int, y: int, p: int, user: UserRegister, value: int) None [source]¶
Write to the user N “register” for the given processor.
Note
Conventionally, user_0 usually holds the address of the table of memory regions.
- 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 x, y, p does not identify a valid processor
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- spinnman.transceiver.create_transceiver_from_connections(connections: List[Connection], virtual: bool = False, power_cycle: bool = False, extended: bool = False) Transceiver ¶
Create a Transceiver with these connections
- Parameters:
connections (list(Connection)) – An iterable of connections to the board. If not specified, no communication will be possible until connections are found.
virtual (bool) – If True will return a virtual Transceiver
power_cycle (bool) – If True will power cycle the machine
extended (bool)
- Returns:
The created transceiver
- 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 a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange
- spinnman.transceiver.create_transceiver_from_hostname(hostname: str | None, *, bmp_connection_data: BMPConnectionData | None = None, auto_detect_bmp: bool = False, power_cycle: bool = False, extended: bool = False) Transceiver ¶
Create a Transceiver by creating a
UDPConnection
to the given hostname on port 17893 (the default SCAMP port), and aBootConnection
on port 54321 (the default boot port), optionally discovering any additional links using the UDPConnection, and then returning the transceiver created with the conjunction of the created UDPConnection and the discovered connections.- Parameters:
hostname (str or None) – The hostname or IP address of the board or None if only the BMP connections are of interest
bmp_connection_data (BMPConnectionData) – the details of the BMP connections used to boot multi-board systems
auto_detect_bmp (bool) –
True
if the BMP of version 4 or 5 boards should be automatically determined from the board IP addresspower_cycle (bool) – If True will power cycle the machine
scamp_connections – the list of connections used for SCAMP communications
extended (bool) – If True will return an Extended version of the Transceiver
- Returns:
The created transceiver
- 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 a packet is received that has invalid parameters
SpinnmanUnexpectedResponseCodeException – If a response indicates an error during the exchange