spinnman.messages.scp.impl package¶
Submodules¶
spinnman.messages.scp.impl.app_stop module¶
-
class
spinnman.messages.scp.impl.app_stop.
AppStop
(app_id)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to stop an application
Parameters: app_id (int) – The ID of the application, between 0 and 255
spinnman.messages.scp.impl.application_run module¶
-
class
spinnman.messages.scp.impl.application_run.
ApplicationRun
(app_id, x, y, processors, wait=False)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to run an application loaded on a chip
Parameters: - app_id (int) – The ID of the application to run, between 16 and 255
- x (int) – The x-coordinate of the chip to run on, between 0 and 255
- y (int) – The y-coordinate of the chip to run on, between 0 and 255
- processors (list of int) – The processors on the chip where the executable should be started, between 1 and 17
- wait (bool) – True if the processors should enter a “wait” state on starting
spinnman.messages.scp.impl.bmp_get_version module¶
-
class
spinnman.messages.scp.impl.bmp_get_version.
BMPGetVersion
(board)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.bmp_request.BMPRequest
An SCP request to read the version of software running on a core
Parameters: board (int) – The board to get the version from Raises: spinnman.exceptions.SpinnmanInvalidParameterException – - If the chip coordinates are out of range
- If the processor is out of range
spinnman.messages.scp.impl.bmp_set_led module¶
-
class
spinnman.messages.scp.impl.bmp_set_led.
BMPSetLed
(led, action, boards)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.bmp_request.BMPRequest
Set the LED(s) of a board to either on, off or toggling
Parameters: - led (int or iterable of int) – Number of the LED or an iterable of LEDs to set the state of (0-7)
- action (
spinnman.messages.scp.enums.led_action.SCPLEDAction
) – State to set the LED to, either on, off or toggle - boards (int or iterable of int) – Specifies the board to control the LEDs of. This may also be an iterable of multiple boards (in the same frame).
Return type: None
-
get_scp_response
()[source]¶ Get an SCP response message to be used to process any response received
Returns: An SCP response, or None if no response is required Return type: spinnman.messages.scp_response.SCPResponse
Raises: None – No known exceptions are raised Get the response from the write FPGA register request
spinnman.messages.scp.impl.check_ok_response module¶
-
class
spinnman.messages.scp.impl.check_ok_response.
CheckOKResponse
(operation, command)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_response.AbstractSCPResponse
An SCP response to a request which returns nothing other than OK
Parameters: - operation (str) – The operation being performed
- command (str) – The command that was sent
spinnman.messages.scp.impl.count_state module¶
-
class
spinnman.messages.scp.impl.count_state.
CountState
(app_id, state)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to get a count of the cores in a particular state
Parameters: - app_id (int) – The ID of the application, between 0 and 255
- state (
spinnman.model.cpu_state.CPUState
) – The state to count
spinnman.messages.scp.impl.count_state_response module¶
-
class
spinnman.messages.scp.impl.count_state_response.
CountStateResponse
[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_response.AbstractSCPResponse
An SCP response to a request for the number of cores in a given state
-
count
¶ The count of the number of cores with the requested state
Return type: int
-
spinnman.messages.scp.impl.fill_request module¶
-
class
spinnman.messages.scp.impl.fill_request.
FillRequest
(x, y, base_address, data, size)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to fill a region of memory on a chip with repeated data
Parameters: - x (int) – The x-coordinate of the chip to read from, between 0 and 255
- y (int) – The y-coordinate of the chip to read from, between 0 and 255
- base_address (int) – The positive base address to start the fill from
- data (int) – The data to fill in the space with
- size (int) – The number of bytes to fill in
spinnman.messages.scp.impl.fixed_route_init module¶
-
class
spinnman.messages.scp.impl.fixed_route_init.
FixedRouteInit
(x, y, entry, app_id)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
Sets a fixed route entry
Parameters: - x (int) – The x-coordinate of the chip, between 0 and 255, this is not checked due to speed restrictions
- y (int) – The y-coordinate of the chip, between 0 and 255, this is not checked due to speed restrictions
- entry – the fixed route entry converted for writing
- app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
Raises: spinnman.exceptions.SpinnmanInvalidParameterException –
- If x is out of range
- If y is out of range
spinnman.messages.scp.impl.fixed_route_read module¶
-
class
spinnman.messages.scp.impl.fixed_route_read.
FixedRouteRead
(x, y, app_id)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
Sets a fixed route entry
Parameters: - x (int) – The x-coordinate of the chip, between 0 and 255, this is not checked due to speed restrictions
- y (int) – The y-coordinate of the chip, between 0 and 255 this is not checked due to speed restrictions
- app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
Raises: spinnman.exceptions.SpinnmanInvalidParameterException –
- If x is out of range
- If y is out of range
spinnman.messages.scp.impl.flood_fill_data module¶
-
class
spinnman.messages.scp.impl.flood_fill_data.
FloodFillData
(nearest_neighbour_id, block_no, base_address, data, offset=0, length=None)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to start a flood fill of data
Parameters: - nearest_neighbour_id (int) – The ID of the packet, between 0 and 127
- block_no (int) – Which block this block is, between 0 and 255
- base_address (int) – The base address where the data is to be loaded
- data (bytearray) – The data to load, between 4 and 256 bytes and the size must be divisible by 4
-
bytestring
¶ The request as a bytestring
Returns: The request as a bytestring Return type: str
spinnman.messages.scp.impl.flood_fill_end module¶
-
class
spinnman.messages.scp.impl.flood_fill_end.
FloodFillEnd
(nearest_neighbour_id, app_id=0, processors=None, wait=False)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to start a flood fill of data
Parameters: - nearest_neighbour_id (int) – The ID of the packet, between 0 and 127
- app_id (int) – The application ID to start using the data, between 16 and 255. If not specified, no application is started
- processors (iterable of int) – A list of processors on which to start the application, each between 1 and 17. If not specified, no application is started.
- wait (bool) – True if the binary should go into a “wait” state before executing
spinnman.messages.scp.impl.flood_fill_start module¶
-
class
spinnman.messages.scp.impl.flood_fill_start.
FloodFillStart
(nearest_neighbour_id, n_blocks, x=None, y=None)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to start a flood fill of data
Parameters: - nearest_neighbour_id (int) – The ID of the packet, between 0 and 127
- n_blocks (int) – The number of blocks of data that will be sent, between 0 and 255
- x (int) – The x-coordinate of the chip to load the data on to. If not specified, the data will be loaded on to all chips
- y (int) – The y-coordinate of the chip to load the data on to. If not specified, the data will be loaded on to all chips
spinnman.messages.scp.impl.get_chip_info module¶
-
class
spinnman.messages.scp.impl.get_chip_info.
GetChipInfo
(x, y, with_size=False)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to read the chip information from a core
Parameters: - x (int) – The x-coordinate of the chip to read from, between 0 and 255
- y (int) – The y-coordinate of the chip to read from, between 0 and 255
- with_size (bool) – Whether the size should be included in the response
spinnman.messages.scp.impl.get_chip_info_response module¶
-
class
spinnman.messages.scp.impl.get_chip_info_response.
GetChipInfoResponse
[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_response.AbstractSCPResponse
An SCP response to a request for the version of software running
-
chip_info
¶ The chip information received
Return type: spinnman.model.chip_summary_info.ChipSummaryInfo
-
spinnman.messages.scp.impl.get_version module¶
-
class
spinnman.messages.scp.impl.get_version.
GetVersion
(x, y, p)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to read the version of software running on a core
Parameters: - x (int) – The x-coordinate of the chip to read from, between 0 and 255
- y (int) – The y-coordinate of the chip to read from, between 0 and 255
- p (int) – The ID of the processor to read the version from, between 0 and 31
Raises: spinnman.exceptions.SpinnmanInvalidParameterException –
- If the chip coordinates are out of range
- If the processor is out of range
spinnman.messages.scp.impl.get_version_response module¶
-
class
spinnman.messages.scp.impl.get_version_response.
GetVersionResponse
[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_response.AbstractSCPResponse
An SCP response to a request for the version of software running
-
read_data_bytestring
(data, offset)[source]¶ Reads the remainder of the data following the header
Parameters: - data (str) – The bytestring to read from
- offset (int) – The offset into the data after the headers
-
version_info
¶ The version information received
Return type: spinnman.model.version_info.VersionInfo
-
spinnman.messages.scp.impl.iptag_clear module¶
-
class
spinnman.messages.scp.impl.iptag_clear.
IPTagClear
(x, y, tag)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to clear an IP Tag
Parameters: - x (int) – The x-coordinate of a chip, between 0 and 255
- y (int) – The y-coordinate of a chip, between 0 and 255
- tag (int) – The tag, between 0 and 7
spinnman.messages.scp.impl.iptag_get module¶
-
class
spinnman.messages.scp.impl.iptag_get.
IPTagGet
(x, y, tag)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to get an IP tag
Parameters: - x (int) – The x-coordinate of a chip, between 0 and 255
- y (int) – The y-coordinate of a chip, between 0 and 255
- tag (int) – The tag to get details of, between 0 and 7
- tag – The tag, between 0 and 7
spinnman.messages.scp.impl.iptag_get_info module¶
-
class
spinnman.messages.scp.impl.iptag_get_info.
IPTagGetInfo
(x, y)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request information about IP tags
Parameters: - x (int) – The x-coordinate of a chip, between 0 and 255
- y (int) – The y-coordinate of a chip, between 0 and 255
spinnman.messages.scp.impl.iptag_get_info_response module¶
-
class
spinnman.messages.scp.impl.iptag_get_info_response.
IPTagGetInfoResponse
[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_response.AbstractSCPResponse
An SCP response to a request for information about IP tags
-
fixed_size
¶ The count of the number of fixed IP tag entries
Return type: int
-
pool_size
¶ The count of the IP tag pool size
Return type: int
-
read_data_bytestring
(data, offset)[source]¶ Reads the remainder of the data following the header
Parameters: - data (str) – The bytestring to read from
- offset (int) – The offset into the data after the headers
-
transient_timeout
¶ The timeout for transient IP tags (i.e. responses to SCP commands)
Return type: int
-
spinnman.messages.scp.impl.iptag_set module¶
-
class
spinnman.messages.scp.impl.iptag_set.
IPTagSet
(x, y, host, port, tag, strip, use_sender=False)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to set an IP Tag
Parameters: - x (int) – The x-coordinate of a chip, between 0 and 255
- y (int) – The y-coordinate of a chip, between 0 and 255
- host (bytearray) – The host address, as an array of 4 bytes
- port (int) – The port, between 0 and 65535
- tag (int) – The tag, between 0 and 7
- strip (bool) – if the SDP header should be striped from the packet.
- use_sender – if the sender ip address and port should be used
Type: bool
spinnman.messages.scp.impl.iptag_set_tto module¶
-
class
spinnman.messages.scp.impl.iptag_set_tto.
IPTagSetTTO
(x, y, tag_timeout)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to set the transient timeout for future SCP requests
Parameters: - x (int) – The x-coordinate of the chip to run on, between 0 and 255
- y (int) – The y-coordinate of the chip to run on, between 0 and 255
- tag_timeout – The timeout value, via the IPTAG_TIME_OUT_WAIT_TIMES enum located in spinnman.constants
spinnman.messages.scp.impl.read_adc module¶
-
class
spinnman.messages.scp.impl.read_adc.
ReadADC
(board)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.bmp_request.BMPRequest
SCP Request for the data from the BMP including voltages and temperature.
Parameters: board – which board to request the ADC register from Return type: None
spinnman.messages.scp.impl.read_fpga_register module¶
-
class
spinnman.messages.scp.impl.read_fpga_register.
ReadFPGARegister
(fpga_num, register, board)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.bmp_request.BMPRequest
Requests the data from a FPGA’s register
Sets up a read FPGA register request.
Parameters: - fpga_num – FPGA number (0, 1 or 2) to communicate with.
- register – Register address to read to (will be rounded down to the nearest 32-bit word boundary).
- board – which board to request the FPGA register from
Return type: None
spinnman.messages.scp.impl.read_link module¶
-
class
spinnman.messages.scp.impl.read_link.
ReadLink
(x, y, link, base_address, size, cpu=0)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to read a region of memory via a link on a chip
Parameters: - x (int) – The x-coordinate of the chip to read from, between 0 and 255
- y (int) – The y-coordinate of the chip to read from, between 0 and 255
- cpu (int) – The CPU core to use, normally 0 (or if a BMP, the board slot number)
- link (int) – The ID of the link down which to send the query
- base_address (int) – The positive base address to start the read from
- size (int) – The number of bytes to read, between 1 and 256
spinnman.messages.scp.impl.read_memory module¶
-
class
spinnman.messages.scp.impl.read_memory.
ReadMemory
(x, y, base_address, size, cpu=0)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to read a region of memory on a chip
Parameters: - x (int) – The x-coordinate of the chip to read from, between 0 and 255
- y (int) – The y-coordinate of the chip to read from, between 0 and 255
- base_address (int) – The positive base address to start the read from
- size (int) – The number of bytes to read, between 1 and 256
Raises: spinnman.exceptions.SpinnmanInvalidParameterException –
- If the chip coordinates are out of range
- If the base address is not a positive number
- If the size is out of range
spinnman.messages.scp.impl.reverse_iptag_set module¶
-
class
spinnman.messages.scp.impl.reverse_iptag_set.
ReverseIPTagSet
(x, y, destination_x, destination_y, destination_p, port, tag, sdp_port)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to set an IP Tag
Parameters: - x (int) – The x-coordinate of a chip, between 0 and 255
- y (int) – The y-coordinate of a chip, between 0 and 255
- destination_x (int) – The x-coordinate of the destination chip, between 0 and 255
- destination_y (int) – The y-coordinate of the destination chip, between 0 and 255
- destination_p (int) – The ID of the destination processor, between 0 and 17
- port (int) – The port, between 0 and 65535
- tag (int) – The tag, between 0 and 7
spinnman.messages.scp.impl.router_alloc module¶
-
class
spinnman.messages.scp.impl.router_alloc.
RouterAlloc
(x, y, app_id, n_entries)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to allocate space for routing entries
Parameters: - x (int) – The x-coordinate of the chip to allocate on, between 0 and 255
- y (int) – The y-coordinate of the chip to allocate on, between 0 and 255
- app_id (int) – The ID of the application, between 0 and 255
- n_entries (int) – The number of entries to allocate
spinnman.messages.scp.impl.router_clear module¶
-
class
spinnman.messages.scp.impl.router_clear.
RouterClear
(x, y)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to clear the router on a chip
Parameters: - x (int) – The x-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
- y (int) – The y-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
Raises: spinnman.exceptions.SpinnmanInvalidParameterException –
- If x is out of range
- If y is out of range
spinnman.messages.scp.impl.router_init module¶
-
class
spinnman.messages.scp.impl.router_init.
RouterInit
(x, y, n_entries, table_address, base_address, app_id)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to initialize the router on a chip
Parameters: - x (int) – The x-coordinate of the chip, between 0 and 255, this is not checked due to speed restrictions
- y (int) – The y-coordinate of the chip, between 0 and 255, this is not checked due to speed restrictions
- n_entries (int) – The number of entries in the table, more than 0
- table_address (int) – The allocated table address
- base_address (int) – The base_address containing the entries
- app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
Raises: spinnman.exceptions.SpinnmanInvalidParameterException –
- If x is out of range
- If y is out of range
- If n_entries is 0 or less
- If table_address is not positive
- If base_address is not positive
spinnman.messages.scp.impl.sdram_alloc module¶
-
class
spinnman.messages.scp.impl.sdram_alloc.
SDRAMAlloc
(x, y, app_id, size, tag=None)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to allocate space in the SDRAM space
Parameters: - x (int) – The x-coordinate of the chip to allocate on, between 0 and 255
- y (int) – The y-coordinate of the chip to allocate on, between 0 and 255
- app_id (int) – The ID of the application, between 0 and 255
- size (int) – The size in bytes of memory to be allocated
- 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.
spinnman.messages.scp.impl.sdram_de_alloc module¶
-
class
spinnman.messages.scp.impl.sdram_de_alloc.
SDRAMDeAlloc
(x, y, app_id, base_address=None)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to free space in the SDRAM
Parameters: - x (int) – The x-coordinate of the chip to allocate on, between 0 and 255
- y (int) – The y-coordinate of the chip to allocate on, between 0 and 255
- app_id (int) – The ID of the application, between 0 and 255
- base_address (int or None) – The start address in SDRAM to which the block needs to be deallocated, or none if deallocating via app_id
spinnman.messages.scp.impl.send_signal module¶
-
class
spinnman.messages.scp.impl.send_signal.
SendSignal
(app_id, signal)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to send a signal to cores
Parameters: - app_id (int) – The ID of the application, between 0 and 255
- signal (
spinnman.messages.scp.scp_signal.SCPSignal
) – The signal to send
Raises: spinnman.exceptions.SpinnmanInvalidParameterException – If app_id is out of range
spinnman.messages.scp.impl.set_led module¶
-
class
spinnman.messages.scp.impl.set_led.
SetLED
(x, y, cpu, led_states)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to change the state of an SetLED
Parameters: - x (int) – The x-coordinate of the chip, between 0 and 255
- y (int) – The y-coordinate of the chip, between 0 and 255
- cpu (int) – The CPU-number to use to set the SetLED.
- led_states (dict) – A dictionary mapping SetLED index to state with 0 being off, 1 on and 2 inverted.
spinnman.messages.scp.impl.set_power module¶
-
class
spinnman.messages.scp.impl.set_power.
SetPower
(power_command, boards, delay=0.0, board_to_send_to=0)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.bmp_request.BMPRequest
An SCP request for the BMP to power on or power off a rack of boards
Note
There is currently a bug in the BMP that means some boards don’t respond to power commands not sent to BMP 0. Thus changing the board_to_send_to parameter is not recommended!
Parameters: - power_command (
spinnman.messages.scp.scp_power_command.SCPPowerCommand
) – The power command being sent - boards (int or iterable of int) – The boards on the same backplane to power on or off
- delay (int) – Number of seconds delay between power state changes of the different boards.
- board_to_send_to – The optional board to send the command to if this is to be sent to a frame of boards.
Type: board_to_send_to: 0
Return type: None
-
get_scp_response
()[source]¶ Get an SCP response message to be used to process any response received
Returns: An SCP response, or None if no response is required Return type: spinnman.messages.scp_response.SCPResponse
Raises: None – No known exceptions are raised Get the response from the powering message
- power_command (
spinnman.messages.scp.impl.write_fpga_register module¶
-
class
spinnman.messages.scp.impl.write_fpga_register.
WriteFPGARegister
(fpga_num, addr, value, board)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.bmp_request.BMPRequest
A request for writing data to a FPGA register
Write the value of an FPGA (SPI) register.
See the SpI/O project’s spinnaker_fpga design’s README for a listing of FPGA registers. The SpI/O project can be found on GitHub at: https://github.com/SpiNNakerManchester/spio/
Parameters: - fpga_num (int) – FPGA number (0, 1 or 2) to communicate with.
- addr (int) – Register address to read or write to (will be rounded down to the nearest 32-bit word boundary).
- value (int) – A 32-bit int value to write to the register
spinnman.messages.scp.impl.write_link module¶
-
class
spinnman.messages.scp.impl.write_link.
WriteLink
(x, y, link, base_address, data, cpu=0)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to write memory on a neighbouring chip
Parameters: - x (int) – The x-coordinate of the chip whose neighbour will be written to, between 0 and 255
- y (int) – The y-coordinate of the chip whose neighbour will be written to, between 0 and 255
- cpu (int) – The CPU core to use, normally 0 (or if a BMP, the board slot number)
- link (int) – The link number to write to between 0 and 5 (or if a BMP, the FPGA between 0 and 2)
- base_address (int) – The base_address to start writing to
- data (bytearray) – Up to 256 bytes of data to write
-
bytestring
¶ The request as a bytestring
Returns: The request as a bytestring Return type: str
spinnman.messages.scp.impl.write_memory module¶
-
class
spinnman.messages.scp.impl.write_memory.
WriteMemory
(x, y, base_address, data, cpu=0)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to write memory on a chip
Parameters: - x (int) – The x-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
- y (int) – The y-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
- base_address (int) – The base_address to start writing to the base address is not checked to see if its not valid
- data (bytearray or string) – between 1 and 256 bytes of data to write; this is not checked due to speed restrictions
-
bytestring
¶ The request as a bytestring
Returns: The request as a bytestring Return type: str
Module contents¶
-
class
spinnman.messages.scp.impl.
AppStop
(app_id)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to stop an application
Parameters: app_id (int) – The ID of the application, between 0 and 255
-
class
spinnman.messages.scp.impl.
ApplicationRun
(app_id, x, y, processors, wait=False)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to run an application loaded on a chip
Parameters: - app_id (int) – The ID of the application to run, between 16 and 255
- x (int) – The x-coordinate of the chip to run on, between 0 and 255
- y (int) – The y-coordinate of the chip to run on, between 0 and 255
- processors (list of int) – The processors on the chip where the executable should be started, between 1 and 17
- wait (bool) – True if the processors should enter a “wait” state on starting
-
class
spinnman.messages.scp.impl.
BMPSetLed
(led, action, boards)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.bmp_request.BMPRequest
Set the LED(s) of a board to either on, off or toggling
Parameters: - led (int or iterable of int) – Number of the LED or an iterable of LEDs to set the state of (0-7)
- action (
spinnman.messages.scp.enums.led_action.SCPLEDAction
) – State to set the LED to, either on, off or toggle - boards (int or iterable of int) – Specifies the board to control the LEDs of. This may also be an iterable of multiple boards (in the same frame).
Return type: None
-
get_scp_response
()[source]¶ Get an SCP response message to be used to process any response received
Returns: An SCP response, or None if no response is required Return type: spinnman.messages.scp_response.SCPResponse
Raises: None – No known exceptions are raised Get the response from the write FPGA register request
-
class
spinnman.messages.scp.impl.
BMPGetVersion
(board)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.bmp_request.BMPRequest
An SCP request to read the version of software running on a core
Parameters: board (int) – The board to get the version from Raises: spinnman.exceptions.SpinnmanInvalidParameterException – - If the chip coordinates are out of range
- If the processor is out of range
-
class
spinnman.messages.scp.impl.
CheckOKResponse
(operation, command)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_response.AbstractSCPResponse
An SCP response to a request which returns nothing other than OK
Parameters: - operation (str) – The operation being performed
- command (str) – The command that was sent
-
class
spinnman.messages.scp.impl.
GetChipInfo
(x, y, with_size=False)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to read the chip information from a core
Parameters: - x (int) – The x-coordinate of the chip to read from, between 0 and 255
- y (int) – The y-coordinate of the chip to read from, between 0 and 255
- with_size (bool) – Whether the size should be included in the response
-
class
spinnman.messages.scp.impl.
CountState
(app_id, state)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to get a count of the cores in a particular state
Parameters: - app_id (int) – The ID of the application, between 0 and 255
- state (
spinnman.model.cpu_state.CPUState
) – The state to count
-
class
spinnman.messages.scp.impl.
FloodFillData
(nearest_neighbour_id, block_no, base_address, data, offset=0, length=None)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to start a flood fill of data
Parameters: - nearest_neighbour_id (int) – The ID of the packet, between 0 and 127
- block_no (int) – Which block this block is, between 0 and 255
- base_address (int) – The base address where the data is to be loaded
- data (bytearray) – The data to load, between 4 and 256 bytes and the size must be divisible by 4
-
bytestring
¶ The request as a bytestring
Returns: The request as a bytestring Return type: str
-
class
spinnman.messages.scp.impl.
FillRequest
(x, y, base_address, data, size)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to fill a region of memory on a chip with repeated data
Parameters: - x (int) – The x-coordinate of the chip to read from, between 0 and 255
- y (int) – The y-coordinate of the chip to read from, between 0 and 255
- base_address (int) – The positive base address to start the fill from
- data (int) – The data to fill in the space with
- size (int) – The number of bytes to fill in
-
class
spinnman.messages.scp.impl.
FloodFillEnd
(nearest_neighbour_id, app_id=0, processors=None, wait=False)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to start a flood fill of data
Parameters: - nearest_neighbour_id (int) – The ID of the packet, between 0 and 127
- app_id (int) – The application ID to start using the data, between 16 and 255. If not specified, no application is started
- processors (iterable of int) – A list of processors on which to start the application, each between 1 and 17. If not specified, no application is started.
- wait (bool) – True if the binary should go into a “wait” state before executing
-
class
spinnman.messages.scp.impl.
FloodFillStart
(nearest_neighbour_id, n_blocks, x=None, y=None)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to start a flood fill of data
Parameters: - nearest_neighbour_id (int) – The ID of the packet, between 0 and 127
- n_blocks (int) – The number of blocks of data that will be sent, between 0 and 255
- x (int) – The x-coordinate of the chip to load the data on to. If not specified, the data will be loaded on to all chips
- y (int) – The y-coordinate of the chip to load the data on to. If not specified, the data will be loaded on to all chips
-
class
spinnman.messages.scp.impl.
IPTagClear
(x, y, tag)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to clear an IP Tag
Parameters: - x (int) – The x-coordinate of a chip, between 0 and 255
- y (int) – The y-coordinate of a chip, between 0 and 255
- tag (int) – The tag, between 0 and 7
-
class
spinnman.messages.scp.impl.
IPTagGet
(x, y, tag)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to get an IP tag
Parameters: - x (int) – The x-coordinate of a chip, between 0 and 255
- y (int) – The y-coordinate of a chip, between 0 and 255
- tag (int) – The tag to get details of, between 0 and 7
- tag – The tag, between 0 and 7
-
class
spinnman.messages.scp.impl.
IPTagGetInfo
(x, y)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request information about IP tags
Parameters: - x (int) – The x-coordinate of a chip, between 0 and 255
- y (int) – The y-coordinate of a chip, between 0 and 255
-
class
spinnman.messages.scp.impl.
IPTagSet
(x, y, host, port, tag, strip, use_sender=False)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to set an IP Tag
Parameters: - x (int) – The x-coordinate of a chip, between 0 and 255
- y (int) – The y-coordinate of a chip, between 0 and 255
- host (bytearray) – The host address, as an array of 4 bytes
- port (int) – The port, between 0 and 65535
- tag (int) – The tag, between 0 and 7
- strip (bool) – if the SDP header should be striped from the packet.
- use_sender – if the sender ip address and port should be used
Type: bool
-
class
spinnman.messages.scp.impl.
IPTagSetTTO
(x, y, tag_timeout)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to set the transient timeout for future SCP requests
Parameters: - x (int) – The x-coordinate of the chip to run on, between 0 and 255
- y (int) – The y-coordinate of the chip to run on, between 0 and 255
- tag_timeout – The timeout value, via the IPTAG_TIME_OUT_WAIT_TIMES enum located in spinnman.constants
-
class
spinnman.messages.scp.impl.
SetLED
(x, y, cpu, led_states)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to change the state of an SetLED
Parameters: - x (int) – The x-coordinate of the chip, between 0 and 255
- y (int) – The y-coordinate of the chip, between 0 and 255
- cpu (int) – The CPU-number to use to set the SetLED.
- led_states (dict) – A dictionary mapping SetLED index to state with 0 being off, 1 on and 2 inverted.
-
class
spinnman.messages.scp.impl.
SetPower
(power_command, boards, delay=0.0, board_to_send_to=0)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.bmp_request.BMPRequest
An SCP request for the BMP to power on or power off a rack of boards
Note
There is currently a bug in the BMP that means some boards don’t respond to power commands not sent to BMP 0. Thus changing the board_to_send_to parameter is not recommended!
Parameters: - power_command (
spinnman.messages.scp.scp_power_command.SCPPowerCommand
) – The power command being sent - boards (int or iterable of int) – The boards on the same backplane to power on or off
- delay (int) – Number of seconds delay between power state changes of the different boards.
- board_to_send_to – The optional board to send the command to if this is to be sent to a frame of boards.
Type: board_to_send_to: 0
Return type: None
-
get_scp_response
()[source]¶ Get an SCP response message to be used to process any response received
Returns: An SCP response, or None if no response is required Return type: spinnman.messages.scp_response.SCPResponse
Raises: None – No known exceptions are raised Get the response from the powering message
- power_command (
-
class
spinnman.messages.scp.impl.
ReadADC
(board)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.bmp_request.BMPRequest
SCP Request for the data from the BMP including voltages and temperature.
Parameters: board – which board to request the ADC register from Return type: None
-
class
spinnman.messages.scp.impl.
ReadFPGARegister
(fpga_num, register, board)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.bmp_request.BMPRequest
Requests the data from a FPGA’s register
Sets up a read FPGA register request.
Parameters: - fpga_num – FPGA number (0, 1 or 2) to communicate with.
- register – Register address to read to (will be rounded down to the nearest 32-bit word boundary).
- board – which board to request the FPGA register from
Return type: None
-
class
spinnman.messages.scp.impl.
ReadLink
(x, y, link, base_address, size, cpu=0)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to read a region of memory via a link on a chip
Parameters: - x (int) – The x-coordinate of the chip to read from, between 0 and 255
- y (int) – The y-coordinate of the chip to read from, between 0 and 255
- cpu (int) – The CPU core to use, normally 0 (or if a BMP, the board slot number)
- link (int) – The ID of the link down which to send the query
- base_address (int) – The positive base address to start the read from
- size (int) – The number of bytes to read, between 1 and 256
-
class
spinnman.messages.scp.impl.
ReadMemory
(x, y, base_address, size, cpu=0)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to read a region of memory on a chip
Parameters: - x (int) – The x-coordinate of the chip to read from, between 0 and 255
- y (int) – The y-coordinate of the chip to read from, between 0 and 255
- base_address (int) – The positive base address to start the read from
- size (int) – The number of bytes to read, between 1 and 256
Raises: spinnman.exceptions.SpinnmanInvalidParameterException –
- If the chip coordinates are out of range
- If the base address is not a positive number
- If the size is out of range
-
class
spinnman.messages.scp.impl.
ReverseIPTagSet
(x, y, destination_x, destination_y, destination_p, port, tag, sdp_port)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to set an IP Tag
Parameters: - x (int) – The x-coordinate of a chip, between 0 and 255
- y (int) – The y-coordinate of a chip, between 0 and 255
- destination_x (int) – The x-coordinate of the destination chip, between 0 and 255
- destination_y (int) – The y-coordinate of the destination chip, between 0 and 255
- destination_p (int) – The ID of the destination processor, between 0 and 17
- port (int) – The port, between 0 and 65535
- tag (int) – The tag, between 0 and 7
-
class
spinnman.messages.scp.impl.
RouterAlloc
(x, y, app_id, n_entries)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to allocate space for routing entries
Parameters: - x (int) – The x-coordinate of the chip to allocate on, between 0 and 255
- y (int) – The y-coordinate of the chip to allocate on, between 0 and 255
- app_id (int) – The ID of the application, between 0 and 255
- n_entries (int) – The number of entries to allocate
-
class
spinnman.messages.scp.impl.
RouterClear
(x, y)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to clear the router on a chip
Parameters: - x (int) – The x-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
- y (int) – The y-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
Raises: spinnman.exceptions.SpinnmanInvalidParameterException –
- If x is out of range
- If y is out of range
-
class
spinnman.messages.scp.impl.
RouterInit
(x, y, n_entries, table_address, base_address, app_id)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to initialize the router on a chip
Parameters: - x (int) – The x-coordinate of the chip, between 0 and 255, this is not checked due to speed restrictions
- y (int) – The y-coordinate of the chip, between 0 and 255, this is not checked due to speed restrictions
- n_entries (int) – The number of entries in the table, more than 0
- table_address (int) – The allocated table address
- base_address (int) – The base_address containing the entries
- app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
Raises: spinnman.exceptions.SpinnmanInvalidParameterException –
- If x is out of range
- If y is out of range
- If n_entries is 0 or less
- If table_address is not positive
- If base_address is not positive
-
class
spinnman.messages.scp.impl.
SDRAMAlloc
(x, y, app_id, size, tag=None)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to allocate space in the SDRAM space
Parameters: - x (int) – The x-coordinate of the chip to allocate on, between 0 and 255
- y (int) – The y-coordinate of the chip to allocate on, between 0 and 255
- app_id (int) – The ID of the application, between 0 and 255
- size (int) – The size in bytes of memory to be allocated
- 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.
-
class
spinnman.messages.scp.impl.
SDRAMDeAlloc
(x, y, app_id, base_address=None)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to free space in the SDRAM
Parameters: - x (int) – The x-coordinate of the chip to allocate on, between 0 and 255
- y (int) – The y-coordinate of the chip to allocate on, between 0 and 255
- app_id (int) – The ID of the application, between 0 and 255
- base_address (int or None) – The start address in SDRAM to which the block needs to be deallocated, or none if deallocating via app_id
-
class
spinnman.messages.scp.impl.
SendSignal
(app_id, signal)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP Request to send a signal to cores
Parameters: - app_id (int) – The ID of the application, between 0 and 255
- signal (
spinnman.messages.scp.scp_signal.SCPSignal
) – The signal to send
Raises: spinnman.exceptions.SpinnmanInvalidParameterException – If app_id is out of range
-
class
spinnman.messages.scp.impl.
GetVersion
(x, y, p)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
An SCP request to read the version of software running on a core
Parameters: - x (int) – The x-coordinate of the chip to read from, between 0 and 255
- y (int) – The y-coordinate of the chip to read from, between 0 and 255
- p (int) – The ID of the processor to read the version from, between 0 and 31
Raises: spinnman.exceptions.SpinnmanInvalidParameterException –
- If the chip coordinates are out of range
- If the processor is out of range
-
class
spinnman.messages.scp.impl.
WriteFPGARegister
(fpga_num, addr, value, board)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.bmp_request.BMPRequest
A request for writing data to a FPGA register
Write the value of an FPGA (SPI) register.
See the SpI/O project’s spinnaker_fpga design’s README for a listing of FPGA registers. The SpI/O project can be found on GitHub at: https://github.com/SpiNNakerManchester/spio/
Parameters: - fpga_num (int) – FPGA number (0, 1 or 2) to communicate with.
- addr (int) – Register address to read or write to (will be rounded down to the nearest 32-bit word boundary).
- value (int) – A 32-bit int value to write to the register
-
class
spinnman.messages.scp.impl.
FixedRouteRead
(x, y, app_id)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
Sets a fixed route entry
Parameters: - x (int) – The x-coordinate of the chip, between 0 and 255, this is not checked due to speed restrictions
- y (int) – The y-coordinate of the chip, between 0 and 255 this is not checked due to speed restrictions
- app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
Raises: spinnman.exceptions.SpinnmanInvalidParameterException –
- If x is out of range
- If y is out of range
-
class
spinnman.messages.scp.impl.
WriteLink
(x, y, link, base_address, data, cpu=0)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to write memory on a neighbouring chip
Parameters: - x (int) – The x-coordinate of the chip whose neighbour will be written to, between 0 and 255
- y (int) – The y-coordinate of the chip whose neighbour will be written to, between 0 and 255
- cpu (int) – The CPU core to use, normally 0 (or if a BMP, the board slot number)
- link (int) – The link number to write to between 0 and 5 (or if a BMP, the FPGA between 0 and 2)
- base_address (int) – The base_address to start writing to
- data (bytearray) – Up to 256 bytes of data to write
-
bytestring
¶ The request as a bytestring
Returns: The request as a bytestring Return type: str
-
class
spinnman.messages.scp.impl.
WriteMemory
(x, y, base_address, data, cpu=0)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
A request to write memory on a chip
Parameters: - x (int) – The x-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
- y (int) – The y-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
- base_address (int) – The base_address to start writing to the base address is not checked to see if its not valid
- data (bytearray or string) – between 1 and 256 bytes of data to write; this is not checked due to speed restrictions
-
bytestring
¶ The request as a bytestring
Returns: The request as a bytestring Return type: str
-
class
spinnman.messages.scp.impl.
FixedRouteInit
(x, y, entry, app_id)[source]¶ Bases:
spinnman.messages.scp.abstract_messages.scp_request.AbstractSCPRequest
Sets a fixed route entry
Parameters: - x (int) – The x-coordinate of the chip, between 0 and 255, this is not checked due to speed restrictions
- y (int) – The y-coordinate of the chip, between 0 and 255, this is not checked due to speed restrictions
- entry – the fixed route entry converted for writing
- app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
Raises: spinnman.exceptions.SpinnmanInvalidParameterException –
- If x is out of range
- If y is out of range