Previous topic

spinnman.reports module

This Page

spinnman.transceiver module

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.
spinnman.transceiver.create_transceiver_from_hostname(hostname, ignore_chips=None, ignore_cores=None, max_core_id=None)[source]
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),
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) – The hostname or IP address of the board
  • ignore_chips (spinnman.model.core_subsets.CoreSubsets) – An optional set of chips to ignore in the machine. Requests for a “machine” will have these chips excluded, as if they never existed. The processor_ids of the specified chips are ignored.
  • ignore_cores (spinnman.model.core_subsets.CoreSubsets) – An optional set of cores to ignore in the machine. Requests for a “machine” will have these cores excluded, as if they never existed.
  • max_core_id (int) – The maximum core id in any discovered machine. Requests for a “machine” will only have core ids up to this value.
Returns:

The created transceiver

Return type:

spinnman.transceiver.Transceiver

Raises:
spinnman.transceiver.gethostbyname(host) → address

Return the IP address (a string of the form ‘255.255.255.255’) for a host.

spinnman.transceiver.inet_aton(string) → packed 32-bit IP representation

Convert an IP address in string format (123.45.67.89) to the 32-bit packed binary format used in low-level network functions.

class spinnman.transceiver.Transceiver(connections=None, ignore_chips=None, ignore_cores=None, max_core_id=None, shut_down_connections=False, n_scp_threads=16, n_other_threads=16)[source]

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:
  • connections (iterable of spinnman.connections.abstract_connection.AbstractConnection) – An iterable of connections to the board. If not specified, no communication will be possible until connections are found.
  • ignore_chips (spinnman.model.core_subsets.CoreSubsets) – An optional set of chips to ignore in the machine. Requests for a “machine” will have these chips excluded, as if they never existed. The processor_ids of the specified chips are ignored.
  • ignore_cores (spinnman.model.core_subsets.CoreSubsets) – An optional set of cores to ignore in the machine. Requests for a “machine” will have these cores excluded, as if they never existed.
  • max_core_id (int) – The maximum core id in any discovered machine. Requests for a “machine” will only have core ids up to and including this value.
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

boot_board(board_version)[source]

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_ip_tag(tag, connection=None, board_address=None)[source]

Clear the setting of an ip tag

Parameters:
  • tag (int) – The tag id
  • connection (spinnman.connections.abstract_scp_sender.AbstractSCPSender) – Connection where the tag should be cleard. If not specified, all SCPSender connections will send the message to clear the tag
  • board_address – Board address where the tag should be cleared. If not specified, all SCPSender connections will send the message to clear the tag
Returns:

Nothing is returned

Return type:

None

Raises:
clear_multicast_routes(x, y)[source]

Remove all the multicast routes on a chip

Parameters:
  • x (int) – The x-coordinate of the chip on which to clear the routes
  • y (int) – The y-coordinate of the chip on which to clear the routes
Returns:

Nothing is returned

Return type:

None

Raises:
clear_router_diagnostic_counters(x, y, enable=True, counter_ids=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])[source]

Clear router diagnostic information om a chip

Parameters:
  • x (int) – The x-coordinate of the chip
  • y (int) – The y-coordinate of the chip
  • enable (bool) – True (default) if the counters should be enabled
  • counter_ids (array-like of int) – The ids of the counters to reset (all by default) and enable if enable is True; each must be between 0 and 15
Returns:

None

Return type:

Nothing is returned

Raises:
close(close_original_connections=True)[source]

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
discover_scamp_connections()[source]

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_board_is_ready(board_version, n_retries=3)[source]

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:
  • board_version (int) – The version of the board e.g. 3 for a SpiNN-3 board or 5 for a SpiNN-5 board.
  • n_retries (int) – The number of times to retry booting
Returns:

The version identifier

Return type:

spinnman.model.version_info.VersionInfo

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

execute(x, y, processors, executable, app_id, n_bytes=None)[source]

Start an executable running on a single core

Parameters:
  • x (int) – The x-coordinate of the chip on which to run the executable
  • y (int) – The y-coordinate of the chip on which to run the executable
  • processors (iterable of int) – The cores on the chip on which to run the application
  • executable (spinnman.data.abstract_data_reader.AbstractDataReader or bytearray) – The data that is to be executed. Should be one of the following: * An instance of AbstractDataReader * A bytearray
  • 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 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:
execute_flood(core_subsets, executable, app_id, n_bytes=None)[source]

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:
  • core_subsets (spinnman.model.core_subsets.CoreSubsets) – Which cores on which chips to start the executable
  • executable (spinnman.data.abstract_data_reader.AbstractDataReader or bytearray) – The data that is to be executed. Should be one of the following: * An instance of AbstractDataReader * A bytearray
  • 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 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:
