spinnman.messages.sdp package¶
Submodules¶
spinnman.messages.sdp.sdp_flag module¶
spinnman.messages.sdp.sdp_header module¶
-
class
spinnman.messages.sdp.sdp_header.
SDPHeader
(flags=None, tag=None, destination_port=None, destination_cpu=None, destination_chip_x=None, destination_chip_y=None, source_port=None, source_cpu=None, source_chip_x=None, source_chip_y=None)[source]¶ Bases:
object
Represents the header of an SDP message. Each optional parameter in the constructor can be set to a value other than None once, after which it is immutable. It is an error to set a parameter that is not currently None.
Parameters: - flags (
spinnman.messages.sdp.sdp_flag.SDPFlag
) – Any flags for the packet - tag (int) – The IP tag of the packet between 0 and 255, or None if it is to be set later
- destination_port (int) – The destination port of the packet between 0 and 7
- destination_cpu (int) – The destination processor ID within the chip between 0 and 31
- destination_chip_x (int) – The x-coordinate of the destination chip between 0 and 255
- destination_chip_y (int) – The y-coordinate of the destination chip between 0 and 255
- source_port (int) – The source port of the packet between 0 and 7, or None if it is to be set later
- source_cpu (int) – The source processor ID within the chip between 0 and 31, or None if it is to be set later
- source_chip_x (int) – The x-coordinate of the source chip between 0 and 255, or None if it is to be set later
- source_chip_y – The y-coordinate of the source chip between 0 and 255, or None if it is to be set later
-
bytestring
¶ The header as a bytestring
Returns: The header bytestring Return type: str
-
destination_chip_x
¶ The x-coordinate of the destination chip of the packet
Returns: The x-coordinate of the chip, between 0 and 255 Return type: int
-
destination_chip_y
¶ The y-coordinate of the destination chip of the packet
Returns: The y-coordinate of the chip, between 0 and 255 Return type: int
-
destination_cpu
¶ The core on the destination chip
Returns: The core on the destination chip, between 0 and 31 Return type: int
-
destination_port
¶ The destination port of the packet
Returns: The destination port of the packet between 0 and 7 Return type: int
-
flags
¶ The flags of the packet
Returns: The flags of the packet Return type: spinnman.messages.sdp.sdp_flag.SDPFlag
-
static
from_bytestring
(data, offset)[source]¶ Read the header from a bytestring
Parameters: - data (str) – The bytestring to read the header from
- offset (int) – The offset into the data from which to start reading
-
source_chip_x
¶ The x-coordinate of the source chip of the packet
Returns: The x-coordinate of the chip, between 0 and 255 Return type: int
-
source_chip_y
¶ The y-coordinate of the source chip of the packet
Returns: The y-coordinate of the chip, between 0 and 255 Return type: int
-
source_cpu
¶ The core on the source chip
Returns: The core on the source chip, between 0 and 31 Return type: int
-
source_port
¶ The source port of the packet
Returns: The source port of the packet between 0 and 7 Return type: int
-
tag
¶ The tag of the packet
Returns: The tag of the packet between 0 and 255 Return type: int
- flags (
spinnman.messages.sdp.sdp_message module¶
-
class
spinnman.messages.sdp.sdp_message.
SDPMessage
(sdp_header, data=None, offset=0)[source]¶ Bases:
object
Wraps up an SDP message with a header and optional data.
Parameters: - sdp_header (
spinnman.messages.sdp.sdp_header.SDPHeader
) – The header of the message - data (bytes or bytearray or None) – The data of the SDP packet, or None if no data
- offset (int) – The offset where the valid data starts
Raises: None – No known exceptions are thrown
-
bytestring
¶ The bytestring of the message
Returns: The bytestring of the message Return type: str
-
data
¶ The data in the packet
Return type: bytes or bytearray or None
-
offset
¶ The offset where the valid data starts
Return type: int
-
sdp_header
¶ The header of the packet
Returns: An SDP header Return type: spinnman.messages.sdp.sdp_header.SDPHeader
- sdp_header (
Module contents¶
-
class
spinnman.messages.sdp.
SDPFlag
(value, doc='')[source]¶ Bases:
enum.Enum
SDPFlag for the message
-
REPLY_EXPECTED
= 135¶
-
REPLY_EXPECTED_NO_P2P
= 167¶
-
REPLY_NOT_EXPECTED
= 7¶
-
REPLY_NOT_EXPECTED_NO_P2P
= 39¶
-
-
class
spinnman.messages.sdp.
SDPHeader
(flags=None, tag=None, destination_port=None, destination_cpu=None, destination_chip_x=None, destination_chip_y=None, source_port=None, source_cpu=None, source_chip_x=None, source_chip_y=None)[source]¶ Bases:
object
Represents the header of an SDP message. Each optional parameter in the constructor can be set to a value other than None once, after which it is immutable. It is an error to set a parameter that is not currently None.
Parameters: - flags (
spinnman.messages.sdp.sdp_flag.SDPFlag
) – Any flags for the packet - tag (int) – The IP tag of the packet between 0 and 255, or None if it is to be set later
- destination_port (int) – The destination port of the packet between 0 and 7
- destination_cpu (int) – The destination processor ID within the chip between 0 and 31
- destination_chip_x (int) – The x-coordinate of the destination chip between 0 and 255
- destination_chip_y (int) – The y-coordinate of the destination chip between 0 and 255
- source_port (int) – The source port of the packet between 0 and 7, or None if it is to be set later
- source_cpu (int) – The source processor ID within the chip between 0 and 31, or None if it is to be set later
- source_chip_x (int) – The x-coordinate of the source chip between 0 and 255, or None if it is to be set later
- source_chip_y – The y-coordinate of the source chip between 0 and 255, or None if it is to be set later
-
bytestring
¶ The header as a bytestring
Returns: The header bytestring Return type: str
-
destination_chip_x
¶ The x-coordinate of the destination chip of the packet
Returns: The x-coordinate of the chip, between 0 and 255 Return type: int
-
destination_chip_y
¶ The y-coordinate of the destination chip of the packet
Returns: The y-coordinate of the chip, between 0 and 255 Return type: int
-
destination_cpu
¶ The core on the destination chip
Returns: The core on the destination chip, between 0 and 31 Return type: int
-
destination_port
¶ The destination port of the packet
Returns: The destination port of the packet between 0 and 7 Return type: int
-
flags
¶ The flags of the packet
Returns: The flags of the packet Return type: spinnman.messages.sdp.sdp_flag.SDPFlag
-
static
from_bytestring
(data, offset)[source]¶ Read the header from a bytestring
Parameters: - data (str) – The bytestring to read the header from
- offset (int) – The offset into the data from which to start reading
-
source_chip_x
¶ The x-coordinate of the source chip of the packet
Returns: The x-coordinate of the chip, between 0 and 255 Return type: int
-
source_chip_y
¶ The y-coordinate of the source chip of the packet
Returns: The y-coordinate of the chip, between 0 and 255 Return type: int
-
source_cpu
¶ The core on the source chip
Returns: The core on the source chip, between 0 and 31 Return type: int
-
source_port
¶ The source port of the packet
Returns: The source port of the packet between 0 and 7 Return type: int
-
tag
¶ The tag of the packet
Returns: The tag of the packet between 0 and 255 Return type: int
- flags (
-
class
spinnman.messages.sdp.
SDPMessage
(sdp_header, data=None, offset=0)[source]¶ Bases:
object
Wraps up an SDP message with a header and optional data.
Parameters: - sdp_header (
spinnman.messages.sdp.sdp_header.SDPHeader
) – The header of the message - data (bytes or bytearray or None) – The data of the SDP packet, or None if no data
- offset (int) – The offset where the valid data starts
Raises: None – No known exceptions are thrown
-
bytestring
¶ The bytestring of the message
Returns: The bytestring of the message Return type: str
-
data
¶ The data in the packet
Return type: bytes or bytearray or None
-
offset
¶ The offset where the valid data starts
Return type: int
-
sdp_header
¶ The header of the packet
Returns: An SDP header Return type: spinnman.messages.sdp.sdp_header.SDPHeader
- sdp_header (