Previous topic

spinnman.messages.eieio.data_messages.eieio_data_header module

Next topic

spinnman.messages.eieio.data_messages.eieio_key_data_element module

This Page

spinnman.messages.eieio.data_messages.eieio_data_message module

class spinnman.messages.eieio.data_messages.eieio_data_message.EIEIODataMessage(eieio_header, data_reader=None)[source]

Bases: spinnman.messages.eieio.abstract_messages.abstract_eieio_message.AbstractEIEIOMessage

An EIEIO Data message

Parameters:

Attributes

eieio_header
is_next_element Determine if there is another element to be read
max_n_elements The maximum number of elements that can fit in the packet
n_elements The number of elements in the packet
next_element The next element to be read, or None if no more elements.
size The size of the packet with the current contents

Methods

add_element(element) Add an element to the message.
min_packet_length(eieio_type[, is_prefix, ...]) The minimum length of a message with the given header, in bytes
write_eieio_message(byte_writer)

Detailed Methods

add_element(element)[source]

Add an element to the message. The correct type of element must be added, depending on the header values

Parameters:

element (spinnman.messages.eieio.data_messages.abstract_eieio_data_element.AbstractEIEIODataElement) – The element to be added

Raises:
  • SpinnmanInvalidParameterException – If the element is not compatible with the header
  • SpinnmanInvalidPacketException – If the message was created to read data from a reader
static min_packet_length(eieio_type, is_prefix=False, is_payload_base=False)[source]

The minimum length of a message with the given header, in bytes

Parameters:
  • eieio_type (spinnman.spinnman.messages.eieio.eieio_type.EIEIOType) – the type of message
  • is_prefix (bool) – True if there is a prefix, False otherwise
  • is_payload_base (bool) – True if there is a payload base, False otherwise
Returns:

The minimum size of the packet in bytes

Return type:

int

write_eieio_message(byte_writer)[source]