spinnman.connections.abstract_classes package

Submodules

spinnman.connections.abstract_classes.abstract_connection module

class spinnman.connections.abstract_classes.abstract_connection.AbstractConnection[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.abstract_eieio_receiver module

class spinnman.connections.abstract_classes.abstract_eieio_receiver.AbstractEIEIOReceiver[source]

Bases: spinnman.connections.abstract_classes.abstract_connection.AbstractConnection

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.abstract_messages.abstractMulticastMessage

Raises:

spinnman.connections.abstract_classes.abstract_eieio_sender module

class spinnman.connections.abstract_classes.abstract_eieio_sender.AbstractEIEIOSender[source]

Bases: spinnman.connections.abstract_classes.abstract_connection.AbstractConnection

A sender of EIEIO messages

send_eieio_message(eieio_message)[source]

Sends an EIEIO message down this connection

Parameters:eieio_message (spinnman.messages.eieio.abstract_messages.abstract_eieio_message.AbstractEIEIOMessage) – The eieio message to be sent
Raises:spinnman.exceptions.SpinnmanIOException – If there is an error sending the message

spinnman.connections.abstract_classes.abstract_listenable module

class spinnman.connections.abstract_classes.abstract_listenable.AbstractListenable[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.abstract_multicast_receiver module

class spinnman.connections.abstract_classes.abstract_multicast_receiver.AbstractMulticastReceiver[source]

Bases: spinnman.connections.abstract_classes.abstract_connection.AbstractConnection

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:An iterable of tuples of (x, y) where x is the x-coordinate of the chip and y is the y-coordinate of the chip
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.abstract_multicast_sender module

class spinnman.connections.abstract_classes.abstract_multicast_sender.AbstractMulticastSender[source]

Bases: spinnman.connections.abstract_classes.abstract_connection.AbstractConnection

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:An iterable of tuples of (x, y) where x is the x-coordinate of the chip and y is the y-coordinate of the chip
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.abstract_scp_receiver module

class spinnman.connections.abstract_classes.abstract_scp_receiver.AbstractSCPReceiver[source]

Bases: spinnman.connections.abstract_classes.abstract_connection.AbstractConnection

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:

:py:class: spinnman.messages.scp.scp_result.SCPResult, int, bytestring, int

Raises:

spinnman.connections.abstract_classes.abstract_scp_sender module

class spinnman.connections.abstract_classes.abstract_scp_sender.AbstractSCPSender[source]

Bases: spinnman.connections.abstract_classes.abstract_connection.AbstractConnection

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.abstract_sdp_receiver module

class spinnman.connections.abstract_classes.abstract_sdp_receiver.AbstractSDPReceiver[source]

Bases: spinnman.connections.abstract_classes.abstract_connection.AbstractConnection

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.abstract_sdp_sender module

class spinnman.connections.abstract_classes.abstract_sdp_sender.AbstractSDPSender[source]

Bases: spinnman.connections.abstract_classes.abstract_connection.AbstractConnection

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
Returns:Nothing is returned
Return type:None
Raises:spinnman.exceptions.SpinnmanIOException – If there is an error sending the message

spinnman.connections.abstract_classes.abstract_spinnaker_boot_receiver module

class spinnman.connections.abstract_classes.abstract_spinnaker_boot_receiver.AbstractSpinnakerBootReceiver[source]

Bases: spinnman.connections.abstract_classes.abstract_connection.AbstractConnection

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.spinnaker_boot_message.SpinnakerBootMessage

Raises:

spinnman.connections.abstract_classes.abstract_spinnaker_boot_sender module

class spinnman.connections.abstract_classes.abstract_spinnaker_boot_sender.AbstractSpinnakerBootSender[source]

Bases: spinnman.connections.abstract_classes.abstract_connection.AbstractConnection

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.spinnaker_boot_message.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