Functions
create_transceiver_from_hostname(hostname[, ...]) | Create a Transceiver by creating a UDPConnection to the given hostname on port 17893 (the default SCAMP port), and a UDPBootConnection on port 54321 (the default boot port), |
gethostbyname((host) -> address) | Return the IP address (a string of the form ‘255.255.255.255’) for a host. |
inet_aton(...) | Convert an IP address in string format (123.45.67.89) to the 32-bit packed binary format used in low-level network functions. |
Parameters: |
|
---|---|
Returns: | The created transceiver |
Return type: | |
Raises: |
|
Return the IP address (a string of the form ‘255.255.255.255’) for a host.
Convert an IP address in string format (123.45.67.89) to the 32-bit packed binary format used in low-level network functions.
Bases: object
An encapsulation of various communications with the spinnaker board.
The methods of this class are designed to be 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 also that 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.
Parameters: |
|
---|---|
Raises: |
|
Methods
boot_board(board_version) | Attempt to boot the board. |
clear_ip_tag(tag[, connection, board_address]) | Clear the setting of an ip tag |
clear_multicast_routes(x, y) | Remove all the multicast routes on a chip |
clear_router_diagnostic_counters(x, y[, ...]) | Clear router diagnostic information om a chip |
close([close_original_connections]) | Close the transceiver and any threads that are running |
discover_scamp_connections() | Find connections to the board and store these for future use. |
ensure_board_is_ready(board_version[, n_retries]) | Ensure that the board is ready to interact with this version of the transceiver. |
execute(x, y, processors, executable, app_id) | Start an executable running on a single core |
execute_flood(core_subsets, executable, app_id) | Start an executable running on multiple places on the board. |
get_connections([include_boot_connection]) | 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. |
get_core_state_count(app_id, state) | Get a count of the number of cores which have a given state |
get_cpu_information([core_subsets]) | Get information about the processors on the board |
get_cpu_information_from_core(x, y, p) | Get information about a specific processor on the board |
get_iobuf([core_subsets]) | Get the contents of the IOBUF buffer for a number of processors |
get_iobuf_from_core(x, y, p) | Get the contents of IOBUF for a given core |
get_machine_details() | Get the details of the machine made up of chips on a board and how they are connected to each other. |
get_machine_dimensions() | Get the maximum chip x-coordinate and maximum chip y-coordinate of the chips in the machine |
get_multicast_routes(x, y[, app_id]) | Get the current multicast routes set up on a chip |
get_router_diagnostic_filter(x, y, position) | Gets a router diagnostic filter from a router |
get_router_diagnostics(x, y) | Get router diagnostic information from a chip |
get_scamp_version([n_retries, timeout]) | Get the version of scamp which is running on the board |
get_tags([connection]) | Get the current set of tags that have been set on the board |
get_user_0_register_address_from_core(x, y, p) | Get the address of user 0 for a given processor on the board |
is_connected([connection]) | Determines if the board can be contacted |
load_multicast_routes(x, y, routes, app_id) | Load a set of multicast routes on to a chip |
locate_spinnaker_connection_for_board_address(...) | Find a connection that matches the given board IP address |
read_memory(x, y, base_address, length) | Read some areas of SDRAM from the board |
read_memory_return_byte_array(x, y, ...) | Read some areas of SDRAM from the board |
read_neighbour_memory(x, y, cpu, link, ...) | Read some areas of memory on a neighbouring chip using a LINK_READ SCP command. |
receive_multicast_message(x, y[, timeout, ...]) | Receives a multicast message from the board |
register_listener(callback, recieve_port_no, ...) | Register a callback for a certain type of traffic |
send_eieio_command_message(message[, connection]) | Sends a EIEIO command message using one of the connections. |
send_multicast_message(x, y, multicast_message) | Sends a multicast message to the board |
send_scp_message(message[, retry_codes, ...]) | Sends an SCP message, and gets a response |
send_sdp_message(message[, connection]) | Sends a EIEIO command message using one of the connections. |
send_signal(app_id, signal) | Send a signal to an application |
set_ip_tag(ip_tag) | Set up an ip tag |
set_leds(x, y, cpu, led_states) | Set LED states. |
set_reverse_ip_tag(reverse_ip_tag) | Set up a reverse ip tag |
set_router_diagnostic_filter(x, y, position, ...) | Sets a router diagnostic filter in a router |
stop_application(app_id) | Sends a stop request for an app_id |
write_memory(x, y, base_address, data[, n_bytes]) | Write to the SDRAM on the board |
write_memory_flood(base_address, data[, n_bytes]) | Write to the SDRAM of all chips. |
write_neighbour_memory(x, y, cpu, link, ...) | Write to the memory of a neighbouring chip using a LINK_READ SCP command. |
Detailed Methods
Attempt to boot the board. No check is performed to see if the board is already booted.
Parameters: | board_version (int) – The version of the board e.g. 3 for a SpiNN-3 board or 5 for a SpiNN-5 board. |
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|
Clear the setting of an ip tag
Parameters: |
|
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|
Remove all the multicast routes on a chip
Parameters: |
|
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|
Clear router diagnostic information om a chip
Parameters: |
|
---|---|
Returns: | None |
Return type: | Nothing is returned |
Raises: |
|
Close the transceiver and any threads that are running
Parameters: | close_original_connections – If True, the original connections passed to the transceiver in the constructor are also closed. If False, only newly discovered connections are closed. |
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises None: | No known exceptions are raised |
Find connections to the board and store these for future use. Note that connections can be empty, in which case another local discovery mechanism will be used. Note that an exception will be thrown if no initial connections can be found to the board.
Returns: | An iterable of discovered connections, not including the initially given connections in the constructor |
---|---|
Return type: | iterable of spinnman.connections.abstract_connection.AbstractConnection |
Raises: |
|
Ensure that the board is ready to interact with this version of the transceiver. Boots the board if not already booted and verifies that the version of SCAMP running is compatible with this transceiver.
Parameters: |
|
---|---|
Returns: | The version identifier |
Return type: | |
Raise: | spinnman.exceptions.SpinnmanIOException: * If there is a problem booting the board * If the version of software on the board is not compatible with this transceiver |
Start an executable running on a single core
Parameters: |
|
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|
Start an executable running on multiple places on the board. This will be optimized based on the selected cores, but it may still require a number of communications with the board to execute.
Parameters: |
|
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|
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.
Parameters: | include_boot_connection (bool) – this parameter signals if the returned list of connections should include also the boot connection to SpiNNaker |
---|---|
Returns: | An iterable of connections known to the transceiver |
Return type: | iterable of spinnman.connections.abstract_connection.AbstractConnection |
Raises None: | No known exceptions are raised |
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: | int |
Raises: |
|
Get information about the processors on the board
Parameters: | core_subsets (spinnman.model.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 |
---|---|
Returns: | An iterable of the cpu information for the selected cores, or all cores if core_subsets is not specified |
Return type: | iterable of spinnman.model.cpu_info.CPUInfo |
Raises: |
|
Get information about a specific processor on the board
Parameters: |
|
---|---|
Returns: | The cpu information for the selected core |
Return type: | |
Raises: |
|
Get the contents of the IOBUF buffer for a number of processors
Parameters: | core_subsets (spinnman.model.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 of spinnman.model.io_buffer.IOBuffer |
Raises: |
|
Get the contents of IOBUF for a given core
Parameters: |
|
---|---|
Returns: | An IOBUF buffer |
Return type: | |
Raises: |
|
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: |
|
Get the maximum chip x-coordinate and maximum chip y-coordinate of the chips in the machine
Returns: | The dimensions of the machine |
---|---|
Return type: | |
Raises: |
|
Get the current multicast routes set up on a chip
Parameters: |
|
---|---|
Returns: | An iterable of multicast routes |
Return type: | iterable of spinnman.model.multicast_routing_entry.MulticastRoute |
Raises: |
|
Gets a router diagnostic filter from a router
Parameters: |
|
---|---|
Returns: | The diagnostic filter read |
Return type: | |
Raises: |
|
Get router diagnostic information from a chip
Parameters: |
|
---|---|
Returns: | The router diagnostic information |
Return type: | |
Raises: |
|
Get the version of scamp which is running on the board
Parameters: |
|
---|---|
Returns: | The version identifier |
Return type: | |
Raises: |
|
Get the current set of tags that have been set on the board
Parameters: | connection (spinnman.connections.abstract_scp_sender.AbstractSCPSender) – Connection from which the tags should be received. If not specified, all SCPSender connections will be queried and the response will be combined. |
---|---|
Returns: | An iterable of tags |
Return type: | iterable of spinn_machine.tags.abstract_tag.AbstractTag |
Raises: |
|
Get the address of user 0 for a given processor on the board
Parameters: |
|
---|
:return:The address for user 0 register for this processor :rtype: int :raise spinnman.exceptions.SpinnmanInvalidPacketException: If a packet is received that is not in the valid format :raise spinnman.exceptions.SpinnmanInvalidParameterException:
- If x, y, p is not a valid processor
- If a packet is received that has invalid parameters
Raises spinnman.exceptions.SpinnmanUnexpectedResponseCodeException: | |
---|---|
If a response indicates an error during the exchange |
Determines if the board can be contacted
Parameters: | connection (spinnman.connections.abstract_connection.AbstractConnection) – The connection which is to be tested. If none, all 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: | bool |
Raises None: | No known exceptions are raised |
Load a set of multicast routes on to a chip
Parameters: |
|
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|
Find a connection that matches the given board IP address
Parameters: | board_address (str) – The IP address of the ethernet connection on the baord |
---|---|
Returns: | A connection for the given IP address, or None if no such connection exists |
Return type: | spinnman.connections.udp_packet_connections.udp_spinnaker_connection.UDPSpinnakerConnection |
Read some areas of SDRAM from the board
Parameters: |
|
---|---|
Returns: | An iterable of chunks of data read in order |
Return type: | iterable of bytearray |
Raises: |
|
Read some areas of SDRAM from the board
Parameters: |
|
---|---|
Returns: | An full bytearray of data read in order |
Return type: | bytearray |
Raises: |
|
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.
Parameters: |
|
---|
number) :type link: int :param base_address: The address in SDRAM where the region of memory to be read starts :type base_address: int :param length: The length of the data to be read in bytes :type length: int :return: An iterable of chunks of data read in order :rtype: iterable of bytearray :raise spinnman.exceptions.SpinnmanIOException: If there is an error communicating with the board :raise spinnman.exceptions.SpinnmanInvalidPacketException: If a packet is received that is not in the valid format :raise spinnman.exceptions.SpinnmanInvalidParameterException:
- If one of x, y, p, base_address or length is invalid
- If a packet is received that has invalid parameters
Raises spinnman.exceptions.SpinnmanUnexpectedResponseCodeException: | |
---|---|
If a response indicates an error during the exchange |
Receives a multicast message from the board
Parameters: |
|
---|---|
Returns: | The received message |
Return type: | |
Raises: |
|
Register a callback for a certain type of traffic
Parameters: |
|
---|
Sends a EIEIO command message using one of the connections.
Parameters: |
|
---|---|
Returns: | None |
Sends a multicast message to the board
Parameters: |
|
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|
Sends an SCP message, and gets a response
Parameters: |
|
---|---|
Returns: | The received response, or the callback if get_callback is True |
Return type: | spinnman.messages.scp.abstract_scp_response.AbstractSCPResponse |
Raises: |
|
Sends a EIEIO command message using one of the connections.
Parameters: |
|
---|---|
Returns: | None |
Send a signal to an application
Parameters: |
|
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|
Set up an ip tag
Parameters: | ip_tag (spinn_machine.tags.iptag.IPTag) – The tag to set up; note board_address can be None, in which case, the tag will be assigned to all boards |
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|
Set LED states. :param x: The x-coordinate of the chip on which to set the LEDs :type x: int :param y: The x-coordinate of the chip on which to set the LEDs :type y: int :param cpu: The CPU of the chip on which to set the LEDs :type cpu: int :param led_states: A dictionary mapping LED index to state with 0 being
off, 1 on and 2 inverted.
Returns: | Nothing is returned |
---|---|
Return type: | None |
Raises: |
|
Set up a reverse ip tag
Parameters: | reverse_ip_tag (spinn_machine.tags.reverse_ip_tag.ReverseIPTag) – The reverse tag to set up; note board_address can be None, in which case, the tag will be assigned to all boards |
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|
Sets a router diagnostic filter in a router
Parameters: |
|
---|---|
Returns: | None |
Raises: |
|
Sends a stop request for an app_id
Parameters: | app_id (int) – The id of the application to send to |
---|---|
Raises: |
|
Write to the SDRAM on the board
Parameters: |
|
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|
Write to the SDRAM of all chips.
Parameters: |
|
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|
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.
Parameters: |
|
---|
number) :type link: int :param base_address: The address in SDRAM where the region of memory is to be written :type base_address: int :param data: The data to write. Should be one of the following:
- An instance of AbstractDataReader
- A bytearray
- A single integer - will be written using little-endian byte ordering
Parameters: | n_bytes (int) – The amount of data to be written in bytes. If not specified: * If data is an AbstractDataReader, 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 |
---|---|
Returns: | Nothing is returned |
Return type: | None |
Raises: |
|