get_connections(include_boot_connection=False)[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.

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_core_state_count(app_id, state)[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:

int

Raises:
get_cpu_information(core_subsets=None)[source]

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_cpu_information_from_core(x, y, p)[source]

Get information about a specific processor on the board

Parameters:
  • 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
Returns:

The cpu information for the selected core

Return type:

spinnman.model.cpu_info.CPUInfo

Raises:
get_iobuf(core_subsets=None)[source]

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_iobuf_from_core(x, y, p)[source]

Get the contents of IOBUF for a given core

Parameters:
  • 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 IOBUF for
Returns:

An IOBUF buffer

Return type:

spinnman.model.io_buffer.IOBuffer

Raises:
get_machine_details()[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:

spinn_machine.machine.Machine

Raises:
get_machine_dimensions()[source]

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:

spinnman.model.machine_dimensions.MachineDimensions

Raises:
get_multicast_routes(x, y, app_id=None)[source]

Get the current multicast routes set up on a chip

Parameters:
  • x (int) – The x-coordinate of the chip from which to get the routes
  • y (int) – The y-coordinate of the chip from which to get the routes
  • app_id (int) – The id of the application to filter the routes for. If not specified, will return all routes
Returns:

An iterable of multicast routes

Return type:

iterable of spinnman.model.multicast_routing_entry.MulticastRoute

Raises:
get_router_diagnostic_filter(x, y, position)[source]

Gets a router diagnostic filter from a router

Parameters:
  • x (int) – the x address of the router from which this filter is being retrieved
  • y (int) – the y address of the router from which this filter is being retrieved
  • position (int) – the position in the list of filters where this filter is to be added
Returns:

The diagnostic filter read

Return type:

spinnman.model.diagnostic_filter.DiagnosticFilter

Raises:
get_router_diagnostics(x, y)[source]

Get router diagnostic information from a chip

Parameters:
  • x (int) – The x-coordinate of the chip from which to get the information
  • y (int) – The y-coordinate of the chip from which to get the information
Returns:

The router diagnostic information

Return type:

spinnman.model.router_diagnostics.RouterDiagnostics

Raises:
get_scamp_version(n_retries=3, timeout=1)[source]

Get the version of scamp which is running on the board

Parameters:
  • n_retries (int) – The number of times to retry getting the version
  • timeout (int) – The timeout for each retry in seconds
Returns:

The version identifier

Return type:

spinnman.model.version_info.VersionInfo

Raises:
get_tags(connection=None)[source]

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_user_0_register_address_from_core(x, y, p)[source]

Get the address of user 0 for a given processor on the board

Parameters:
  • 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 user 0 address from

: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
is_connected(connection=None)[source]

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_multicast_routes(x, y, routes, app_id)[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 of spinnmachine.multicast_routing_entry.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.
Returns:

Nothing is returned

Return type:

None

Raises:
locate_spinnaker_connection_for_board_address(board_address)[source]

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_memory(x, y, base_address, length)[source]

Read some areas of 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
Returns:

An iterable of chunks of data read in order

Return type:

iterable of bytearray

Raises:
read_memory_return_byte_array(x, y, base_address, length)[source]

Read some areas of 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
Returns:

An full bytearray of data read in order

Return type:

bytearray

Raises:
read_neighbour_memory(x, y, cpu, link, base_address, length)[source]

Read some areas of memory on a neighbouring chip using a LINK_READ SCP command. If sent to a BMP, this command can be used to communicate with the FPGAs’ debug registers.

Parameters:
  • x (int) – The x-coordinate of the chip whose neighbour is to be read from
  • y (int) – The y-coordinate of the chip whose neighbour is to be read from
  • cpu (int) – The cpu to use, typically 0 (or if a BMP, the slot number)
  • link – The link index to send the request to (or if BMP, the FPGA

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
receive_multicast_message(x, y, timeout=None, connection=None)[source]

Receives a multicast message from the board

Parameters:
  • x (int) – The x-coordinate of the chip where the message should come from on the board
  • y (int) – The y-coordinate of the chip where the message should come from on the board
  • timeout (int) – Amount of time to wait for the message to arrive in seconds before a timeout. If not specified, will wait indefinitely, or until the selected connection is closed
  • connection (spinnman.connections.abstract_multicast_receiver.AbstractMulticastReceiver) – A specific connection from which to receive the message. If not specified, an appropriate connection is chosen automatically
Returns:

The received message

Return type:

spinnman.messages.multicast_message.MulticastMessage

Raises:
register_listener(callback, recieve_port_no, connection_type, traffic_type, hostname=None)[source]

Register a callback for a certain type of traffic

Parameters:
  • callback (function(packet)) – Function to be called when a packet is received
  • recieve_port_no (int) – The port number to listen on
  • connection_type – The type of the connection
  • traffic_type – The type of traffic expected on the connection
  • hostname (str) – The optional hostname to listen on
send_eieio_command_message(message, connection=None)[source]

Sends a EIEIO command message using one of the connections.

Parameters:
  • message (EIEIOCommandMessage) – The message to send
  • connection (spinnman.connections.abstract_connection.AbstractConnection) – An optional connection to use
Returns:

None

send_multicast_message(x, y, multicast_message, connection=None)[source]

Sends a multicast message to the board

Parameters:
  • x (int) – The x-coordinate of the chip where the message should first arrive on the board
  • y (int) – The y-coordinate of the chip where the message should first arrive on the board
  • multicast_message (spinnman.messages.multicast_message.MulticastMessage) – A multicast message to send
  • connection (spinnman.connections.abstract_multicast_sender.AbstractMulticastSender) – A specific connection over which to send the message. If not specified, an appropriate connection is chosen automatically
Returns:

Nothing is returned

Return type:

None

Raises:
send_scp_message(message, retry_codes=(<SCPResult.RC_P2P_TIMEOUT: 142>, <SCPResult.RC_TIMEOUT: 134>, <SCPResult.RC_LEN: 129>), n_retries=10, timeout=1, connection=None)[source]

Sends an SCP message, and gets a response

Parameters:
  • message (spinnman.messages.scp.abstract_scp_request.AbstractSCPRequest) – The message to send
  • retry_codes (iterable of spinnman.messages.scp.scp_result.SCPResult) – The response codes which will result in a retry if received as a response
  • n_retries (int) – The number of times to retry when a retry code is received
  • timeout (int) – The timeout to use when receiving a response
  • connection (spinnman.connections.abstract_connection.AbstractConnection) – The connection to use
Returns:

The received response, or the callback if get_callback is True

Return type:

spinnman.messages.scp.abstract_scp_response.AbstractSCPResponse

Raises:
send_sdp_message(message, connection=None)[source]

Sends a EIEIO command message using one of the connections.

Parameters:
  • message (SDPMessage) – The message to send
  • connection (spinnman.connections.abstract_connection.AbstractConnection) – An optional connection to use
Returns:

None

send_signal(app_id, signal)[source]

Send a signal to an application

Parameters:
Returns:

Nothing is returned

Return type:

None

Raises:
set_ip_tag(ip_tag)[source]

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_leds(x, y, cpu, led_states)[source]

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_reverse_ip_tag(reverse_ip_tag)[source]

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:
set_router_diagnostic_filter(x, y, position, diagnostic_filter)[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 (spinnman.model.diagnostic_filter.DiagnosticFilter) – the diagnostic filter being set in the placed, between 0 and 15 (note that positions 0 to 11 are used by the default filters, and setting these positions will result in a warning).
Returns:

None

Raises:
stop_application(app_id)[source]

Sends a stop request for an app_id

Parameters:

app_id (int) – The id of the application to send to

Raises:
write_memory(x, y, base_address, data, n_bytes=None)[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 (spinnman.data.abstract_data_reader.AbstractDataReader or bytearray or int) – 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
  • 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:
write_memory_flood(base_address, data, n_bytes=None)[source]

Write to the SDRAM of all chips.

Parameters:
  • base_address (int) – The address in SDRAM where the region of memory is to be written
  • data (spinnman.data.abstract_data_reader.AbstractDataReader or bytearray or int) – The data that is to be written. Should be one of the following: * An instance of AbstractDataReader * A bytearray * A single integer
  • 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 * If n_bytes is less than 0
Returns:

Nothing is returned

Return type:

None

Raises:
write_neighbour_memory(x, y, cpu, link, base_address, data, n_bytes=None)[source]

Write to the memory of a neighbouring chip using a LINK_READ SCP command. If sent to a BMP, this command can be used to communicate with the FPGAs’ debug registers.

Parameters:
  • x (int) – The x-coordinate of the chip whose neighbour is to be written to
  • y (int) – The y-coordinate of the chip whose neighbour is to be written to
  • cpu (int) – The cpu to use, typically 0 (or if a BMP, the slot number)
  • link – The link index to send the request to (or if BMP, the FPGA

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: