spinnman.connections.abstract_classes package

Module contents

class spinnman.connections.abstract_classes.Connection[source]

Bases: spinn_utilities.abstract_context_manager.AbstractContextManager

An abstract connection to the SpiNNaker board over some medium

close()[source]

Closes the connection

is_connected()[source]

Determines if the medium is connected at this point in time

Returns:True if the medium is connected, False otherwise
Return type:bool
Raises:SpinnmanIOException – If there is an error when determining the connectivity of the medium.
class spinnman.connections.abstract_classes.EIEIOReceiver[source]

Bases: spinnman.connections.abstract_classes.connection.Connection

A receiver of EIEIO data or commands

receive_eieio_message(timeout=None)[source]

Receives an EIEIO message from this connection. Blocks until a message has been received, or a timeout occurs.

Parameters:

timeout (int) – The time in seconds to wait for the message to arrive; if not specified, will wait forever, or until the connection is closed

Returns:

an EIEIO message

Return type:

AbstractEIEIOMessage

Raises:
class spinnman.connections.abstract_classes.EIEIOSender[source]

Bases: spinnman.connections.abstract_classes.connection.Connection

A sender of EIEIO messages

send_eieio_message(eieio_message)[source]

Sends an EIEIO message down this connection

Parameters:eieio_message (AbstractEIEIOMessage) – The EIEIO message to be sent
Raises:SpinnmanIOException – If there is an error sending the message
class spinnman.connections.abstract_classes.Listenable[source]

Bases: object

An interface for connections that can listen for incoming messages.

get_receive_method()[source]

Get the method that receives for this connection.

is_ready_to_receive(timeout=0)[source]

Determines if there is an SCP packet to be read without blocking.

Parameters:timeout (int) – The time to wait before returning if the connection is not ready
Returns:True if there is an SCP packet to be read
Return type:bool
class spinnman.connections.abstract_classes.MulticastReceiver[source]

Bases: spinnman.connections.abstract_classes.connection.Connection

A receiver of multicast messages

get_input_chips()[source]

Get a list of chips which identify the chips from which this receiver can receive receive packets directly

Returns:The coordinates, (x, y), of the chips
Return type:iterable(tuple(int, int))
receive_multicast_message(timeout=None)[source]

Receives a multicast message from this connection. Blocks until a message has been received, or a timeout occurs.

Parameters:

timeout (int) – The time in seconds to wait for the message to arrive; if not specified, will wait forever, or until the connection is closed

Returns:

a multicast message

Return type:

MulticastMessage

Raises:
class spinnman.connections.abstract_classes.MulticastSender[source]

Bases: spinnman.connections.abstract_classes.connection.Connection

A sender of Multicast messages

get_input_chips()[source]

Get a list of chips which identify the chips to which this sender can send multicast packets directly

Returns:The coordinates, (x, y), of the chips
Return type:iterable(tuple(int, int))
send_multicast_message(multicast_message)[source]

Sends a SpiNNaker multicast message using this connection

Parameters:multicast_message (MulticastMessage) – The message to be sent
Raises:SpinnmanIOException – If there is an error sending the message
class spinnman.connections.abstract_classes.SCPReceiver[source]

Bases: spinnman.connections.abstract_classes.connection.Connection

A receiver of SCP messages

is_ready_to_receive(timeout=0)[source]

Determines if there is an SCP packet to be read without blocking

Parameters:timeout (int) – The time to wait before returning if the connection is not ready
Returns:True if there is an SCP packet to be read
Return type:bool
receive_scp_response(timeout=1.0)[source]

Receives an SCP response from this connection. Blocks until a message has been received, or a timeout occurs.

Parameters:

timeout (int) – The time in seconds to wait for the message to arrive; if not specified, will wait forever, or until the connection is closed

Returns:

The SCP result, the sequence number, the data of the response and the offset at which the data starts (i.e., where the SDP header starts).

Return type:

tuple(SCPResult, int, bytes, int)

Raises:
class spinnman.connections.abstract_classes.SCPSender[source]

Bases: spinnman.connections.abstract_classes.connection.Connection

A sender of SCP messages

chip_x

The x-coordinate of the chip at which messages sent down this connection will arrive at first

Return type:int
chip_y

The y-coordinate of the chip at which messages sent down this connection will arrive at first

Return type:int
get_scp_data(scp_request)[source]

Returns the data of an SCP request as it would be sent down this connection

send_scp_request(scp_request)[source]

Sends an SCP request down this connection

Messages must have the following properties:

  • source_port is None or 7
  • source_cpu is None or 31
  • source_chip_x is None or 0
  • source_chip_y is None or 0

tag in the message is optional; if not set, the default set in the constructor will be used. sequence in the message is optional; if not set, (sequence number last assigned + 1) % 65536 will be used

Parameters:scp_request (AbstractSCPRequest) – message packet to send
Raises:SpinnmanIOException – If there is an error sending the message
class spinnman.connections.abstract_classes.SDPReceiver[source]

Bases: spinnman.connections.abstract_classes.connection.Connection

A receiver of SDP messages

receive_sdp_message(timeout=None)[source]

Receives an SDP message from this connection. Blocks until the message has been received, or a timeout occurs.

Parameters:

timeout (int) – The time in seconds to wait for the message to arrive; if not specified, will wait forever, or until the connection is closed.

Returns:

The received SDP message

Return type:

SDPMessage

Raises:
class spinnman.connections.abstract_classes.SDPSender[source]

Bases: spinnman.connections.abstract_classes.connection.Connection

A sender of SDP messages.

send_sdp_message(sdp_message)[source]

Sends an SDP message down this connection

Parameters:sdp_message (SDPMessage) – The SDP message to be sent
Raises:SpinnmanIOException – If there is an error sending the message.
class spinnman.connections.abstract_classes.SpinnakerBootReceiver[source]

Bases: spinnman.connections.abstract_classes.connection.Connection

A receiver of SpiNNaker boot messages

receive_boot_message(timeout=None)[source]

Receives a boot message from this connection. Blocks until a message has been received, or a timeout occurs.

Parameters:

timeout (int) – The time in seconds to wait for the message to arrive; if not specified, will wait forever, or until the connection is closed.

Returns:

a boot message

Return type:

SpinnakerBootMessage

Raises:
class spinnman.connections.abstract_classes.SpinnakerBootSender[source]

Bases: spinnman.connections.abstract_classes.connection.Connection

A sender of SpiNNaker Boot messages

send_boot_message(boot_message)[source]

Sends a SpiNNaker boot message using this connection.

Parameters:boot_message (SpinnakerBootMessage) – The message to be sent
Raises:SpinnmanIOException – If there is an error sending the message