spinnman.messages.sdp package¶
Module contents¶
- class spinnman.messages.sdp.SDPFlag(value)¶
Bases:
EnumSDPFlag 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: SDPFlag, tag: int | None = None, destination_port: int = 0, destination_cpu: int = 0, destination_chip_x: int = 0, destination_chip_y: int = 0, source_port: int | None = None, source_cpu: int | None = None, source_chip_x: int | None = None, source_chip_y: int | None = None)¶
Bases:
objectRepresents 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 – Any flags for the packet
tag – The IP tag of the packet between 0 and 255, or None if it is to be set later
destination_port – The destination port of the packet between 0 and 7
destination_cpu – The destination processor ID within the chip between 0 and 31
destination_chip_x – The x-coordinate of the destination chip between 0 and 255
destination_chip_y – The y-coordinate of the destination chip between 0 and 255
source_port – The source port of the packet between 0 and 7, or None if it is to be set later
source_cpu – The source processor ID within the chip between 0 and 31, or None if it is to be set later
source_chip_x – 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
- property destination_chip_x: int¶
The x-coordinate of the destination chip of the packet, between 0 and 255 (settable).
- property destination_chip_y: int¶
The y-coordinate of the destination chip of the packet, between 0 and 255 (settable).
- static from_bytestring(data: bytes, offset: int) SDPHeader[source]¶
- Parameters:
data – The byte-string to read the header from
offset – The offset into the data from which to start reading
- Returns:
The header from the byte-string.
- get_physical_cpu_id() str[source]¶
A String describing the physical core of the destination.
- Returns:
A report / debug representation of the destination
- property source_chip_x: int¶
The x-coordinate of the source chip of the packet, between 0 and 255 (settable).
- class spinnman.messages.sdp.SDPMessage(sdp_header: SDPHeader, data: bytes | None = None, offset: int = 0)¶
Bases:
objectWraps up an SDP message with a header and optional data.
- Parameters:
sdp_header – The header of the message
data – The data of the SDP packet, or None if no data
offset – The offset where the valid data starts
- static from_bytestring(data: bytes, offset: int) SDPMessage[source]¶
- Parameters:
data
offset
- Returns:
The message from the byte-string.