spinnman.messages.eieio.command_messages package

Module contents

class spinnman.messages.eieio.command_messages.EIEIOCommandHeader(command: int | Enum)

Bases: object

EIEIO header for command packets.

Parameters:

command (int or Enum) –

property bytestring: bytes

The byte-string of the header.

Return type:

bytes

property command: int

The command/ value of the command passed into the init.

Return type:

int

static from_bytestring(data: bytes, offset: int) EIEIOCommandHeader[source]

Read an EIEIO command header from a byte-string.

Parameters:
  • data (bytes or bytearray) – The byte-string to read the data from

  • offset (int) – The offset where the valid data starts

Returns:

an EIEIO command header

Return type:

EIEIOCommandHeader

Raises:
class spinnman.messages.eieio.command_messages.EIEIOCommandMessage(eieio_command_header: EIEIOCommandHeader, data: bytes | None = None, offset: int = 0)

Bases: AbstractEIEIOMessage

An EIEIO command message.

Parameters:
  • eieio_command_header (EIEIOCommandHeader) – The header of the message

  • data (bytes) – Optional incoming data

  • offset (int) – Offset into the data where valid data begins

property bytestring: bytes

The eieio_command_header passed into the init as a byte string.

Return type:

bytes

property data: bytes | None

Gets the data passed into the init (if applicable).

Return type:

bytes or None

property eieio_header: EIEIOCommandHeader

The header of the message.

Gets the eieio_header passed into the init.

Return type:

EIEIOCommandHeader

static from_bytestring(command_header: EIEIOCommandHeader, data: bytes, offset: int) EIEIOCommandMessage[source]

Creates an EIEIOCommandMessage based on the supplied information.

Parameters:
Return type:

EIEIOCommandMessage

static get_min_packet_length() int[source]

Gets the min packet length for this type.

Return type:

int

property offset: int

Gets the offset passed into the init

Return type:

int

class spinnman.messages.eieio.command_messages.EventStopRequest

Bases: EIEIOCommandMessage

Packet used for the buffering input technique which causes the parser of the input packet to terminate its execution.

Parameters:
  • eieio_command_header (EIEIOCommandHeader) – The header of the message

  • data (bytes) – Optional incoming data

  • offset (int) – Offset into the data where valid data begins

class spinnman.messages.eieio.command_messages.HostDataRead(n_requests: int, sequence_no: int, channel: List[int] | int, region_id: List[int] | int, space_read: List[int] | int)

Bases: EIEIOCommandMessage

Packet sent by the host computer to the SpiNNaker system in the context of the buffering output technique to signal that the host has completed reading data from the output buffer, and that such space can be considered free to use again.

Parameters:
property bytestring: bytes

The eieio_command_header passed into the init as a byte string.

Return type:

bytes

channel(ack_id: int) int[source]

Gets the channel value for this ack_id.

Parameters:

ack_id (int) –

Return type:

int

Raises:

SpinnmanInvalidParameterTypeException – If the ack_id is invalid

static from_bytestring(command_header: EIEIOCommandHeader, data: bytes, offset: int) HostDataRead[source]

Creates an EIEIOCommandMessage based on the supplied information.

Parameters:
Return type:

EIEIOCommandMessage

static get_min_packet_length() int[source]

Gets the min packet length for this type.

Return type:

int

property n_requests: int

Gets the n_requests passed into the init.

Return type:

int

region_id(ack_id: int) int[source]

Gets the region_id value for this ack_id.

Parameters:

ack_id (int) –

Return type:

int

Raises:

SpinnmanInvalidParameterTypeException – If the ack_id is invalid

property sequence_no: int

Gets the sequence_no passed into the init.

Return type:

int

space_read(ack_id: int) int[source]

Gets the space_read value for this ack_id.

Parameters:

ack_id (int) –

Return type:

int

Raises:

SpinnmanInvalidParameterTypeException – If the ack_id is invalid

class spinnman.messages.eieio.command_messages.HostDataReadAck(sequence_no: int)

Bases: EIEIOCommandMessage

