spynnaker8.external_devices package

Module contents

The spynnaker.pyNN package contains the front end specifications and implementation for the PyNN High-level API (http://neuralensemble.org/trac/PyNN)

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

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 – The retina “mode”
  • retina_key – The value of the top 16-bits of the key
  • spinnaker_link_id – The SpiNNaker link to which the retina is connected
  • polarity – The “polarity” of the retina data
  • label
  • board_address
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 that comes out of this vertex.

Parameters:partition (AbstractOutgoingEdgePartition) – An edge that comes out of this vertex
Returns:A list of constraints
Return type: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=None, 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

DOWN_POLARITY = 'DOWN'
LEFT_RETINA = 'LEFT'
LEFT_RETINA_DISABLE = 69
LEFT_RETINA_ENABLE = 69
LEFT_RETINA_KEY_SET = 67
MANAGEMENT_BIT = 1024
MANAGEMENT_MASK = 4294965248
MERGED_POLARITY = 'MERGED'
RIGHT_RETINA = 'RIGHT'
RIGHT_RETINA_DISABLE = 70
RIGHT_RETINA_ENABLE = 70
RIGHT_RETINA_KEY_SET = 68
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 that comes out of this vertex.

Parameters:partition (AbstractOutgoingEdgePartition) – An edge that comes out of this vertex
Returns:A list of constraints
Return type: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.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_vertex_with_dependent_vertices.AbstractVertexWithEdgeToDependentVertices, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, 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 motor control device - has a real vertex and an external device vertex

PARAMS_REGION = 1
PARAMS_SIZE = 28
SYSTEM_REGION = 0
create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
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) Return the vertices which this vertex depends upon
edge_partition_identifiers_for_dependent_vertex(vertex)[source]

Return the dependent edge identifiers for a particular dependent vertex.

Parameters:vertex (ApplicationVertex) –
Return type:iterable(str) Return the dependent edge identifier
generate_data_specification(spec, placement, routing_info, machine_time_step, time_scale_factor)[source]

Generate a data specification.

Parameters:
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_outgoing_partition_constraints(partition)[source]

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

Parameters:partition (AbstractOutgoingEdgePartition) – An edge that comes out of this vertex
Returns:A list of constraints
Return type:list(AbstractConstraint)
get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Return type:int
reserve_memory_regions(spec)[source]

Reserve SDRAM space for memory areas: 1) Area for information on what data to record 2) area for start commands 3) area for end commands

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

class spynnaker8.external_devices.PushBotRetinaViewer(resolution, port=0, display_max=33.0, frame_time_ms=10, decay_time_constant_ms=100)[source]

Bases: threading.Thread

local_host
local_port
run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

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)[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 or None) – A list of constraints to give to the vertex, or None
Returns:

An application vertex for the population

Return type:

pacman.model.graphs.application.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 – The optional instance key to use
  • uart_id – The ID of the UART when needed
class MODES[source]

Bases: enum.Enum

types of modes supported by this protocol

BALL_BALANCER = 3
FREE = 5
MY_ORO_BOTICS = 4
PUSH_BOT = 1
RESET_TO_DEFAULT = 0
SPOMNIBOT = 2
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

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
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()[source]
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()[source]
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 – the new key for the retina
  • retina_payload (enum or None) – the new payload for the set retina key command packet
  • time – when to transmit this packet
Returns:

the command to send

Return type:

spinn_front_end_common.utility_models.multi_cast_command.MultiCastCommand

set_retina_transmission_key
turn_off_sensor_reporting(sensor_id, time=None)[source]
turn_off_sensor_reporting_key
uart_id
class spynnaker8.external_devices.PushBotLaser[source]

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

An enumeration.

LASER_ACTIVE_TIME = 1
LASER_FREQUENCY = 2
LASER_TOTAL_PERIOD = 0
class spynnaker8.external_devices.PushBotLED[source]

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

An enumeration.

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

An enumeration.

MOTOR_0_LEAKY = 1
MOTOR_0_PERMANENT = 0
MOTOR_1_LEAKY = 3
MOTOR_1_PERMANENT = 2
class spynnaker8.external_devices.PushBotSpeaker[source]

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

An enumeration.

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

Bases: enum.Enum

An enumeration.

DOWNSAMPLE_16_X_16 = <RetinaKey.DOWNSAMPLE_16_X_16: 268435456>
DOWNSAMPLE_32_X_32 = <RetinaKey.DOWNSAMPLE_32_X_32: 201326592>
DOWNSAMPLE_64_X_64 = <RetinaKey.DOWNSAMPLE_64_X_64: 134217728>
NATIVE_128_X_128 = <RetinaKey.NATIVE_128_X_128: 67108864>
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

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.push_bot_ethernet.push_bot_ethernet_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 – The PushBotLaser value to control
  • protocol – 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

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.push_bot_ethernet.push_bot_ethernet_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 – The PushBotLED parameter to control
  • protocol – 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

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.push_bot_ethernet.push_bot_ethernet_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 – a PushBotMotor value to indicate the motor to control
  • protocol – 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

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.push_bot_ethernet.push_bot_ethernet_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 – The PushBotSpeaker value to control
  • protocol – 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

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

get_database_connection()[source]

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

get_injector_label()[source]

Get the label to give to the Spike Injector

get_injector_parameters()[source]

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

get_n_neurons()[source]

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

get_translator()[source]

Get a translator of multicast commands to Ethernet commands

Bases: spynnaker.pyNN.external_devices_models.external_device_lif_control.ExternalDeviceLifControl

Control module for a PushBot connected to a SpiNNaker Link

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.push_bot_ethernet.push_bot_ethernet_laser_device.PushBotEthernetLaserDevice, pacman.model.graphs.application.application_spinnaker_link_vertex.ApplicationSpiNNakerLinkVertex

The Laser of a PushBot

Parameters:
  • laser – The PushBotLaser value to control
  • protocol – The protocol instance to get commands from
  • spinnaker_link_id – The SpiNNakerLink that the PushBot is connected to
  • n_neurons – The number of neurons in the device
  • label – A label for the device
  • board_address – 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.push_bot_ethernet.push_bot_ethernet_led_device.PushBotEthernetLEDDevice, pacman.model.graphs.application.application_spinnaker_link_vertex.ApplicationSpiNNakerLinkVertex

The LED of a PushBot

Parameters:
  • led – The PushBotLED parameter to control
  • protocol – The protocol instance to get commands from
  • spinnaker_link_id – The SpiNNakerLink connected to
  • n_neurons – The number of neurons in the device
  • label – The label of the device
  • board_address – The IP address of the board that the device is connected to
  • 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
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.push_bot_ethernet.push_bot_ethernet_motor_device.PushBotEthernetMotorDevice, pacman.model.graphs.application.application_spinnaker_link_vertex.ApplicationSpiNNakerLinkVertex

The motor of a PushBot

Parameters:
  • motor – a PushBotMotor value to indicate the motor to control
  • protocol – The protocol used to control the device
  • spinnaker_link_id – The SpiNNakerLink connected to
  • n_neurons – The number of neurons in the device
  • label – The label of the device
  • board_address – 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.push_bot_ethernet.push_bot_ethernet_speaker_device.PushBotEthernetSpeakerDevice, pacman.model.graphs.application.application_spinnaker_link_vertex.ApplicationSpiNNakerLinkVertex

The speaker of a PushBot

Parameters:
  • speaker – The PushBotSpeaker value to control
  • protocol – The protocol instance to get commands from
  • spinnaker_link_id – The SpiNNakerLink connected to
  • n_neurons – The number of neurons in the device
  • label – The label of the device
  • board_address – 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}
graph_mapper(graph_mapper)[source]
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 of str) – Labels of population from which live spikes will be received.
  • send_labels (iterable of 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 of 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 (function(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 (function(str, SpynnakerLiveEventConnection) -> 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.
Return type:

None

add_poisson_label(label)[source]
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 (function(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 – 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 (function(str, SpynnakerLiveEventConnection) -> 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 (function(str, SpynnakerLiveEventConnection) -> 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.
Return type:

None

set_rate(label, neuron_id, rate)[source]

Set the rate of a Poisson neuron within a Poisson source

Parameters:
  • label – The label of the Population to set the rates of
  • neuron_id – The neuron ID to set the rate of
  • rate – 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 – The label of the Population to set the rates of
  • neuron_id_rates – 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.

Parameters:
  • population (spynnaker.pyNN.models.pynn_population_common.PyNNPopulationCommon) – The population to activate the live output for
  • database_notify_host (str) – The hostname for the device which is listening to the database notification.
  • database_ack_port_num (int) – 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) – The port number to which a external device will receive the database is ready command
  • board_address (str) – A fixed board address required for the tag, or None if any address is OK
  • key_prefix (int or None) – the prefix to be applied to the key
  • prefix_type – if the prefix type is 32 bit or 16 bit
  • message_type – If the message is a EIEIO command message, or an EIEIO data message with 16 bit or 32 bit keys.
  • payload_as_time_stamps
  • right_shift
  • use_payload_prefix
  • notify
  • payload_prefix
  • payload_right_shift
  • number_of_packets_sent_per_time_step
  • port (int) – The UDP port to which the live spikes will be sent. If not specified, the port will be taken from the “live_spike_port” parameter in the “Recording” section of the sPyNNaker configuration file.
  • host (str) – The host name or IP address to which the live spikes will be sent. If not specified, the host will be taken from the “live_spike_host” parameter in the “Recording” section of the sPyNNaker configuration file.
  • tag (int) – The IP tag to be used for the spikes. If not specified, one will be automatically assigned
  • strip_sdp (bool) – Determines if the SDP headers will be stripped from the transmitted packet.
  • use_prefix (bool) – Determines if the spike packet will contain a common prefix for the spikes
  • label (str) – The label of the gatherer vertex
  • partition_ids (list(str)) – The names of the partitions to create edges for
spynnaker8.external_devices.activate_live_output_to(population, device)

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

Parameters:
spynnaker8.external_devices.SpikeInjector(notify=True, database_notify_host=None, database_notify_port_num=None, database_ack_port_num=None)[source]

Supports adding a spike injector to the application graph.

Parameters:
  • database_notify_host (str) – the hostname for the device which is listening to the database notification.
  • database_ack_port_num (int) – 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) – The port number to which a external device will receive the database is ready command
spynnaker8.external_devices.register_database_notification_request(hostname, notify_port, ack_port)[source]

Adds a socket system which is registered with the notification protocol

Parameters:
  • hostname – hostname to connect to
  • notify_port – port num for the notify command
  • ack_port – port num for the acknowledge command
Return type:

None

spynnaker8.external_devices.run_forever()[source]

Supports running forever in PyNN 0.8/0.9 format

Returns:returns when the application has started running on the SpiNNaker platform.
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)

Add a live rate controller to a Poisson population.

Parameters:
  • poisson_population (spynnaker.pyNN.models.pynn_population_common.PyNNPopulationCommon) – The population to control
  • control_label_extension (str) – An extension to add to the label of the Poisson source. Must match up with the equivalent in the SpynnakerPoissonControlConnection
  • receive_port (int) – The port that the SpiNNaker board should listen on
  • database_notify_host (str) – the hostname for the device which is listening to the database notification.
  • database_ack_port_num (int) – 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) – The port number to which a external device will receive the database is ready command
  • reserve_reverse_ip_tag (bool) – True if a reverse ip tag is to be used, False if SDP is to be used (default)