spynnaker.pyNN.external_devices_models.push_bot.ethernet package

Module contents

class spynnaker.pyNN.external_devices_models.push_bot.ethernet.PushBotEthernetDevice(protocol, device, uses_payload, time_between_send)[source]

Bases: spynnaker.pyNN.external_devices_models.abstract_multicast_controllable_device.AbstractMulticastControllableDevice

An arbitrary PushBot device

Parameters:
device_control_key

The key that must be sent to the device to control it

Return type:int
device_control_max_value

The maximum value to send to the device

Return type:float
device_control_min_value

The minimum value to send to the device

Return type:float
device_control_partition_id

A partition ID to give to an outgoing edge partition that will control this device

Return type:str
device_control_send_type

The type of data to be sent.

Return type:SendType
device_control_timesteps_between_sending

The number of timesteps between sending commands to the device. This defines the “sampling interval” for the device.

Return type:int
device_control_uses_payload

True if the control of the device accepts an arbitrary valued payload, the value of which will change the devices behaviour

Return type:bool
protocol

The protocol instance, for use in the subclass

Return type:MunichIoEthernetProtocol
set_command_protocol(command_protocol)[source]

Set the protocol use to send setup and shutdown commands, separately from the protocol used to control the device.

Parameters:command_protocol (MunichIoSpiNNakerLinkProtocol) – The protocol to use for this device
class spynnaker.pyNN.external_devices_models.push_bot.ethernet.PushBotEthernetLaserDevice(laser, protocol, start_active_time=None, start_total_period=None, start_frequency=None, timesteps_between_send=None)[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.ethernet.push_bot_device.PushBotEthernetDevice, spinn_front_end_common.abstract_models.abstract_send_me_multicast_commands_vertex.AbstractSendMeMulticastCommandsVertex, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl

The Laser of a PushBot

Parameters:
  • laser (PushBotLaser) – The PushBotLaser value to control
  • protocol (MunichIoEthernetProtocol) – The protocol instance to get commands from
  • start_active_time – The “active time” value to send at the start
  • start_total_period – The “total period” value to send at the start
  • start_frequency – The “frequency” to send at the start
  • timesteps_between_send – The number of timesteps between sending commands to the device, or None to use the default
pause_stop_commands

The commands needed when pausing or stopping simulation

Return type:iterable(MultiCastCommand)
set_command_protocol(command_protocol)[source]

Set the protocol use to send setup and shutdown commands, separately from the protocol used to control the device.

Parameters:command_protocol (MunichIoSpiNNakerLinkProtocol) – The protocol to use for this device
start_resume_commands

The commands needed when starting or resuming simulation

Return type:iterable(MultiCastCommand)
timed_commands

The commands to be sent at given times in the simulation

Return type:iterable(MultiCastCommand)
class spynnaker.pyNN.external_devices_models.push_bot.ethernet.PushBotEthernetLEDDevice(led, protocol, start_active_time_front=None, start_active_time_back=None, start_total_period=None, start_frequency=None, timesteps_between_send=None)[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.ethernet.push_bot_device.PushBotEthernetDevice, spinn_front_end_common.abstract_models.abstract_send_me_multicast_commands_vertex.AbstractSendMeMulticastCommandsVertex, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl

The LED of a PushBot

Parameters:
  • led (PushBotLED) – The PushBotLED parameter to control
  • protocol (MunichIoEthernetProtocol) – The protocol instance to get commands from
  • start_active_time_front – The “active time” to set for the front LED at the start
  • start_active_time_back – The “active time” to set for the back LED at the start
  • start_total_period – The “total period” to set at the start
  • start_frequency – The “frequency” to set at the start
  • timesteps_between_send – The number of timesteps between sending commands to the device, or None to use the default
pause_stop_commands

The commands needed when pausing or stopping simulation

Return type:iterable(MultiCastCommand)
set_command_protocol(command_protocol)[source]

Set the protocol use to send setup and shutdown commands, separately from the protocol used to control the device.

Parameters:command_protocol (MunichIoSpiNNakerLinkProtocol) – The protocol to use for this device
start_resume_commands

The commands needed when starting or resuming simulation

Return type:iterable(MultiCastCommand)
timed_commands

The commands to be sent at given times in the simulation

Return type:iterable(MultiCastCommand)
class spynnaker.pyNN.external_devices_models.push_bot.ethernet.PushBotEthernetMotorDevice(motor, protocol, timesteps_between_send=None)[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.ethernet.push_bot_device.PushBotEthernetDevice, spinn_front_end_common.abstract_models.abstract_send_me_multicast_commands_vertex.AbstractSendMeMulticastCommandsVertex, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl

The motor of a PushBot

Parameters:
  • motor (PushBotMotor) – a PushBotMotor value to indicate the motor to control
  • protocol (MunichIoEthernetProtocol) – The protocol used to control the device
  • timesteps_between_send – The number of timesteps between sending commands to the device, or None to use the default
pause_stop_commands

The commands needed when pausing or stopping simulation

Return type:iterable(MultiCastCommand)
set_command_protocol(command_protocol)[source]

Set the protocol use to send setup and shutdown commands, separately from the protocol used to control the device.

Parameters:command_protocol (MunichIoSpiNNakerLinkProtocol) – The protocol to use for this device
start_resume_commands

The commands needed when starting or resuming simulation

Return type:iterable(MultiCastCommand)
timed_commands

The commands to be sent at given times in the simulation

Return type:iterable(MultiCastCommand)
class spynnaker.pyNN.external_devices_models.push_bot.ethernet.PushBotEthernetRetinaDevice(protocol, resolution, pushbot_ip_address, pushbot_port=56000, injector_port=None, local_host=None, local_port=None, retina_injector_label='PushBotRetinaInjector')[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.abstract_push_bot_retina_device.AbstractPushBotRetinaDevice, spynnaker.pyNN.external_devices_models.abstract_ethernet_sensor.AbstractEthernetSensor

Parameters:
get_database_connection()[source]

Get a Database Connection instance that this device uses to inject packets

Return type:SpynnakerLiveSpikesConnection
Return type:PushBotRetinaConnection
get_injector_label()[source]

Get the label to give to the Spike Injector

Return type:str
get_injector_parameters()[source]

Get the parameters of the Spike Injector to use with this device

Return type:dict(str,Any)
get_n_neurons()[source]

Get the number of neurons that will be sent out by the device

Return type:int
get_translator()[source]

Get a translator of multicast commands to Ethernet commands

Return type:AbstractEthernetTranslator
class spynnaker.pyNN.external_devices_models.push_bot.ethernet.PushBotEthernetSpeakerDevice(speaker, protocol, start_active_time=0, start_total_period=0, start_frequency=0, start_melody=None, timesteps_between_send=None)[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.ethernet.push_bot_device.PushBotEthernetDevice, spinn_front_end_common.abstract_models.abstract_send_me_multicast_commands_vertex.AbstractSendMeMulticastCommandsVertex, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl

The Speaker of a PushBot

Parameters:
  • speaker (PushBotSpeaker) – The PushBotSpeaker value to control
  • protocol (MunichIoEthernetProtocol) – The protocol instance to get commands from
  • start_active_time – The “active time” to set at the start
  • start_total_period – The “total period” to set at the start
  • start_frequency – The “frequency” to set at the start
  • start_melody – The “melody” to set at the start
  • timesteps_between_send – The number of timesteps between sending commands to the device, or None to use the default
pause_stop_commands

The commands needed when pausing or stopping simulation

Return type:iterable(MultiCastCommand)
set_command_protocol(command_protocol)[source]

Set the protocol use to send setup and shutdown commands, separately from the protocol used to control the device.

Parameters:command_protocol (MunichIoSpiNNakerLinkProtocol) – The protocol to use for this device
start_resume_commands

The commands needed when starting or resuming simulation

Return type:iterable(MultiCastCommand)
timed_commands

The commands to be sent at given times in the simulation

Return type:iterable(MultiCastCommand)
class spynnaker.pyNN.external_devices_models.push_bot.ethernet.PushBotRetinaConnection(retina_injector_label, pushbot_wifi_connection, resolution=<PushBotRetinaResolution.NATIVE_128_X_128: <RetinaKey.NATIVE_128_X_128: 67108864>>, local_host=None, local_port=None)[source]

Bases: spynnaker.pyNN.connections.spynnaker_live_spikes_connection.SpynnakerLiveSpikesConnection

A connection that sends spikes from the PushBot retina to a spike injector in SpiNNaker. Note that this assumes a packet format of 16-bits per retina event.

Parameters:
class spynnaker.pyNN.external_devices_models.push_bot.ethernet.PushBotTranslator(protocol, pushbot_wifi_connection)[source]

Bases: spynnaker.pyNN.external_devices_models.abstract_ethernet_translator.AbstractEthernetTranslator

Translates packets between PushBot Multicast packets and PushBot Wi-Fi Commands

Parameters:
translate_control_packet(multicast_packet)[source]

Translate a multicast packet received over Ethernet and send appropriate messages to the external device.

Parameters:multicast_packet (AbstractEIEIODataElement) – A received multicast packet
Return type:None
spynnaker.pyNN.external_devices_models.push_bot.ethernet.get_pushbot_wifi_connection(remote_host, remote_port=56000)[source]

Get an existing connection to a PushBot, or make a new one.

Parameters:
  • remote_host (str) – The IP address of the PushBot
  • remote_port (int) – The port number of the PushBot (default 56000)
class spynnaker.pyNN.external_devices_models.push_bot.ethernet.PushBotWIFIConnection(remote_host, remote_port=56000)[source]

Bases: spinnman.connections.abstract_classes.connection.Connection, spinnman.connections.abstract_classes.listenable.Listenable

A connection to a PushBot via Wi-Fi.

Parameters:
  • remote_host (str) – The IP address of the PushBot
  • remote_port (int) – The port number of the PushBot (default 56000)
Raises:

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

RECV_SIZE = 1024
close()[source]

See spinnman.connections.Connection.close()

get_receive_method()[source]

Get the method that receives for this connection.

is_connected()[source]

See is_connected()

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
local_ip_address

The local IP address to which the connection is bound, as a dotted string, e.g. 0.0.0.0

Return type:str
local_port

The local port to which the connection is bound.

Return type:int
receive(timeout=None)[source]

Receive data from the connection

Parameters:

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

Returns:

The data received

Return type:

bytes

Raises:
remote_ip_address

The remote IP address to which the connection is connected, as a dotted string, or None if not connected remotely

Return type:str or None
remote_port

The remote port to which the connection is connected, or None if not connected remotely

Return type:int or None
send(data)[source]

Send data down this connection

Parameters:data (bytearray) – The data to be sent
Raises:SpinnmanIOException – If there is an error sending the data