Packet sent by the host computer to the SpiNNaker system in the context of the buffering output technique to signal that the host has received a request to read data.

Parameters:

sequence_no (int) –

property bytestring: bytes

The eieio_command_header passed into the init as a byte string.

Return type:

bytes

static from_bytestring(command_header: EIEIOCommandHeader, data: bytes, offset: int) HostDataReadAck[source]

Creates an EIEIOCommandMessage based on the supplied information.

Parameters:
Return type:

EIEIOCommandMessage

property sequence_no: int

Gets the sequence_no passed into the init.

Return type:

int

class spinnman.messages.eieio.command_messages.HostSendSequencedData(region_id: int, sequence_no: int, eieio_data_message: AbstractEIEIOMessage)

Bases: EIEIOCommandMessage

Packet sent from the host to the SpiNNaker system in the context of buffering input mechanism to identify packet which needs to be stored in memory for future use.

Parameters:
property bytestring: bytes

The eieio_command_header passed into the init as a byte string.

Return type:

bytes

property eieio_data_message: AbstractEIEIOMessage

The eieio_data_message passed into the init.

Returns:

AbstractEIEIOMessage

static from_bytestring(command_header: EIEIOCommandHeader, data: bytes, offset: int) HostSendSequencedData[source]

Creates an EIEIOCommandMessage based on the supplied information.

Parameters:
Return type:

EIEIOCommandMessage

static get_min_packet_length() int[source]

Gets the min packet length for this type.

Return type:

int

property region_id: int

The region_id passed into the init.

Return type:

int

property sequence_no: int

The sequence_no passed into the init.

Return type:

int

class spinnman.messages.eieio.command_messages.NotificationProtocolDatabaseLocation(database_path=None)

Bases: EIEIOCommandMessage

Packet which contains the path to the database created by the toolchain which is to be used by any software which interfaces with SpiNNaker. Also the acknowledgement of that message.

This message is not sent to SpiNNaker boards but rather to an auxiliary tool (e.g., data visualiser).

Parameters:

database_path (str) – The location of the database. If None, this is an acknowledgement, stating that the database has now been read.

property bytestring

The eieio_command_header passed into the init as a byte string.

Return type:

bytes

property database_path: str | None

Gets the database path passed into the init.

The path is encoded by the init and decode back to a str here.

Return type:

str

static from_bytestring(command_header, data, offset)[source]

Creates an EIEIOCommandMessage based on the supplied information.

Parameters:
Return type:

EIEIOCommandMessage

class spinnman.messages.eieio.command_messages.NotificationProtocolPauseStop

Bases: EIEIOCommandMessage

Packet which indicates that the toolchain has paused or stopped.

This message is not sent to SpiNNaker boards but rather to an auxiliary tool (e.g., data visualiser).

Parameters:
  • eieio_command_header (EIEIOCommandHeader) – The header of the message

  • data (bytes) – Optional incoming data

  • offset (int) – Offset into the data where valid data begins

static from_bytestring(command_header, data, offset)[source]

Creates an EIEIOCommandMessage based on the supplied information.

Parameters:
Return type:

EIEIOCommandMessage

class spinnman.messages.eieio.command_messages.NotificationProtocolStartResume

Bases: EIEIOCommandMessage

Packet which indicates that the toolchain has started or resumed.

This message is not sent to SpiNNaker boards but rather to an auxiliary tool (e.g., data visualiser).

Parameters:
  • eieio_command_header (EIEIOCommandHeader) – The header of the message

  • data (bytes) – Optional incoming data

  • offset (int) – Offset into the data where valid data begins

static from_bytestring(command_header, data, offset)[source]

Creates an EIEIOCommandMessage based on the supplied information.

Parameters:
Return type:

EIEIOCommandMessage

class spinnman.messages.eieio.command_messages.PaddingRequest

Bases: EIEIOCommandMessage

Packet used to pad space in the buffering area, if needed.

Parameters:
  • eieio_command_header (EIEIOCommandHeader) – The header of the message

  • data (bytes) – Optional incoming data

  • offset (int) – Offset into the data where valid data begins

static get_min_packet_length()[source]

Gets the min packet length for this type.

Return type:

int

class spinnman.messages.eieio.command_messages.SpinnakerRequestBuffers(x: int, y: int, p: int, region_id: int, sequence_no: int, space_available: int)

Bases: EIEIOCommandMessage

Message used in the context of the buffering input mechanism which is sent by the SpiNNaker system to the host computer to ask for more data to inject during the simulation.

Parameters:
  • x (int) –

  • y (int) –

  • p (int) –

  • region_id (int) –

  • sequence_no (int) –

  • space_available (int) –

property bytestring: bytes

The eieio_command_header passed into the init as a byte string.

Return type:

bytes

static from_bytestring(command_header: EIEIOCommandHeader, data: bytes, offset: int) SpinnakerRequestBuffers[source]

Creates an EIEIOCommandMessage based on the supplied information.

Parameters:
Return type:

EIEIOCommandMessage

static get_min_packet_length() int[source]

Gets the min packet length for this type.

Return type:

int

property p: int

Gets the p value passed into the init

Return type:

int

property region_id: int

Gets the region_id value passed into the init

Return type:

int

property sequence_no: int

Gets the sequence_no value passed into the init

Return type:

int

property space_available: int

Gets the space_available value passed into the init

Return type:

int

property x: int

Gets the x value passed into the init

Return type:

int

property y: int

Gets the y value passed into the init

Return type:

int

class spinnman.messages.eieio.command_messages.SpinnakerRequestReadData(x: int, y: int, p: int, region_id: List[int] | int, sequence_no: int, n_requests: int, channel: List[int] | int, start_address: List[int] | int, space_to_be_read: List[int] | int)

Bases: EIEIOCommandMessage

Message used in the context of the buffering output mechanism which is sent from the SpiNNaker system to the host computer to signal that some data is available to be read.

Parameters:
property bytestring: bytes

The eieio_command_header passed into the init as a byte string.

Return type:

bytes

channel(request_id: int) int[source]

The channel for this request_id.

Parameters:

request_id (int) –

Return type:

int

Raises:

IndexError – If the request_id is invalid

static from_bytestring(command_header: EIEIOCommandHeader, data: bytes, offset: int) SpinnakerRequestReadData[source]

Creates an EIEIOCommandMessage based on the supplied information.

Parameters:
Return type:

EIEIOCommandMessage

static get_min_packet_length() int[source]

Gets the min packet length for this type.

Return type:

int

property n_requests: int

The n_requests value passed into the init.

Return type:

int

property p: int

The p value passed into the init.

Return type:

int

region_id(request_id) int[source]

The region_id for this request_id.

Parameters:

request_id (int) –

Return type:

int

Raises:

IndexError – If the request_id is invalid

property sequence_no: int

The sequence_no value passed into the init.

Return type:

int

space_to_be_read(request_id) int[source]

The space_to_be_read for this request_id.

Parameters:

request_id (int) –

Return type:

int

Raises:

IndexError – If the request_id is invalid

start_address(request_id) int[source]

The start_address for this request_id.

Parameters:

request_id (int) –

Return type:

int

Raises:

IndexError – If the request_id is invalid

property x: int

The x value passed into the init.

Return type:

int

property y: int

The y value passed into the init.

Return type:

int

class spinnman.messages.eieio.command_messages.StartRequests

Bases: EIEIOCommandMessage

Packet used in the context of buffering input for the host computer to signal to the SpiNNaker system that, if needed, it is possible to send more “SpinnakerRequestBuffers” packet.

Parameters:
  • eieio_command_header (EIEIOCommandHeader) – The header of the message

  • data (bytes) – Optional incoming data

  • offset (int) – Offset into the data where valid data begins

class spinnman.messages.eieio.command_messages.StopRequests

Bases: EIEIOCommandMessage

Packet used in the context of buffering input for the host computer to signal to the SpiNNaker system that to stop sending “SpinnakerRequestBuffers” packet.

Parameters:
  • eieio_command_header (EIEIOCommandHeader) – The header of the message

  • data (bytes) – Optional incoming data

  • offset (int) – Offset into the data where valid data begins