spinnman.connections.abstract_classes package

Submodules

spinnman.connections.abstract_classes.connection module

class spinnman.connections.abstract_classes.connection.Connection[source]

Bases: object

An abstract connection to the SpiNNaker board over some medium

close()[source]

Closes the connection

Returns:Nothing is returned
Return type:None
Raises:None – No known exceptions are raised
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:spinnman.exceptions.SpinnmanIOException – If there is an error when determining the connectivity of the medium.

spinnman.connections.abstract_classes.eieio_receiver module

class spinnman.connections.abstract_classes.eieio_receiver.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:

spinnman.messages.eieio.AbstractEIEIOMessage

Raises:

spinnman.connections.abstract_classes.eieio_sender module

class spinnman.connections.abstract_classes.eieio_sender.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 (spinnman.messages.eieio.AbstractEIEIOMessage) – The EIEIO message to be sent
Raises:spinnman.exceptions.SpinnmanIOException – If there is an error sending the message

spinnman.connections.abstract_classes.listenable module

class spinnman.connections.abstract_classes.listenable.Listenable[source]

Bases: object

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

spinnman.connections.abstract_classes.multicast_receiver module

class spinnman.connections.abstract_classes.multicast_receiver.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 of (int, int)
Raises:None – No known exceptions are raised
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:

spinnman.messages.multicast_message.MulticastMessage

Raises:

spinnman.connections.abstract_classes.multicast_sender module

class spinnman.connections.abstract_classes.multicast_sender.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 of (int, int)
Raises:None – No known exceptions are raised
send_multicast_message(multicast_message)[source]

Sends a SpiNNaker multicast message using this connection

Parameters:multicast_message (spinnman.messages.multicast_message.MulticastMessage) – The message to be sent
Returns:Nothing is returned
Return type:None
Raises:spinnman.exceptions.SpinnmanIOException – If there is an error sending the message

spinnman.connections.abstract_classes.scp_receiver module

class spinnman.connections.abstract_classes.scp_receiver.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(spinnman.messages.scp.scp_result.SCPResult, int, bytestring, int)

Raises:

spinnman.connections.abstract_classes.scp_sender module

class spinnman.connections.abstract_classes.scp_sender.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 (spinnman.messages.scp.abstract_scp_request.AbstractSCPRequest) – message packet to send
Returns:Nothing is returned
Return type:None
Raises:spinnman.exceptions.SpinnmanIOException – If there is an error sending the message

spinnman.connections.abstract_classes.sdp_receiver module

class spinnman.connections.abstract_classes.sdp_receiver.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:

spinnman.messages.sdp.sdp_message.SDPMessage

Raises:

spinnman.connections.abstract_classes.sdp_sender module

class spinnman.connections.abstract_classes.sdp_sender.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 (spinnman.messages.sdp.sdp_message.SDPMessage) – The SDP message to be sent
Return type:None
Raises:spinnman.exceptions.SpinnmanIOException – If there is an error sending the message.

spinnman.connections.abstract_classes.spinnaker_boot_receiver module

class spinnman.connections.abstract_classes.spinnaker_boot_receiver.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:

spinnman.messages.spinnaker_boot.SpinnakerBootMessage

Raises:

spinnman.connections.abstract_classes.spinnaker_boot_sender module

class spinnman.connections.abstract_classes.spinnaker_boot_sender.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 (spinnman.messages.spinnaker_boot.SpinnakerBootMessage) – The message to be sent
Returns:Nothing is returned
Return type:None
Raises:spinnman.exceptions.SpinnmanIOException – If there is an error sending the message

Module contents

class spinnman.connections.abstract_classes.Connection[source]

Bases: object

An abstract connection to the SpiNNaker board over some medium

close()[source]

Closes the connection

Returns:Nothing is returned
Return type:None
Raises:None – No known exceptions are raised
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:spinnman.exceptions.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:

spinnman.messages.eieio.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 (spinnman.messages.eieio.AbstractEIEIOMessage) – The EIEIO message to be sent
Raises:spinnman.exceptions.SpinnmanIOException – If there is an error sending the message
class spinnman.connections.abstract_classes.Listenable[source]

Bases: object

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 of (int, int)
Raises:None – No known exceptions are raised
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:

spinnman.messages.multicast_message.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 of (int, int)
Raises:None – No known exceptions are raised
send_multicast_message(multicast_message)[source]

Sends a SpiNNaker multicast message using this connection

Parameters:multicast_message (spinnman.messages.multicast_message.MulticastMessage) – The message to be sent
Returns:Nothing is returned
Return type:None
Raises:spinnman.exceptions.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(spinnman.messages.scp.scp_result.SCPResult, int, bytestring, 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 (spinnman.messages.scp.abstract_scp_request.AbstractSCPRequest) – message packet to send
Returns:Nothing is returned
Return type:None
Raises:spinnman.exceptions.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:

spinnman.messages.sdp.sdp_message.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 (spinnman.messages.sdp.sdp_message.SDPMessage) – The SDP message to be sent
Return type:None
Raises:spinnman.exceptions.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:

spinnman.messages.spinnaker_boot.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 (spinnman.messages.spinnaker_boot.SpinnakerBootMessage) – The message to be sent
Returns:Nothing is returned
Return type:None
Raises:spinnman.exceptions.SpinnmanIOException – If there is an error sending the message