spinnman.connections.udp_packet_connections package

Submodules

spinnman.connections.udp_packet_connections.bmp_connection module

class spinnman.connections.udp_packet_connections.bmp_connection.BMPConnection(cabinet, frame, boards, local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.udp_packet_connections.udp_connection.UDPConnection, spinnman.connections.abstract_classes.scp_receiver.SCPReceiver, spinnman.connections.abstract_classes.scp_sender.SCPSender

A BMP connection which supports queries to the BMP of a SpiNNaker machine

Parameters:
  • cabinet (int) – The cabinet number of the connection
  • frame (int) – The frame number of the connection
  • boards (iterable of int) – The boards that the connection can control on the same backplane
  • local_host (str) – The optional ip address or host name of the local interface to listen on
  • local_port (int) – The optional local port to listen on
  • remote_host (str) – The optional remote host name or ip address to send messages to. If not specified, sending will not be possible using this connection
  • remote_port – The optional remote port number to send messages to. If not specified, sending will not be possible using this connection
boards

The set of boards supported by the BMP

Return type:iterable of int
cabinet

The cabinet id of the BMP

Return type:int
chip_x

Defined to satisfy the SCPSender - always 0 for a BMP

chip_y

Defined to satisfy the SCPSender - always 0 for a BMP

frame

The frame id of the BMP

Return type:int
get_scp_data(scp_request)[source]
receive_scp_response(timeout=1.0)[source]
send_scp_request(scp_request)[source]

spinnman.connections.udp_packet_connections.boot_connection module

class spinnman.connections.udp_packet_connections.boot_connection.BootConnection(local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.udp_packet_connections.udp_connection.UDPConnection, spinnman.connections.abstract_classes.spinnaker_boot_sender.SpinnakerBootSender, spinnman.connections.abstract_classes.spinnaker_boot_receiver.SpinnakerBootReceiver

A connection to the spinnaker board that uses UDP to for booting

Parameters:
  • local_host (str) – The local host name or ip address to bind to. If not specified defaults to bind to all interfaces, unless remote_host is specified, in which case binding is _done to the ip address that will be used to send packets
  • local_port (int) – The local port to bind to, between 1025 and 65535. If not specified, defaults to a random unused local port
  • remote_host (str) – The remote host name or ip address to send packets to. If not specified, the socket will be available for listening only, and will throw and exception if used for sending
  • remote_port – The remote port to send packets to. If remote_host is None, this is ignored.
Raises:

spinnman.exceptions.SpinnmanIOException – If there is an error setting up the communication channel

receive_boot_message(timeout=None)[source]

See spinnman.connections.abstract_classes.spinnaker_boot_receiver.SpinnakerBootReceiver.receive_boot_message()

send_boot_message(boot_message)[source]

See spinnman.connections.abstract_classes.spinnaker_boot_sender.SpinnakerBootSender.send_boot_message()

spinnman.connections.udp_packet_connections.eieio_connection module

class spinnman.connections.udp_packet_connections.eieio_connection.EIEIOConnection(local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.udp_packet_connections.udp_connection.UDPConnection, spinnman.connections.abstract_classes.eieio_receiver.EIEIOReceiver, spinnman.connections.abstract_classes.eieio_sender.EIEIOSender, spinnman.connections.abstract_classes.listenable.Listenable

A UDP connection for sending and receiving raw EIEIO messages

Parameters:
  • local_host (str) – The optional ip address or host name of the local interface to listen on
  • local_port (int) – The optional local port to listen on
  • remote_host (str) – The optional remote host name or ip address to send messages to. If not specified, sending will not be possible using this connection
  • remote_port – The optional remote port number to send messages to. If not specified, sending will not be possible using this connection
get_receive_method()[source]
receive_eieio_message(timeout=None)[source]
send_eieio_message(eieio_message)[source]
send_eieio_message_to(eieio_message, ip_address, port)[source]

spinnman.connections.udp_packet_connections.ip_address_connection module

class spinnman.connections.udp_packet_connections.ip_address_connection.IPAddressesConnection(local_host=None, local_port=54321)[source]

Bases: spinnman.connections.udp_packet_connections.udp_connection.UDPConnection

A connection that detects any UDP packet that is transmitted by spinnaker boards prior to boot

receive_ip_address(timeout=None)[source]
supports_sends_message(message)[source]

spinnman.connections.udp_packet_connections.scamp_connection module

class spinnman.connections.udp_packet_connections.scamp_connection.SCAMPConnection(chip_x=255, chip_y=255, local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.udp_packet_connections.sdp_connection.SDPConnection, spinnman.connections.abstract_classes.scp_sender.SCPSender, spinnman.connections.abstract_classes.scp_receiver.SCPReceiver

A UDP connection to SCAMP on the board

Parameters:
  • chip_x (int) – The x-coordinate of the chip on the board with this remote_host
  • chip_y (int) – The y-coordinate of the chip on the board with this remote_host
  • local_host (str) – The optional ip address or host name of the local interface to listen on
  • local_port (int) – The optional local port to listen on
  • remote_host (str) – The optional remote host name or ip address to send messages to. If not specified, sending will not be possible using this connection
  • remote_port (int) – The optional remote port number to send messages to. If not specified, sending will not be possible using this connection
chip_x
chip_y
get_scp_data(scp_request)[source]
receive_scp_response(timeout=1.0)[source]
send_scp_request(scp_request)[source]
update_chip_coordinates(x, y)[source]

spinnman.connections.udp_packet_connections.sdp_connection module

class spinnman.connections.udp_packet_connections.sdp_connection.SDPConnection(chip_x=None, chip_y=None, local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.udp_packet_connections.udp_connection.UDPConnection, spinnman.connections.abstract_classes.sdp_receiver.SDPReceiver, spinnman.connections.abstract_classes.sdp_sender.SDPSender, spinnman.connections.abstract_classes.listenable.Listenable

Parameters:
  • chip_x (int) – The optional x-coordinate of the chip at the remote end of the connection. If not specified, it will not be possible to send SDP messages that require a response with this connection.
  • chip_y (int) – The optional y-coordinate of the chip at the remote end of the connection. If not specified, it will not be possible to send SDP messages that require a response with this connection.
  • local_host (str) – The optional ip address or host name of the local interface to listen on
  • local_port (int) – The optional local port to listen on
  • remote_host (str) – The optional remote host name or ip address to send messages to. If not specified, sending will not be possible using this connection
  • remote_port – The optional remote port number to send messages to. If not specified, sending will not be possible using this connection
get_receive_method()[source]
receive_sdp_message(timeout=None)[source]
send_sdp_message(sdp_message)[source]

spinnman.connections.udp_packet_connections.udp_connection module

class spinnman.connections.udp_packet_connections.udp_connection.UDPConnection(local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.abstract_classes.connection.Connection

Parameters:
  • local_host (str or None) – The local host name or ip address to bind to. If not specified defaults to bind to all interfaces, unless remote_host is specified, in which case binding is _done to the ip address that will be used to send packets
  • local_port (int) – The local port to bind to, between 1025 and 65535. If not specified, defaults to a random unused local port
  • remote_host (str or None) – The remote host name or ip address to send packets to. If not specified, the socket will be available for listening only, and will throw and exception if used for sending
  • remote_port – The remote port to send packets to. If remote_host is None, this is ignored. If remote_host is specified, this must also be specified for the connection to allow sending
Raises:

spinnman.exceptions.SpinnmanIOException – If there is an error setting up the communication channel

close()[source]

See spinnman.connections.abstract_classes.connection.Connection.close()

is_connected()[source]

See spinnman.connections.abstract_classes.connection.Connection.is_connected()

is_ready_to_receive(timeout=0)[source]
local_ip_address

The local IP address to which the connection is bound.

Returns:The local ip address as a dotted string e.g. 0.0.0.0
Return type:str
Raises:None – No known exceptions are thrown
local_port

The local port to which the connection is bound.

Returns:The local port number
Return type:int
Raises:None – No known exceptions are thrown
receive(timeout=None)[source]

Receive data from the connection

Parameters:

timeout (None or float) – The timeout in seconds, or None to wait forever

Returns:

The data received as a bytestring

Return type:

str

Raises:
receive_with_address(timeout=None)[source]

Receive data from the connection along with the address where the data was received from

Parameters:

timeout (None) – The timeout, or None to wait forever

Returns:

A tuple of the data received and a tuple of the (address, port) received from

Return type:

str, (str, int)

Raises:
remote_ip_address

The remote ip address to which the connection is connected.

Returns:The remote ip address as a dotted string, or None if not connected remotely
Return type:str
remote_port

The remote port to which the connection is connected.

Returns:The remote port, or None if not connected remotely
Return type:int
send(data)[source]

Send data down this connection

Parameters:data (str) – The data to be sent
Raises:SpinnmanIOException – If there is an error sending the data
send_to(data, address)[source]

Send data down this connection

Parameters:
  • data (str) – The data to be sent as a bytestring
  • address ((str, int)) – A tuple of (address, port) to send the data to
Raises:

SpinnmanIOException – If there is an error sending the data

spinnman.connections.udp_packet_connections.udp_listenable_connection module

class spinnman.connections.udp_packet_connections.udp_listenable_connection.UDPListenableConnection(local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.udp_packet_connections.udp_connection.UDPConnection, spinnman.connections.abstract_classes.listenable.Listenable

get_receive_method()[source]

Get the method that receives for this connection

spinnman.connections.udp_packet_connections.utils module

spinnman.connections.udp_packet_connections.utils.update_sdp_header_for_udp_send(sdp_header, source_x, source_y)[source]

Apply defaults to the sdp header for sending over UDP

Parameters:sdp_header (spinnman.messages.sdp.sdp_header.SDPHeader) – The SDP header values
Returns:Nothing is returned

Module contents

class spinnman.connections.udp_packet_connections.BMPConnection(cabinet, frame, boards, local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.udp_packet_connections.udp_connection.UDPConnection, spinnman.connections.abstract_classes.scp_receiver.SCPReceiver, spinnman.connections.abstract_classes.scp_sender.SCPSender

A BMP connection which supports queries to the BMP of a SpiNNaker machine

Parameters:
  • cabinet (int) – The cabinet number of the connection
  • frame (int) – The frame number of the connection
  • boards (iterable of int) – The boards that the connection can control on the same backplane
  • local_host (str) – The optional ip address or host name of the local interface to listen on
  • local_port (int) – The optional local port to listen on
  • remote_host (str) – The optional remote host name or ip address to send messages to. If not specified, sending will not be possible using this connection
  • remote_port – The optional remote port number to send messages to. If not specified, sending will not be possible using this connection
boards

The set of boards supported by the BMP

Return type:iterable of int
cabinet

The cabinet id of the BMP

Return type:int
chip_x

Defined to satisfy the SCPSender - always 0 for a BMP

chip_y

Defined to satisfy the SCPSender - always 0 for a BMP

frame

The frame id of the BMP

Return type:int
get_scp_data(scp_request)[source]
receive_scp_response(timeout=1.0)[source]
send_scp_request(scp_request)[source]
class spinnman.connections.udp_packet_connections.BootConnection(local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.udp_packet_connections.udp_connection.UDPConnection, spinnman.connections.abstract_classes.spinnaker_boot_sender.SpinnakerBootSender, spinnman.connections.abstract_classes.spinnaker_boot_receiver.SpinnakerBootReceiver

A connection to the spinnaker board that uses UDP to for booting

Parameters:
  • local_host (str) – The local host name or ip address to bind to. If not specified defaults to bind to all interfaces, unless remote_host is specified, in which case binding is _done to the ip address that will be used to send packets
  • local_port (int) – The local port to bind to, between 1025 and 65535. If not specified, defaults to a random unused local port
  • remote_host (str) – The remote host name or ip address to send packets to. If not specified, the socket will be available for listening only, and will throw and exception if used for sending
  • remote_port – The remote port to send packets to. If remote_host is None, this is ignored.
Raises:

spinnman.exceptions.SpinnmanIOException – If there is an error setting up the communication channel

receive_boot_message(timeout=None)[source]

See spinnman.connections.abstract_classes.spinnaker_boot_receiver.SpinnakerBootReceiver.receive_boot_message()

send_boot_message(boot_message)[source]

See spinnman.connections.abstract_classes.spinnaker_boot_sender.SpinnakerBootSender.send_boot_message()

class spinnman.connections.udp_packet_connections.UDPConnection(local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.abstract_classes.connection.Connection

Parameters:
  • local_host (str or None) – The local host name or ip address to bind to. If not specified defaults to bind to all interfaces, unless remote_host is specified, in which case binding is _done to the ip address that will be used to send packets
  • local_port (int) – The local port to bind to, between 1025 and 65535. If not specified, defaults to a random unused local port
  • remote_host (str or None) – The remote host name or ip address to send packets to. If not specified, the socket will be available for listening only, and will throw and exception if used for sending
  • remote_port – The remote port to send packets to. If remote_host is None, this is ignored. If remote_host is specified, this must also be specified for the connection to allow sending
Raises:

spinnman.exceptions.SpinnmanIOException – If there is an error setting up the communication channel

close()[source]

See spinnman.connections.abstract_classes.connection.Connection.close()

is_connected()[source]

See spinnman.connections.abstract_classes.connection.Connection.is_connected()

is_ready_to_receive(timeout=0)[source]
local_ip_address

The local IP address to which the connection is bound.

Returns:The local ip address as a dotted string e.g. 0.0.0.0
Return type:str
Raises:None – No known exceptions are thrown
local_port

The local port to which the connection is bound.

Returns:The local port number
Return type:int
Raises:None – No known exceptions are thrown
receive(timeout=None)[source]

Receive data from the connection

Parameters:

timeout (None or float) – The timeout in seconds, or None to wait forever

Returns:

The data received as a bytestring

Return type:

str

Raises:
receive_with_address(timeout=None)[source]

Receive data from the connection along with the address where the data was received from

Parameters:

timeout (None) – The timeout, or None to wait forever

Returns:

A tuple of the data received and a tuple of the (address, port) received from

Return type:

str, (str, int)

Raises:
remote_ip_address

The remote ip address to which the connection is connected.

Returns:The remote ip address as a dotted string, or None if not connected remotely
Return type:str
remote_port

The remote port to which the connection is connected.

Returns:The remote port, or None if not connected remotely
Return type:int
send(data)[source]

Send data down this connection

Parameters:data (str) – The data to be sent
Raises:SpinnmanIOException – If there is an error sending the data
send_to(data, address)[source]

Send data down this connection

Parameters:
  • data (str) – The data to be sent as a bytestring
  • address ((str, int)) – A tuple of (address, port) to send the data to
Raises:

SpinnmanIOException – If there is an error sending the data

class spinnman.connections.udp_packet_connections.EIEIOConnection(local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.udp_packet_connections.udp_connection.UDPConnection, spinnman.connections.abstract_classes.eieio_receiver.EIEIOReceiver, spinnman.connections.abstract_classes.eieio_sender.EIEIOSender, spinnman.connections.abstract_classes.listenable.Listenable

A UDP connection for sending and receiving raw EIEIO messages

Parameters:
  • local_host (str) – The optional ip address or host name of the local interface to listen on
  • local_port (int) – The optional local port to listen on
  • remote_host (str) – The optional remote host name or ip address to send messages to. If not specified, sending will not be possible using this connection
  • remote_port – The optional remote port number to send messages to. If not specified, sending will not be possible using this connection
get_receive_method()[source]
receive_eieio_message(timeout=None)[source]
send_eieio_message(eieio_message)[source]
send_eieio_message_to(eieio_message, ip_address, port)[source]
class spinnman.connections.udp_packet_connections.IPAddressesConnection(local_host=None, local_port=54321)[source]

Bases: spinnman.connections.udp_packet_connections.udp_connection.UDPConnection

A connection that detects any UDP packet that is transmitted by spinnaker boards prior to boot

receive_ip_address(timeout=None)[source]
supports_sends_message(message)[source]
class spinnman.connections.udp_packet_connections.UDPListenableConnection(local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.udp_packet_connections.udp_connection.UDPConnection, spinnman.connections.abstract_classes.listenable.Listenable

get_receive_method()[source]

Get the method that receives for this connection

class spinnman.connections.udp_packet_connections.SCAMPConnection(chip_x=255, chip_y=255, local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.udp_packet_connections.sdp_connection.SDPConnection, spinnman.connections.abstract_classes.scp_sender.SCPSender, spinnman.connections.abstract_classes.scp_receiver.SCPReceiver

A UDP connection to SCAMP on the board

Parameters:
  • chip_x (int) – The x-coordinate of the chip on the board with this remote_host
  • chip_y (int) – The y-coordinate of the chip on the board with this remote_host
  • local_host (str) – The optional ip address or host name of the local interface to listen on
  • local_port (int) – The optional local port to listen on
  • remote_host (str) – The optional remote host name or ip address to send messages to. If not specified, sending will not be possible using this connection
  • remote_port (int) – The optional remote port number to send messages to. If not specified, sending will not be possible using this connection
chip_x
chip_y
get_scp_data(scp_request)[source]
receive_scp_response(timeout=1.0)[source]
send_scp_request(scp_request)[source]
update_chip_coordinates(x, y)[source]
class spinnman.connections.udp_packet_connections.SDPConnection(chip_x=None, chip_y=None, local_host=None, local_port=None, remote_host=None, remote_port=None)[source]

Bases: spinnman.connections.udp_packet_connections.udp_connection.UDPConnection, spinnman.connections.abstract_classes.sdp_receiver.SDPReceiver, spinnman.connections.abstract_classes.sdp_sender.SDPSender, spinnman.connections.abstract_classes.listenable.Listenable

Parameters:
  • chip_x (int) – The optional x-coordinate of the chip at the remote end of the connection. If not specified, it will not be possible to send SDP messages that require a response with this connection.
  • chip_y (int) – The optional y-coordinate of the chip at the remote end of the connection. If not specified, it will not be possible to send SDP messages that require a response with this connection.
  • local_host (str) – The optional ip address or host name of the local interface to listen on
  • local_port (int) – The optional local port to listen on
  • remote_host (str) – The optional remote host name or ip address to send messages to. If not specified, sending will not be possible using this connection
  • remote_port – The optional remote port number to send messages to. If not specified, sending will not be possible using this connection
get_receive_method()[source]
receive_sdp_message(timeout=None)[source]
send_sdp_message(sdp_message)[source]
spinnman.connections.udp_packet_connections.update_sdp_header_for_udp_send(sdp_header, source_x, source_y)[source]

Apply defaults to the sdp header for sending over UDP

Parameters:sdp_header (spinnman.messages.sdp.sdp_header.SDPHeader) – The SDP header values
Returns:Nothing is returned