# spynnaker8.external_devices package¶

## Module contents¶

This contains functions and classes for handling external devices such as the PushBot (http://spinnakermanchester.github.io/docs/push_bot/).

Note

When using external devices, it is normally important to configure your SpiNNaker system to run in real-time mode, which usually reduces numerical accuracy to gain performance.

class spynnaker8.external_devices.EIEIOType(value, key_bytes, payload_bytes, doc='')[source]

Bases: enum.Enum

Possible types of EIEIO packets

KEY_16_BIT = 0
KEY_32_BIT = 2
KEY_PAYLOAD_16_BIT = 1
KEY_PAYLOAD_32_BIT = 3
key_bytes

The number of bytes used by each key element

Return type: int
max_value

The maximum value of the key or payload (if there is a payload)

Return type: int
payload_bytes

The number of bytes used by each payload element

Return type: int
class spynnaker8.external_devices.ExternalCochleaDevice(n_neurons, spinnaker_link, label=None, board_address=None)[source]

Bases: pacman.model.graphs.application.application_spinnaker_link_vertex.ApplicationSpiNNakerLinkVertex, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl

Parameters: n_neurons (int) – Number of neurons spinnaker_link (int) – The SpiNNaker link to which the cochlea is connected label (str) – board_address (str) –
class spynnaker8.external_devices.ExternalFPGARetinaDevice(mode, retina_key, spinnaker_link_id, polarity, label=None, board_address=None)[source]

Bases: pacman.model.graphs.application.application_spinnaker_link_vertex.ApplicationSpiNNakerLinkVertex, spinn_front_end_common.abstract_models.abstract_send_me_multicast_commands_vertex.AbstractSendMeMulticastCommandsVertex, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl

Parameters: mode (str) – The retina “mode” retina_key (int) – The value of the top 16-bits of the key spinnaker_link_id (int) – The SpiNNaker link to which the retina is connected polarity (str) – The “polarity” of the retina data label (str) – board_address (str) –
DOWN_POLARITY = 'DOWN'
MERGED_POLARITY = 'MERGED'
MODE_128 = '128'
MODE_16 = '16'
MODE_32 = '32'
MODE_64 = '64'
UP_POLARITY = 'UP'
static get_n_neurons(mode, polarity)[source]
get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge partition that comes out of this vertex.

Parameters: partition (AbstractOutgoingEdgePartition) – An edge that comes out of this vertex A list of constraints list(AbstractConstraint)
pause_stop_commands

The commands needed when pausing or stopping simulation

Return type: iterable(MultiCastCommand)
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 spynnaker8.external_devices.MunichRetinaDevice(retina_key, spinnaker_link_id, position, label='MunichRetinaDevice', polarity=None, board_address=None)[source]

Bases: pacman.model.graphs.application.application_spinnaker_link_vertex.ApplicationSpiNNakerLinkVertex, spinn_front_end_common.abstract_models.abstract_send_me_multicast_commands_vertex.AbstractSendMeMulticastCommandsVertex, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl

An Omnibot silicon retina device.

Parameters: retina_key (int) – spinnaker_link_id (int) – The SpiNNaker link to which the retina is connected position (str) – LEFT or RIGHT label (str) – polarity (str) – UP, DOWN or MERGED board_address (str or None) –
DOWN_POLARITY = 'DOWN'
LEFT_RETINA = 'LEFT'

Select the left retina

MERGED_POLARITY = 'MERGED'
RIGHT_RETINA = 'RIGHT'

Select the right retina

UP_POLARITY = 'UP'
default_parameters = {'board_address': None, 'label': 'MunichRetinaDevice', 'polarity': None}
get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge partition that comes out of this vertex.

Parameters: partition (AbstractOutgoingEdgePartition) – An edge that comes out of this vertex A list of constraints list(AbstractConstraint)
pause_stop_commands

The commands needed when pausing or stopping simulation

Return type: iterable(MultiCastCommand)
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 spynnaker8.external_devices.MunichMotorDevice(spinnaker_link_id, board_address=None, speed=30, sample_time=4096, update_time=512, delay_time=5, delta_threshold=23, continue_if_not_different=True, label=None)[source]

Bases: pacman.model.graphs.application.abstract.abstract_one_app_one_machine_vertex.AbstractOneAppOneMachineVertex, spinn_front_end_common.abstract_models.abstract_vertex_with_dependent_vertices.AbstractVertexWithEdgeToDependentVertices

An Omnibot motor control device. This has a real vertex and an external device vertex.

Parameters: spinnaker_link_id (int) – The SpiNNaker link to which the motor is connected board_address (str or None) – speed (int) – sample_time (int) – update_time (int) – delay_time (int) – delta_threshold (int) – continue_if_not_different (bool) – label (str or None) –
default_initial_values = {}
default_parameters = {'board_address': None, 'continue_if_not_different': True, 'delay_time': 5, 'delta_threshold': 23, 'label': None, 'sample_time': 4096, 'speed': 30, 'update_time': 512}
dependent_vertices()[source]

Return the vertices which this vertex depends upon

Return type: iterable(ApplicationVertex)
edge_partition_identifiers_for_dependent_vertex(vertex)[source]

Return the dependent edge identifiers for a particular dependent vertex.

Parameters: vertex (ApplicationVertex) – iterable(str)
class spynnaker8.external_devices.ArbitraryFPGADevice(n_neurons, fpga_link_id, fpga_id, board_address=None, label=None)[source]

Bases: pacman.model.graphs.application.application_fpga_vertex.ApplicationFPGAVertex, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl

Parameters: n_neurons (int) – Number of neurons fpga_link_id (int) – fpga_id (int) – board_address (str or None) – label (str or None) –
class spynnaker8.external_devices.PushBotRetinaViewer(resolution, port=0, display_max=33.0, frame_time_ms=10, decay_time_constant_ms=100)[source]

A viewer for the pushbot’s retina. This is a thread that can be launched in parallel with the control code.

Based on matplotlib

Parameters: resolution (PushBotRetinaResolution) – port (int) – display_max (float) – Value of brightest pixel to show frame_time_ms (int) – How regularity to display frames (milliseconds) decay_time_constant_ms (int) – Time constant of pixel decay (milliseconds)
local_host
local_port
run()[source]

How the viewer works when the thread is running.

class spynnaker8.external_devices.ExternalDeviceLifControl(**kwargs)[source]

Bases: spynnaker.pyNN.models.neuron.abstract_pynn_neuron_model_standard.AbstractPyNNNeuronModelStandard

Abstract control module for the PushBot, based on the LIF neuron, but without spikes, and using the voltage as the output to the various devices

create_vertex(n_neurons, label, constraints, spikes_per_second, ring_buffer_sigma, incoming_spike_buffer_size, n_steps_per_timestep, drop_late_spikes, splitter)[source]

Create a vertex for a population of the model

Parameters: n_neurons (int) – The number of neurons in the population label (str) – The label to give to the vertex constraints (list(AbstractConstraint) or None) – A list of constraints to give to the vertex, or None An application vertex for the population ApplicationVertex
class spynnaker8.external_devices.MunichIoSpiNNakerLinkProtocol(mode, instance_key=None, uart_id=0)[source]

Bases: object

Provides Multicast commands for the Munich SpiNNaker-Link protocol

Parameters: mode – The mode of operation of the protocol instance_key (int or None) – The optional instance key to use uart_id (int) – The ID of the UART when needed
add_payload_logic_to_current_output(payload, time=None)[source]
add_payload_logic_to_current_output_key
bias_values(bias_id, bias_value, time=None)[source]
bias_values_key
configure_master_key(new_key, time=None)[source]
configure_master_key_key
disable_retina(time=None)[source]
disable_retina_key
enable_disable_motor_key
generic_motor0_raw_output_leak_to_0(pwm_signal, time=None)[source]
generic_motor0_raw_output_leak_to_0_key
generic_motor0_raw_output_permanent(pwm_signal, time=None)[source]
generic_motor0_raw_output_permanent_key
generic_motor1_raw_output_leak_to_0(pwm_signal, time=None)[source]
generic_motor1_raw_output_leak_to_0_key
generic_motor1_raw_output_permanent(pwm_signal, time=None)[source]
generic_motor1_raw_output_permanent_key
generic_motor_disable(time=None)[source]
generic_motor_enable(time=None)[source]
generic_motor_total_period(time_in_ms, time=None)[source]
generic_motor_total_period_key
instance_key

The key of this instance of the protocol

Return type: int
master_slave_key
master_slave_set_master_clock_active(time=None)[source]
master_slave_set_master_clock_not_started(time=None)[source]
master_slave_set_slave(time=None)[source]
master_slave_use_internal_counter(time=None)[source]
mode
Return type: MUNICH_MODES
poll_individual_sensor_continuously(sensor_id, time_in_ms, time=None)[source]
poll_individual_sensor_continuously_key
poll_sensors_once(sensor_id, time=None)[source]
poll_sensors_once_key
protocol_instance = 0
push_bot_laser_config_active_time(active_time, time=None)[source]
push_bot_laser_config_active_time_key
push_bot_laser_config_total_period(total_period, time=None)[source]
push_bot_laser_config_total_period_key
push_bot_laser_set_frequency(frequency, time=None)[source]
push_bot_laser_set_frequency_key
push_bot_led_back_active_time(active_time, time=None)[source]
push_bot_led_back_active_time_key
push_bot_led_front_active_time(active_time, time=None)[source]
push_bot_led_front_active_time_key
push_bot_led_set_frequency(frequency, time=None)[source]
push_bot_led_set_frequency_key
push_bot_led_total_period(total_period, time=None)[source]
push_bot_led_total_period_key
push_bot_motor_0_leaking_towards_zero(velocity, time=None)[source]
push_bot_motor_0_leaking_towards_zero_key
push_bot_motor_0_permanent(velocity, time=None)[source]
push_bot_motor_0_permanent_key
push_bot_motor_1_leaking_towards_zero(velocity, time=None)[source]
push_bot_motor_1_leaking_towards_zero_key
push_bot_motor_1_permanent(velocity, time=None)[source]
push_bot_motor_1_permanent_key
push_bot_speaker_config_active_time(active_time, time=None)[source]
push_bot_speaker_config_active_time_key
push_bot_speaker_config_total_period(total_period, time=None)[source]
push_bot_speaker_config_total_period_key
push_bot_speaker_set_melody(melody, time=None)[source]
push_bot_speaker_set_melody_key
push_bot_speaker_set_tone(frequency, time=None)[source]
push_bot_speaker_set_tone_key
pwm_pin_output_timer_a_channel_0_ratio(timer_period, time=None)[source]
pwm_pin_output_timer_a_channel_0_ratio_key
pwm_pin_output_timer_a_channel_1_ratio(timer_period, time=None)[source]
pwm_pin_output_timer_a_channel_1_ratio_key
pwm_pin_output_timer_a_duration(timer_period, time=None)[source]
pwm_pin_output_timer_a_duration_key
pwm_pin_output_timer_b_channel_0_ratio(timer_period, time=None)[source]
pwm_pin_output_timer_b_channel_0_ratio_key
pwm_pin_output_timer_b_channel_1_ratio(timer_period, time=None)[source]
pwm_pin_output_timer_b_channel_1_ratio_key
pwm_pin_output_timer_b_duration(timer_period, time=None)[source]
pwm_pin_output_timer_b_duration_key
pwm_pin_output_timer_c_channel_0_ratio(timer_period, time=None)[source]
pwm_pin_output_timer_c_channel_0_ratio_key
pwm_pin_output_timer_c_channel_1_ratio(timer_period, time=None)[source]
pwm_pin_output_timer_c_channel_1_ratio_key
pwm_pin_output_timer_c_duration(timer_period, time=None)[source]
pwm_pin_output_timer_c_duration_key
query_state_of_io_lines(time=None)[source]
query_state_of_io_lines_key
remove_payload_logic_to_current_output(payload, time=None)[source]
remove_payload_logic_to_current_output_key
reset_retina(time=None)[source]
reset_retina_key
sensor_transmission_key(sensor_id)[source]
static sent_mode_command()[source]

True if the mode command has ever been requested by any instance

set_mode(time=None)[source]
set_mode_key
set_output_pattern_for_payload(payload, time=None)[source]
set_output_pattern_for_payload_key
set_payload_pins_to_high_impedance(payload, time=None)[source]
set_payload_pins_to_high_impedance_key
set_retina_key(new_key, time=None)[source]
set_retina_key_key
set_retina_transmission(retina_key=<RetinaKey.NATIVE_128_X_128: 67108864>, retina_payload=None, time=None)[source]

Set the retina transmission key

Parameters: retina_key (RetinaKey) – the new key for the retina retina_payload (RetinaPayload or None) – the new payload for the set retina key command packet time (int or float or None) – when to transmit this packet the command to send MultiCastCommand
set_retina_transmission_key
turn_off_sensor_reporting(sensor_id, time=None)[source]
turn_off_sensor_reporting_key
uart_id
Return type: int
class spynnaker8.external_devices.PushBotLaser[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.abstract_push_bot_output_device.AbstractPushBotOutputDevice

The properties of the laser device that may be set.

LASER_ACTIVE_TIME = 1

The active period for the laser (no larger than the total period)

LASER_FREQUENCY = 2

The frequency of the laser

LASER_TOTAL_PERIOD = 0

The total period for the laser

class spynnaker8.external_devices.PushBotLED[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.abstract_push_bot_output_device.AbstractPushBotOutputDevice

The properties of the LED device that may be set.

LED_BACK_ACTIVE_TIME = 2
LED_FREQUENCY = 3
LED_FRONT_ACTIVE_TIME = 1
LED_TOTAL_PERIOD = 0
class spynnaker8.external_devices.PushBotMotor[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.abstract_push_bot_output_device.AbstractPushBotOutputDevice

The properties of the motor devices that may be set. The pushbot has two motors, 0 (left) and 1 (right).

MOTOR_0_LEAKY = 1

For motor 0, set a variable speed depending on time since event receive

MOTOR_0_PERMANENT = 0

For motor 0, set a particular speed

MOTOR_1_LEAKY = 3

For motor 1, set a variable speed depending on time since event receive

MOTOR_1_PERMANENT = 2

For motor 0, set a particular speed

class spynnaker8.external_devices.PushBotSpeaker[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.abstract_push_bot_output_device.AbstractPushBotOutputDevice

The properties of the speaker device that may be set.

SPEAKER_ACTIVE_TIME = 1
SPEAKER_MELODY = 3
SPEAKER_TONE = 2
SPEAKER_TOTAL_PERIOD = 0
class spynnaker8.external_devices.PushBotRetinaResolution[source]

Bases: enum.Enum

Resolutions supported by the pushbot retina device

DOWNSAMPLE_16_X_16 = <RetinaKey.DOWNSAMPLE_16_X_16: 268435456>

Down sampled 64 ($$8 \times 8$$) pixels to 1

DOWNSAMPLE_32_X_32 = <RetinaKey.DOWNSAMPLE_32_X_32: 201326592>

Down sampled 16 ($$4 \times 4$$) pixels to 1

DOWNSAMPLE_64_X_64 = <RetinaKey.DOWNSAMPLE_64_X_64: 134217728>

Down sampled 4 ($$2 \times 2$$) pixels to 1

NATIVE_128_X_128 = <RetinaKey.NATIVE_128_X_128: 67108864>

The native resolution

class spynnaker8.external_devices.PushBotLifEthernet(**kwargs)[source]

Bases: spynnaker.pyNN.external_devices_models.external_device_lif_control.ExternalDeviceLifControl

Leaky integrate and fire neuron with an exponentially decaying current input

Parameters: protocol (MunichIoEthernetProtocol) – How to talk to the bot. devices (iterable(AbstractMulticastControllableDevice)) – The devices on the bot that we are interested in. pushbot_ip_address (str) – Where is the pushbot? pushbot_port (int) – (defaulted) tau_m (float) – LIF neuron parameter (defaulted) cm (float) – LIF neuron parameter (defaulted) v_rest (float) – LIF neuron parameter (defaulted) v_reset (float) – LIF neuron parameter (defaulted) tau_syn_E (float) – LIF neuron parameter (defaulted) tau_syn_I (float) – LIF neuron parameter (defaulted) tau_refrac (float) – LIF neuron parameter (defaulted) i_offset (float) – LIF neuron parameter (defaulted) v (float) – LIF neuron parameter (defaulted) isyn_exc (float) – LIF neuron parameter (defaulted) isyn_inh (float) – LIF neuron parameter (defaulted)
class spynnaker8.external_devices.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 spynnaker8.external_devices.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 spynnaker8.external_devices.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 spynnaker8.external_devices.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 spynnaker8.external_devices.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: protocol (MunichIoEthernetProtocol) – resolution (PushBotRetinaResolution) – pushbot_ip_address – pushbot_port – injector_port – local_host – local_port – retina_injector_label –
get_database_connection()[source]

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

Return type: SpynnakerLiveSpikesConnection 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

Bases: spynnaker.pyNN.external_devices_models.external_device_lif_control.ExternalDeviceLifControl

Control module for a PushBot connected to a SpiNNaker Link

Parameters: protocol (MunichIoSpiNNakerLinkProtocol) – How to talk to the bot. devices (iterable(AbstractMulticastControllableDevice)) – The devices on the bot that we are interested in. tau_m (float) – LIF neuron parameter (defaulted) cm (float) – LIF neuron parameter (defaulted) v_rest (float) – LIF neuron parameter (defaulted) v_reset (float) – LIF neuron parameter (defaulted) tau_syn_E (float) – LIF neuron parameter (defaulted) tau_syn_I (float) – LIF neuron parameter (defaulted) tau_refrac (float) – LIF neuron parameter (defaulted) i_offset (float) – LIF neuron parameter (defaulted) v (float) – LIF neuron parameter (defaulted) isyn_exc (float) – LIF neuron parameter (defaulted) isyn_inh (float) – LIF neuron parameter (defaulted)
class spynnaker8.external_devices.PushBotSpiNNakerLinkLaserDevice(laser, protocol, spinnaker_link_id, n_neurons=1, label=None, board_address=None, start_active_time=0, start_total_period=0, start_frequency=0)[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.ethernet.push_bot_laser_device.PushBotEthernetLaserDevice, pacman.model.graphs.application.application_spinnaker_link_vertex.ApplicationSpiNNakerLinkVertex

The Laser of a PushBot

Parameters: laser (PushBotLaser) – Which laser device to control protocol (MunichIoSpiNNakerLinkProtocol) – The protocol instance to get commands from spinnaker_link_id (int) – The SpiNNakerLink that the PushBot is connected to n_neurons (int) – The number of neurons in the device label (str) – A label for the device board_address (str or None) – The IP address of the board that the device is connected to 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
default_parameters = {'board_address': None, 'label': None, 'n_neurons': 1, 'start_active_time': 0, 'start_frequency': 0, 'start_total_period': 0}
class spynnaker8.external_devices.PushBotSpiNNakerLinkLEDDevice(led, protocol, spinnaker_link_id, n_neurons=1, label=None, board_address=None, start_active_time_front=None, start_active_time_back=None, start_total_period=None, start_frequency=None)[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.ethernet.push_bot_led_device.PushBotEthernetLEDDevice, pacman.model.graphs.application.application_spinnaker_link_vertex.ApplicationSpiNNakerLinkVertex

The LED of a PushBot

Parameters: led (PushBotLED) – The LED device to control protocol (MunichIoSpiNNakerLinkProtocol) – The protocol instance to get commands from spinnaker_link_id (int) – The SpiNNakerLink connected to n_neurons (int) – The number of neurons in the device label (str) – The label of the device board_address (str or None) – The IP address of the board that the device is connected to start_active_time_front (int or None) – The “active time” to set for the front LED at the start start_active_time_back (int or None) – The “active time” to set for the back LED at the start start_total_period (int or None) – The “total period” to set at the start start_frequency (int or None) – The “frequency” to set at the start
default_parameters = {'board_address': None, 'label': None, 'n_neurons': 1, 'start_active_time_back': None, 'start_active_time_front': None, 'start_frequency': None, 'start_total_period': None}
class spynnaker8.external_devices.PushBotSpiNNakerLinkMotorDevice(motor, protocol, spinnaker_link_id, n_neurons=1, label=None, board_address=None)[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.ethernet.push_bot_motor_device.PushBotEthernetMotorDevice, pacman.model.graphs.application.application_spinnaker_link_vertex.ApplicationSpiNNakerLinkVertex

The motor of a PushBot

Parameters: motor (PushBotMotor) – the motor to control protocol (MunichIoSpiNNakerLinkProtocol) – The protocol used to control the device spinnaker_link_id (int) – The SpiNNakerLink connected to n_neurons (int) – The number of neurons in the device label (str) – The label of the device board_address (str or None) – The IP address of the board that the device is connected to
default_parameters = {'board_address': None, 'label': None, 'n_neurons': 1}
class spynnaker8.external_devices.PushBotSpiNNakerLinkSpeakerDevice(speaker, protocol, spinnaker_link_id, n_neurons=1, label=None, board_address=None, start_active_time=50, start_total_period=100, start_frequency=None, start_melody=None)[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.ethernet.push_bot_speaker_device.PushBotEthernetSpeakerDevice, pacman.model.graphs.application.application_spinnaker_link_vertex.ApplicationSpiNNakerLinkVertex

The speaker of a PushBot

Parameters: speaker (PushBotSpeaker) – Which speaker device to control protocol (MunichIoSpiNNakerLinkProtocol) – The protocol instance to get commands from spinnaker_link_id (int) – The SpiNNakerLink connected to n_neurons (int) – The number of neurons in the device label (str) – The label of the device board_address (str or None) – The IP address of the board that the device is connected to 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
default_parameters = {'board_address': None, 'label': None, 'n_neurons': 1, 'start_active_time': 50, 'start_frequency': None, 'start_melody': None, 'start_total_period': 100}
class spynnaker8.external_devices.PushBotSpiNNakerLinkRetinaDevice(*args, **kwargs)[source]

Bases: spynnaker.pyNN.external_devices_models.push_bot.abstract_push_bot_retina_device.AbstractPushBotRetinaDevice, pacman.model.graphs.application.application_spinnaker_link_vertex.ApplicationSpiNNakerLinkVertex

default_parameters = {'board_address': None, 'label': None}
routing_info(routing_info)[source]
start_resume_commands

The commands needed when starting or resuming simulation

Return type: iterable(MultiCastCommand)
class spynnaker8.external_devices.SpynnakerLiveSpikesConnection(receive_labels=None, send_labels=None, local_host=None, local_port=19999, live_packet_gather_label='LiveSpikeReceiver')[source]

Bases: spinn_front_end_common.utilities.connections.live_event_connection.LiveEventConnection

A connection for receiving and sending live spikes from and to SpiNNaker

Parameters: receive_labels (iterable(str)) – Labels of population from which live spikes will be received. send_labels (iterable(str)) – Labels of population to which live spikes will be sent local_host (str) – Optional specification of the local hostname or IP address of the interface to listen on local_port (int) – Optional specification of the local port to listen on. Must match the port that the toolchain will send the notification on (19999 by default)
send_spike(label, neuron_id, send_full_keys=False)[source]

Send a spike from a single neuron

Parameters: label (str) – The label of the population from which the spike will originate neuron_id (int) – The ID of the neuron sending a spike send_full_keys (bool) – Determines whether to send full 32-bit keys, getting the key for each neuron from the database, or whether to send 16-bit neuron IDs directly
send_spikes(label, neuron_ids, send_full_keys=False)[source]

Send a number of spikes

Parameters: label (str) – The label of the population from which the spikes will originate neuron_ids (list(int)) – array-like of neuron IDs sending spikes send_full_keys (bool) – Determines whether to send full 32-bit keys, getting the key for each neuron from the database, or whether to send 16-bit neuron IDs directly
class spynnaker8.external_devices.SpynnakerPoissonControlConnection(poisson_labels=None, local_host=None, local_port=19999, control_label_extension='_control')[source]

Bases: spinn_front_end_common.utilities.connections.live_event_connection.LiveEventConnection

Parameters: poisson_labels (iterable(str)) – Labels of Poisson populations to be controlled local_host (str) – Optional specification of the local hostname or IP address of the interface to listen on local_port (int) – Optional specification of the local port to listen on. Must match the port that the toolchain will send the notification on (19999 by default) control_label_extension (str) – The extra name added to the label of each Poisson source
add_init_callback(label, init_callback)[source]

Add a callback to be called to initialise a vertex

Parameters: label (str) – The label of the vertex to be notified about. Must be one of the vertices listed in the constructor init_callback (callable(str, int, float, float) -> None) – A function to be called to initialise the vertex. This should take as parameters the label of the vertex, the number of neurons in the population, the run time of the simulation in milliseconds, and the simulation timestep in milliseconds
add_pause_stop_callback(label, pause_stop_callback)[source]

Add a callback for the pause and stop state of the simulation

Parameters: label (str) – the label of the function to be sent pause_stop_callback (callable(str, LiveEventConnection) -> None) – A function to be called when the pause or stop message has been received. This function should take the label of the referenced vertex, and an instance of this class, which can be used to send events. None
add_poisson_label(label)[source]
Parameters: label (str) – The label of the Poisson source population.
add_receive_callback(label, live_event_callback, translate_key=False)[source]

Add a callback for the reception of live events from a vertex

Parameters: label (str) – The label of the vertex to be notified about. Must be one of the vertices listed in the constructor live_event_callback (callable(str, int, list(int)) -> None) – A function to be called when events are received. This should take as parameters the label of the vertex, the simulation timestep when the event occurred, and an array-like of atom IDs. translate_key (bool) – True if the key is to be converted to an atom ID, False if the key should stay a key
add_start_callback(label, start_callback)[source]

Add a callback for the start of the simulation

Parameters: start_callback (callable(str, LiveEventConnection) -> None) – A function to be called when the start message has been received. This function should take the label of the referenced vertex, and an instance of this class, which can be used to send events label (str) – the label of the function to be sent
add_start_resume_callback(label, start_resume_callback)[source]

Add a callback for the start and resume state of the simulation

Parameters: label (str) – the label of the function to be sent start_resume_callback (callable(str, LiveEventConnection) -> None) – A function to be called when the start or resume message has been received. This function should take the label of the referenced vertex, and an instance of this class, which can be used to send events. None
set_rate(label, neuron_id, rate)[source]

Set the rate of a Poisson neuron within a Poisson source

Parameters: label (str) – The label of the Population to set the rates of neuron_id (int) – The neuron ID to set the rate of rate (float) – The rate to set in Hz
set_rates(label, neuron_id_rates)[source]

Set the rates of multiple Poisson neurons within a Poisson source

Parameters: label (str) – The label of the Population to set the rates of neuron_id_rates (list(tuple(int,float))) – A list of tuples of (neuron ID, rate) to be set
spynnaker8.external_devices.activate_live_output_for(population, database_notify_host=None, database_notify_port_num=None, database_ack_port_num=None, board_address=None, port=None, host=None, tag=None, strip_sdp=True, use_prefix=False, key_prefix=None, prefix_type=None, message_type=<EIEIOType.KEY_32_BIT: 2>, right_shift=0, payload_as_time_stamps=True, notify=True, use_payload_prefix=True, payload_prefix=None, payload_right_shift=0, number_of_packets_sent_per_time_step=0)

Output the spikes from a given population from SpiNNaker as they occur in the simulation.

spynnaker8.external_devices.activate_live_output_to(population, device, partition_id='SPIKE')

Activate the output of spikes from a population to an external device. Note that all spikes will be sent to the device.

Parameters: population (Population) – The pyNN population object from which spikes will be sent. device (Population or ApplicationVertex) – The pyNN population or external device to which the spikes will be sent. partition_id (str) – The partition ID to activate live output to.
spynnaker8.external_devices.SpikeInjector(notify=True, database_notify_host=None, database_notify_port_num=None, database_ack_port_num=None)[source]

Supports creating a spike injector that can be added to the application graph.

Parameters: notify (bool) – Whether to register for notifications database_notify_host (str or None) – the hostname for the device which is listening to the database notification. database_ack_port_num (int or None) – the port number to which a external device will acknowledge that they have finished reading the database and are ready for it to start execution database_notify_port_num (int or None) – The port number to which a external device will receive the database is ready command The spike injector model object that can be placed in a pyNN Population. AbstractPyNNModel
spynnaker8.external_devices.register_database_notification_request(hostname, notify_port, ack_port)[source]

spynnaker8.external_devices.run_forever(sync_time=0)[source]
spynnaker8.external_devices.add_poisson_live_rate_control(poisson_population, control_label_extension='_control', receive_port=None, database_notify_host=None, database_notify_port_num=None, database_ack_port_num=None, notify=True, reserve_reverse_ip_tag=False)