spynnaker.pyNN.models.neuron package

Subpackages

Submodules

spynnaker.pyNN.models.neuron.key_space_tracker module

class spynnaker.pyNN.models.neuron.key_space_tracker.KeySpaceTracker[source]

Bases: pacman.utilities.algorithm_utilities.element_allocator_algorithm.ElementAllocatorAlgorithm

Tracks keys used to determine key overlap

allocate_keys(r_info)[source]
Allocate all the keys in the routing information
NOTE assumes masks are all 1s followed by all 0s
Parameters:r_info (PartitionRoutingInfo) – The routing information to add
static count_trailing_0s(mask)[source]
Count bitwise zeros at the LSB end of a number
NOTE assumes a 32-bit number
Parameters:mask – The mask to be checked
is_allocated(key, n_keys)[source]
Determine if any of the keys in the mask are allocated
NOTE assumes mask is all 1s followed by all 0s
Parameters:
  • key (int) – The key at the start of the allocation
  • n_keys (int) – The number of keys to check
Return type:

bool

spynnaker.pyNN.models.neuron.master_pop_table module

class spynnaker.pyNN.models.neuron.master_pop_table.MasterPopTableAsBinarySearch[source]

Bases: object

Master population table, implemented as binary search master.

add_application_entry(block_start_addr, row_length, key_and_mask, core_mask, core_shift, n_neurons)[source]

Add an entry for an application-edge to the population table.

Parameters:
  • block_start_addr (int) – where the synaptic matrix block starts
  • row_length (int) – how long in words each row is
  • key_and_mask (BaseKeyAndMask) – the key and mask for this master pop entry
  • core_mask (int) – Mask for the part of the key that identifies the core
  • core_shift (int) – The shift of the mask to get to the core_mask
  • n_neurons (int) – The number of neurons in each machine vertex (bar the last)
  • is_single (bool) – Flag that states if the entry is a direct entry for a single row.
Returns:

The index of the entry, to be used to retrieve it

Return type:

int

Raises:

SynapticConfigurationException – If a bad address is used.

add_invalid_application_entry(key_and_mask, core_mask=0, core_shift=0, n_neurons=0)[source]
Add an entry to the table from an application vertex that doesn’t
point to anywhere. Used to keep indices in synchronisation between e.g. normal and delay entries and between entries on different cores.
Parameters:
  • key_and_mask (BaseKeyAndMask) – a key_and_mask object used as part of describing an edge that will require being received to be stored in the master pop table; the whole edge will become multiple calls to this function
  • core_mask (int) – Mask for the part of the key that identifies the core
  • core_shift (int) – The shift of the mask to get to the core_mask
  • n_neurons (int) – The number of neurons in each machine vertex (bar the last)
Returns:

The index of the added entry

Return type:

int

add_invalid_machine_entry(key_and_mask)[source]
Add an entry to the table from a machine vertex that doesn’t point
to anywhere. Used to keep indices in synchronisation between e.g. normal and delay entries and between entries on different cores.
Parameters:key_and_mask (BaseKeyAndMask) – a key_and_mask object used as part of describing an edge that will require being received to be stored in the master pop table; the whole edge will become multiple calls to this function
Returns:The index of the added entry
Return type:int
add_machine_entry(block_start_addr, row_length, key_and_mask, is_single=False)[source]

Add an entry for a machine-edge to the population table.

Parameters:
  • block_start_addr (int) – where the synaptic matrix block starts
  • row_length (int) – how long in words each row is
  • key_and_mask (BaseKeyAndMask) – the key and mask for this master pop entry
  • is_single (bool) – Flag that states if the entry is a direct entry for a single row.
Returns:

The index of the entry, to be used to retrieve it

Return type:

int

Raises:

SynapticConfigurationException – If a bad address is used.

finish_master_pop_table(spec, region, ref)[source]

Complete the master pop table in the data specification.

Parameters:
  • spec (DataSpecificationGenerator) – the data specification to write the master pop entry to
  • region (int) – the region to which the master pop table is being stored
  • ref – the reference to use for the region, or None if not referenceable
static get_allowed_row_length(row_length)[source]

Get the next allowed row length

Parameters:row_length (int) – the row length being considered
Returns:the row length available
Return type:int
Raises:SynapseRowTooBigException – If the row won’t fit
static get_master_population_table_size(incoming_projections)[source]

Get the size of the master population table in SDRAM.

Parameters:incoming_projections (list(Projection)) – The projections arriving at the vertex that are to be handled by this table
Returns:the size the master pop table will take in SDRAM (in bytes)
Return type:int
static get_next_allowed_address(next_address)[source]

Get the next allowed address.

Parameters:next_address (int) – The next address that would be used
Returns:The next address that can be used following next_address
Return type:int
Raises:SynapticConfigurationException – if the address is out of range
initialise_table()[source]

Initialise the master pop data structure.

max_core_mask

The maximum core mask supported when n_neurons is > 0; this is the maximum number of cores that can be supported in a joined mask.

Return type:int
max_index

The maximum index of a synaptic connection

Return type:int
max_n_neurons_per_core

The maximum number of neurons per core supported when a core-mask is > 0.

Return type:int
write_padding(spec, next_block_start_address)[source]

Write padding to the data spec needed between blocks to align addresses correctly.

Parameters:
Returns:

The address we finish at after the padding

Return type:

int

spynnaker.pyNN.models.neuron.synapse_io module

class spynnaker.pyNN.models.neuron.synapse_io.MaxRowInfo(undelayed_max_n_synapses, delayed_max_n_synapses, undelayed_max_bytes, delayed_max_bytes, undelayed_max_words, delayed_max_words)[source]

Bases: object

Information about the maximums for rows in a synaptic matrix.

Parameters:
  • undelayed_max_n_synapses (int) – Maximum number of synapses in a row of the undelayed matrix
  • delayed_max_n_synapses (int) – Maximum number of synapses in a row of the delayed matrix
  • undelayed_max_bytes (int) – Maximum number of bytes, including headers, in a row of the undelayed matrix, or 0 if no synapses
  • delayed_max_bytes (int) – Maximum number of bytes, including headers, in a row of the delayed matrix, or 0 if no synapses
  • undelayed_max_words (int) – Maximum number of words, excluding headers, in a row of the undelayed matrix
  • delayed_max_words (int) – Maximum number of words, excluding headers, in a row of the delayed matrix
delayed_max_bytes
Maximum number of bytes, including headers, in a row of the
delayed matrix
Return type:int
delayed_max_n_synapses

Maximum number of synapses in a row of the delayed matrix

Return type:int
delayed_max_words
Maximum number of words, excluding headers, in a row of the
undelayed matrix
Return type:int
undelayed_max_bytes
Maximum number of bytes, including headers, in a row of the
undelayed matrix
Return type:int
undelayed_max_n_synapses

Maximum number of synapses in a row of the undelayed matrix

Return type:int
undelayed_max_words
Maximum number of words, excluding headers, in a row of the
undelayed matrix
Return type:int
spynnaker.pyNN.models.neuron.synapse_io.convert_to_connections(synapse_info, pre_vertex_slice, post_vertex_slice, max_row_length, n_synapse_types, weight_scales, data, delayed, post_vertex_max_delay_ticks)[source]

Read the synapses for a given projection synapse information object out of the given data and convert to connection data

Parameters:
  • synapse_info (SynapseInformation) – The synapse information of the synapses
  • pre_vertex_slice (Slice) – The slice of the source neurons of the synapses in the data
  • post_vertex_slice (Slice) – The slice of the target neurons of the synapses in the data
  • max_row_length (int) – The length of each row in the data
  • n_synapse_types (int) – The number of synapse types in total
  • weight_scales (list(float)) – The weight scaling of each synapse type
  • data (bytearray) – The raw data containing the synapses
  • delayed (bool) – True if the data should be considered delayed
  • post_vertex_max_delay_ticks (int) – max delayed ticks supported from post vertex
Returns:

The connections read from the data; the dtype is AbstractSynapseDynamics.NUMPY_CONNECTORS_DTYPE

Return type:

ndarray

spynnaker.pyNN.models.neuron.synapse_io.get_max_row_info(synapse_info, post_vertex_slice, n_delay_stages, in_edge)[source]

Get the information about the maximum lengths of delayed and undelayed rows in bytes (including header), words (without header) and number of synapses

Parameters:
  • synapse_info (SynapseInformation) – The synapse information to get the row data for
  • post_vertex_slice (Slice) – The slice of the machine vertex being represented
  • n_delay_stages (int) – The number of delay stages on the edge
  • in_edge (ProjectionApplicationEdge) – The incoming edge on which the synapse information is held
Return type:

MaxRowInfo

Raises:

SynapseRowTooBigException – If the synapse information can’t be represented

spynnaker.pyNN.models.neuron.synapse_io.get_maximum_delay_supported_in_ms(post_vertex_max_delay_ticks)[source]

Get the maximum delay supported by the synapse representation before extensions are required, or None if any delay is supported

Parameters:post_vertex_max_delay_ticks (int) – post vertex max delay
Return type:int
spynnaker.pyNN.models.neuron.synapse_io.get_synapses(connections, synapse_info, n_delay_stages, n_synapse_types, weight_scales, app_edge, pre_vertex_slice, post_vertex_slice, max_row_info, gen_undelayed, gen_delayed)[source]

Get the synapses as an array of words for non-delayed synapses and an array of words for delayed synapses. This is used to prepare information for deployment to SpiNNaker.

Parameters:
  • connections (ndarray) – The connections to get the synapses from
  • synapse_info (SynapseInformation) – The synapse information to convert to synapses
  • n_delay_stages (int) – The number of delay stages in total to be represented
  • n_synapse_types (int) – The number of synapse types in total to be represented
  • weight_scales (list(float)) – The scaling of the weights for each synapse type
  • app_edge (ApplicationEdge) – The incoming machine edge that the synapses are on
  • pre_vertex_slice (Slice) – The slice of the pre-vertex to get the synapses for
  • post_vertex_slice (Slice) – The slice of the post-vertex to get the synapses for
  • max_row_info (MaxRowInfo) – The maximum row information for the synapses
  • gen_undelayed (bool) – Whether to generate undelayed data
  • gen_delayed (bool) – Whether to generate delayed data
Returns:

(row_data, delayed_row_data, delayed_source_ids, stages) where:

  • row_data is the undelayed connectivity data arranged into a
    row per source, each row the same length
  • delayed_row_data is the delayed connectivity data arranged
    into a row per source per delay stage, each row the same length
  • delayed_source_ids is the machine-vertex-local source neuron
    id of each connection of the delayed vertices
  • stages is the delay stage of each delayed connection

Return type:

tuple(ndarray, ndarray, ndarray, ndarray)

spynnaker.pyNN.models.neuron.synapse_io.read_all_synapses(data, delayed_data, synapse_info, n_synapse_types, weight_scales, pre_vertex_slice, post_vertex_slice, post_vertex_max_delay_ticks, max_row_info)[source]

Read the synapses for a given projection synapse information object out of the given delayed and undelayed data.

Parameters:
  • data (bytearray) – The raw data containing the undelayed synapses
  • delayed_data (bytearray) – The raw data containing the delayed synapses
  • synapse_info (SynapseInformation) – The synapse info that generated the synapses
  • n_synapse_types (int) – The total number of synapse types available
  • weight_scales (list(float)) – A weight scale for each synapse type
  • pre_vertex_slice (Slice) – The slice of the pre-vertex to read the synapses for
  • post_vertex_slice (Slice) – The slice of the post-vertex to read the synapses for
  • post_vertex_max_delay_ticks (int) – max delayed ticks supported from post vertex
  • max_row_info (MaxRowInfo) – The maximum information for each of the rows
Returns:

The connections read from the data; the dtype is AbstractSynapseDynamics.NUMPY_CONNECTORS_DTYPE

Return type:

ndarray

spynnaker.pyNN.models.neuron.synaptic_matrices module

class spynnaker.pyNN.models.neuron.synaptic_matrices.SynapticMatrices(post_vertex_slice, n_synapse_types, all_single_syn_sz, synaptic_matrix_region, direct_matrix_region, poptable_region, connection_builder_region, synaptic_matrix_ref=None, direct_matrix_ref=None, poptable_ref=None, connection_builder_ref=None)[source]

Bases: object

Handler of synaptic matrices for a core of a population vertex

Parameters:
  • post_vertex_slice (Slice) – The slice of the post vertex that these matrices are for
  • n_synapse_types (int) – The number of synapse types available
  • all_single_syn_sz (int) – The space available for “direct” or “single” synapses
  • synaptic_matrix_region (int) – The region where synaptic matrices are stored
  • direct_matrix_region (int) – The region where “direct” or “single” synapses are stored
  • poptable_region (int) – The region where the population table is stored
  • connection_builder_region (int) – The region where the synapse generator information is stored
  • synaptic_matrix_ref (int or None) – The reference to the synaptic matrix region, or None if not referenceable
  • direct_matrix_ref (int or None) – The reference to the direct matrix region, or None if not referenceable
  • poptable_ref (int or None) – The reference to the pop table region, or None if not referenceable
  • connection_builder_ref (int or None) – The reference to the connection builder region, or None if not referenceable
clear_connection_cache()[source]

Clear any values read from the machine

gen_on_machine

Whether any matrices need to be generated on the machine

Return type:bool
get_connections_from_machine(transceiver, placement, app_edge, synapse_info)[source]

Get the synaptic connections from the machine

Parameters:
Returns:

A list of arrays of connections, each with dtype AbstractSynapseDynamics.NUMPY_CONNECTORS_DTYPE

Return type:

ndarray

get_index(app_edge, synapse_info, machine_edge)[source]

Get the index of an incoming projection in the population table

Parameters:
host_generated_block_addr
The address within the synaptic region after the last block
written by the on-host synaptic generation i.e. the start of the space that can be overwritten provided the synapse expander is run again
Return type:int
on_chip_generated_matrix_size
The size of the space used by the generated matrix i.e. the
space that can be overwritten provided the synapse expander is run again
Return type:int
read_generated_connection_holders(transceiver, placement)[source]
Fill in any pre-run connection holders for data which is generated
on the machine, after it has been generated
Parameters:
  • transceiver (Transceiver) – How to read the data from the machine
  • placement (Placement) – where the data is to be read from
write_synaptic_data(spec, incoming_projections, all_syn_block_sz, weight_scales, routing_info)[source]

Write the synaptic data for all incoming projections

Parameters:
  • spec (DataSpecificationGenerator) – The spec to write to
  • incoming_projection (list(Projection)) – The projections to generate data for
  • all_syn_block_sz (int) – The size in bytes of the space reserved for synapses
  • weight_scales (list(float)) – The weight scale of each synapse
  • routing_info (RoutingInfo) – The routing information for all edges
  • machine_graph (MachineGraph) – The machine graph

spynnaker.pyNN.models.neuron.synaptic_matrix module

class spynnaker.pyNN.models.neuron.synaptic_matrix.SynapticMatrix(poptable, synapse_info, machine_edge, app_edge, n_synapse_types, max_row_info, routing_info, delay_routing_info, weight_scales, all_syn_block_sz, all_single_syn_sz, is_direct_capable)[source]

Bases: object

Synaptic matrix/matrices for an incoming machine edge

Parameters:
  • poptable (MasterPopTableAsBinarySearch) – The master population table
  • synapse_info (SynapseInformation) – The projection synapse information
  • machine_edge (MachineEdge) – The projection machine edge
  • app_edge (ProjectionApplicationEdge) – The projection application edge
  • n_synapse_types (int) – The number of synapse types accepted
  • max_row_info (MaxRowInfo) – Maximum row length information
  • routing_info (PartitionRoutingInfo) – Routing information for the edge
  • delay_routing_info (PartitionRoutingInfo) – Routing information for the delay edge if any
  • weight_scales (list(float)) – Weight scale for each synapse type
  • all_syn_block_sz – The space available for all synaptic matrices
  • all_single_syn_sz (int) – The space available for “direct” or “single” synapses
  • is_direct_capable (bool) – True if this matrix can be direct if there is space
clear_connection_cache()[source]

Clear the saved connections

delay_index

The index of the delayed matrix within the master population table

Return type:int
get_generator_data(syn_mat_offset, d_mat_offset)[source]

Get the generator data for this matrix

Parameters:
  • syn_mat_offset (int) – The synaptic matrix offset to write the data to
  • d_mat_offset (int) – The synaptic matrix offset to write the delayed data to
Return type:

GeneratorData

get_row_data()[source]

Generate the row data for a synaptic matrix from the description

Returns:The data and the delayed data
Return type:tuple(ndarray or None, ndarray or None)
index

The index of the matrix within the master population table

Return type:int
next_delay_on_chip_address(block_addr)[source]
Allocate an address for a delayed machine matrix and add it to the
population table
Parameters:block_addr (int) – The address at which to start the allocation
Returns:The address after the allocation and the allocated address
Return type:int, int
next_on_chip_address(block_addr)[source]
Allocate an address for a machine matrix and add it to the
population table
Parameters:block_addr (int) – The address at which to start the allocation
Returns:The address after the allocation and the allocated address
Return type:int, int
read_connections(transceiver, placement, synapses_address, single_address)[source]

Read the connections from the machine

Parameters:
  • transceiver (Transceiver) – How to read the data from the machine
  • placement (Placement) – Where the matrix is on the machine
  • synapses_address (int) – The base address of the synaptic matrix region
  • single_address (int) – The base address of the “direct” or “single” matrix region
Returns:

A list of arrays of connections, each with dtype AbstractSynapseDynamics.NUMPY_CONNECTORS_DTYPE

Return type:

ndarray

write_delayed_machine_matrix(spec, block_addr, row_data)[source]

Write a delayed matrix for an incoming machine vertex

Parameters:
  • spec (DataSpecificationGenerator) – The specification to write to
  • block_addr (int) – The address in the synaptic matrix region to start writing at
  • row_data (ndarray) – The data to write
Returns:

The updated block address

Return type:

int

write_machine_matrix(spec, block_addr, single_synapses, single_addr, row_data)[source]

Write a matrix for the incoming machine vertex

Parameters:
  • spec (DataSpecificationGenerator) – The specification to write to
  • block_addr (int) – The address in the synaptic matrix region to start writing at
  • single_addr (int) – The address in the “direct” or “single” matrix to start at
  • single_synapses (list) – A list of “direct” or “single” synapses to write to
  • row_data (ndarray) – The data to write
Returns:

The updated block and single addresses

Return type:

tuple(int, int)

spynnaker.pyNN.models.neuron.synaptic_matrix_app module

class spynnaker.pyNN.models.neuron.synaptic_matrix_app.SynapticMatrixApp(poptable, synapse_info, app_edge, n_synapse_types, all_single_syn_sz, post_vertex_slice, synaptic_matrix_region, direct_matrix_region)[source]

Bases: object

The synaptic matrix (and delay matrix if applicable) for an incoming app edge

Parameters:
  • poptable (MasterPopTableAsBinarySearch) – The master population table
  • synapse_info (SynapseInformation) – The projection synapse information
  • app_edge (ProjectionApplicationEdge) – The projection application edge
  • n_synapse_types (int) – The number of synapse types accepted
  • all_single_syn_sz (int) – The space available for “direct” or “single” synapses
  • post_vertex_slice (Slice) – The slice of the post-vertex the matrix is for
  • synaptic_matrix_region (int) – The region where synaptic matrices are stored
  • direct_matrix_region (int) – The region where “direct” or “single” synapses are stored
can_generate_on_machine(single_addr)[source]

Determine if an app edge can be generated on the machine

Parameters:single_addr (int) – The address for “direct” or “single” synapses so far
Return type:bool
clear_connection_cache()[source]

Clear saved connections

get_connections(transceiver, placement)[source]

Get the connections for this matrix from the machine

Parameters:
  • transceiver (Transceiver) – How to read the data from the machine
  • placement (Placement) – Where the matrix is on the machine
Returns:

A list of arrays of connections, each with dtype AbstractSynapseDynamics.NUMPY_CONNECTORS_DTYPE

Return type:

ndarray

get_delay_index(machine_edge)[source]
Get the index in the master population table of the delayed matrix
for a machine edge
Parameters:machine_edge (MachineEdge) – The edge to get the index for
Return type:int
get_index(machine_edge)[source]
Get the index in the master population table of the matrix for a
machine edge
Parameters:machine_edge (MachineEdge) – The edge to get the index for
Return type:int
read_generated_connection_holders(transceiver, placement)[source]

Read any pre-run connection holders after data has been generated

Parameters:
  • transceiver (Transceiver) – How to read the data from the machine
  • placement (Placement) – Where the matrix is on the machine
set_info(all_syn_block_sz, app_key_info, delay_app_key_info, routing_info, weight_scales, m_edges)[source]
Set extra information that isn’t necessarily available when the
class is created.
Parameters:
  • all_syn_block_sz (int) – The space available for all synaptic matrices on the core
  • app_key_info (_AppKeyInfo) – Application-level routing key information for undelayed vertices
  • delay_app_key_info (_AppKeyInfo) – Application-level routing key information for delayed vertices
  • routing_info (RoutingInfo) – Routing key information for all incoming edges
  • weight_scales (list(float)) – Weight scale for each synapse edge
  • m_edges (list(MachineEdge)) – The machine edges incoming to this vertex
write_matrix(spec, block_addr, single_addr, single_synapses)[source]

Write a synaptic matrix from host

Parameters:
  • spec (DataSpecificationGenerator) – The specification to write to
  • block_addr (int) – The address in the synaptic matrix region to start writing at
  • single_addr (int) – The address in the “direct” or “single” matrix to start at
  • single_synapses (list(int)) – A list of “direct” or “single” synapses to write to
Returns:

The updated block_addr and single_addr

Return type:

tuple(int, int)

write_on_chip_matrix_data(generator_data, block_addr)[source]

Prepare to write a matrix using an on-chip generator

Parameters:
  • generator_data (list(GeneratorData)) – List of data to add to
  • block_addr (int) – The address in the synaptic matrix region to start writing at
Returns:

The updated block address

Return type:

int

Module contents

class spynnaker.pyNN.models.neuron.AbstractPopulationVertex(n_neurons, label, constraints, max_atoms_per_core, spikes_per_second, ring_buffer_sigma, incoming_spike_buffer_size, neuron_impl, pynn_model, drop_late_spikes, splitter)[source]

Bases: spinn_front_end_common.abstract_models.impl.tdma_aware_application_vertex.TDMAAwareApplicationVertex, spynnaker.pyNN.models.abstract_models.abstract_contains_units.AbstractContainsUnits, spynnaker.pyNN.models.common.abstract_spike_recordable.AbstractSpikeRecordable, spynnaker.pyNN.models.common.abstract_neuron_recordable.AbstractNeuronRecordable, spynnaker.pyNN.models.common.abstract_event_recordable.AbstractEventRecordable, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints, spynnaker.pyNN.models.abstract_models.abstract_population_initializable.AbstractPopulationInitializable, spynnaker.pyNN.models.abstract_models.abstract_population_settable.AbstractPopulationSettable, spinn_front_end_common.abstract_models.abstract_changable_after_run.AbstractChangableAfterRun, spynnaker.pyNN.models.abstract_models.abstract_accepts_incoming_synapses.AbstractAcceptsIncomingSynapses, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl, spinn_front_end_common.abstract_models.abstract_can_reset.AbstractCanReset

Underlying vertex model for Neural Populations. Not actually abstract.

Parameters:
  • n_neurons (int) – The number of neurons in the population
  • label (str) – The label on the population
  • constraints (list(AbstractConstraint)) – Constraints on where a population’s vertices may be placed.
  • max_atoms_per_core (int) – The maximum number of atoms (neurons) per SpiNNaker core.
  • spikes_per_second (float or None) – Expected spike rate
  • ring_buffer_sigma (float or None) – How many SD above the mean to go for upper bound of ring buffer size; a good starting choice is 5.0. Given length of simulation we can set this for approximate number of saturation events.
  • incoming_spike_buffer_size (int or None) –
  • drop_late_spikes (bool) – control flag for dropping late packets.
  • neuron_impl (AbstractNeuronImpl) – The (Python side of the) implementation of the neurons themselves.
  • pynn_model (AbstractPyNNNeuronModel) – The PyNN neuron model that this vertex is working on behalf of.
  • splitter (None or AbstractSplitterCommon) – splitter object
BYTES_TILL_START_OF_GLOBAL_PARAMETERS = 20
add_incoming_projection(projection)[source]

Add a projection incoming to this vertex

Parameters:projection (PyNNProjectionCommon) – The new projection to add
all_single_syn_size

The maximum amount of DTCM to use for single synapses

Return type:int
clear_connection_cache()[source]

Flush the cache of connection information; needed for a second run

clear_event_recording(buffer_manager, placements)[source]

Clear the recorded data from the object

Parameters:
Return type:

None

clear_recording(variable, buffer_manager, placements)[source]

Clear the recorded data from the object

Parameters:
  • variable (str) – PyNN name of the variable
  • buffer_manager (BufferManager) – the buffer manager object
  • placements (Placements) – the placements object
Return type:

None

clear_spike_recording(buffer_manager, placements)[source]

Clear the recorded data from the object

Parameters:
Return type:

None

conductance_based
Return type:bool
describe()[source]

Get a human-readable description of the cell or synapse type.

The output may be customised by specifying a different template together with an associated template engine (see pyNN.descriptions).

If template is None, then a dictionary containing the template context will be returned.

Return type:dict(str, ..)
drop_late_spikes

Whether spikes should be dropped if not processed in a timestep

Return type:bool
get_common_constant_sdram(n_record, n_provenance, common_regions)[source]

Get the amount of SDRAM used by common parts

Parameters:
  • n_record (int) – The number of recording regions
  • n_provenance (int) – The number of provenance items
  • common_regions (CommonRegions) – Region IDs
Return type:

int

get_common_cpu()[source]

Get the amount of CPU used by common parts

Return type:int
get_common_dtcm()[source]

Get the amount of DTCM used by common parts

Return type:int
get_connections_from_machine(transceiver, placements, app_edge, synapse_info)[source]

Get the connections from the machine post-run.

Parameters:
get_data(variable, n_machine_time_steps, placements, buffer_manager)[source]

Get the recorded data

Parameters:
Returns:

(data, recording_indices, sampling_interval)

Return type:

tuple(ndarray,list(int),float)

get_events(variable, placements, buffer_manager)[source]

Get the recorded events from the object

Parameters:
  • variable (str) – The variable to get the event data for
  • placements (Placements) – the placements object
  • buffer_manager (BufferManager) – the buffer manager object
Returns:

A numpy array of 2-element arrays of (neuron_id, time) ordered by time, one element per event

Return type:

ndarray(tuple(int,int))

get_events_sampling_interval(variable)[source]

Return the current sampling interval for events

Parameters:variable (str) – The variable to get the sampling interval for
Returns:Sampling interval in microseconds
Return type:float
get_initial_value(variable, selector=None)[source]

Gets the value for any variable whose in initialize_parameters.keys

Should return the current value not the default one.

Must support the variable as listed in initialize_parameters.keys, ideally also with _init removed or added.

Parameters:
Returns:

A list or an Object which act like a list

Return type:

iterable

get_max_row_info(synapse_info, vertex_slice, app_edge)[source]

Get maximum row length data

Parameters:
get_n_cores()[source]

Get the number of cores this application vertex is using in the TDMA.

Returns:the number of cores to use in the TDMA
Return type:int
get_neuron_constant_sdram(vertex_slice, neuron_regions)[source]

Get the amount of fixed SDRAM used by neuron parts

Parameters:
  • vertex_slice (Slice) – The slice of neurons to get the size of
  • neuron_regions (NeuronRegions) – Region IDs
Return type:

int

get_neuron_cpu(vertex_slice)[source]

Get the amount of CPU used by neuron parts

Parameters:vertex_slice (Slice) – The slice of neurons to get the size of
Return type:int
get_neuron_dtcm(vertex_slice)[source]

Get the amount of DTCM used by neuron parts

Parameters:vertex_slice (Slice) – The slice of neurons to get the size of
Return type:int
get_neuron_sampling_interval(variable)[source]

Returns the current sampling interval for this variable

Parameters:variable (str) – PyNN name of the variable
Returns:Sampling interval in microseconds
Return type:float
get_neuron_variable_sdram(vertex_slice)[source]

Get the amount of SDRAM per timestep used by neuron parts

Parameters:vertex_slice (Slice) – The slice of neurons to get the size of
Return type:int
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
  • partition – the partition that leaves this vertex
Returns:

A list of constraints

Return type:

list(AbstractConstraint) Gets the constraints for partitions going out of this vertex.

Returns:

list of constraints

get_recordable_variables()[source]

Returns a list of the PyNN names of variables this model is expected to collect

Return type:list(str)
get_ring_buffer_shifts(incoming_projections)[source]
Get the shift of the ring buffers for transfer of values into the
input buffers for this model.
Parameters:incoming_projections (list(Projection)) – The projections to consider in the calculations
Return type:list(int)
get_sdram_usage_for_neuron_params(vertex_slice)[source]

Calculate the SDRAM usage for just the neuron parameters region.

Parameters:vertex_slice (Slice) – the slice of atoms.
Returns:The SDRAM required for the neuron region
get_spikes(placements, buffer_manager)[source]

Get the recorded spikes from the object

Parameters:
Returns:

A numpy array of 2-element arrays of (neuron_id, time) ordered by time, one element per event

Return type:

ndarray(tuple(int,int))

get_spikes_sampling_interval()[source]

Return the current sampling interval for spikes

Returns:Sampling interval in microseconds
Return type:float
get_structural_dynamics_size(vertex_slice, incoming_projections)[source]

Get the size of the structural dynamics region

Parameters:
  • vertex_slice (Slice) – The slice of the vertex to get the usage of
  • incoming_projections (list(Projection)) – The projections to consider in the calculations
get_synapse_cpu(vertex_slice)[source]

Get the amount of CPU used by synapse parts

Parameters:vertex_slice (Slice) – The slice of neurons to get the size of
Return type:int
get_synapse_dtcm(vertex_slice)[source]

Get the amount of DTCM used by synapse parts

Parameters:vertex_slice (Slice) – The slice of neurons to get the size of
Return type:int
get_synapse_dynamics_size(vertex_slice)[source]

Get the size of the synapse dynamics region

Parameters:vertex_slice (Slice) – The slice of the vertex to get the usage of
Return type:int
get_synapse_expander_size(incoming_projections)[source]

Get the size of the synapse expander region in bytes

Parameters:incoming_projections (list(Projection)) – The projections to consider in the calculations
Return type:int
get_synapse_id_by_target(target)[source]

Get the id of synapse using its target name

Parameters:target (str) – The synapse to get the id of
get_synapse_params_size()[source]

Get the size of the synapse parameters in bytes

Return type:int
get_synapse_variable_sdram(vertex_slice)[source]

Get the amount of SDRAM per timestep used by synapse parts

Parameters:vertex_slice (Slice) – The slice of neurons to get the size of
Return type:int
get_synapses_size(vertex_slice, incoming_projections)[source]

Get the maximum SDRAM usage for the synapses on a vertex slice

Parameters:
  • vertex_slice (Slice) – The slice of the vertex to get the usage of
  • incoming_projections (list(Projection)) – The projections to consider in the calculations
get_units(variable)[source]

Get units for a given variable.

Parameters:variable (str) – the variable to find units from
Returns:the units as a string.
Return type:str
get_value(key)[source]

Get a property

Parameters:key (str) – the name of the property
Return type:Any or float or int or list(float) or list(int) Get a property of the overall model.
get_weight_scales(ring_buffer_shifts)[source]

Get the weight scaling to apply to weights in synapses

Parameters:ring_buffer_shifts (list(int)) – The shifts to convert to weight scales
Return type:list(int)
incoming_projections

The projections that target this population vertex

Return type:list(Projection)
incoming_spike_buffer_size

The size of the incoming spike buffer to be used on the cores

Return type:int
initialize(variable, value, selector=None)[source]

Set the initial value of one of the state variables of the neurons in this population.

Parameters:
  • variable (str) – The name of the variable to set
  • value (float or int or Any) – The value of the variable to set
initialize_parameters

The names of parameters that have default initial values.

Return type:iterable(str)
is_recording(variable)[source]

Determines if variable is being recorded.

Parameters:variable (str) – PyNN name of the variable
Returns:True if variable are being recorded, False otherwise
Return type:bool
is_recording_events(variable)[source]

Determine if events are being recorded

Parameters:variable (str) – The variable to check
Returns:True if events are recorded for the variable, False otherwise
Return type:bool
is_recording_spikes()[source]

Determine if spikes are being recorded

Returns:True if spikes are being recorded, False otherwise
Return type:bool
mark_no_changes()[source]

Marks the point after which changes are reported, so that new changes can be detected before the next check.

n_atoms

The number of atoms in the vertex

Return type:int
n_profile_samples

The maximum number of profile samples to report

Return type:int
neuron_impl

The neuron implementation

Return type:AbstractNeuronImpl
neuron_recordables

Get the names of variables that can be recorded by the neuron

Return type:list(str)
neuron_recorder

The recorder for neurons

Return type:NeuronRecorder
parameters

The parameters of the neurons in the population

Return type:SpyNNakerRangeDictionary
requires_data_generation

True if changes that have been made require that data generation be performed. By default this returns False but can be overridden to indicate changes that require data regeneration.

Return type:bool
requires_mapping

True if changes that have been made require that mapping be performed. By default this returns False but can be overridden to indicate changes that require mapping.

Return type:bool
reset_to_first_timestep()[source]

Reset the object to first time step.

ring_buffer_sigma
self_projection

Get any projection from this vertex to itself

Return type:PyNNProjectionCommon or None
set_has_run()[source]

Set the flag has run so initialize only affects state variables

Return type:None
set_recording(variable, new_state=True, sampling_interval=None, indexes=None)[source]

Sets variable to being recorded

Parameters:
  • variable (str) – PyNN name of the variable
  • new_state (bool) –
  • sampling_interval (int or None) –
  • indexes (list or None) – Which indices are to be recorded (or None for all)
set_recording_events(variable, new_state=True, sampling_interval=None, indexes=None)[source]

Set events to being recorded. If new_state is false all other parameters are ignored.

Parameters:
  • variable (str) – The variable to set recording
  • new_state (bool) – Set if the events are recording or not
  • sampling_interval (int or None) – The interval at which events are recorded. Must be a whole multiple of the timestep. None will be taken as the timestep.
  • indexes (list(int) or None) – The indexes of the neurons that will record events. If None the assumption is all neurons are recording
set_recording_spikes(new_state=True, sampling_interval=None, indexes=None)[source]

Set spikes to being recorded. If new_state is false all other parameters are ignored.

Parameters:
  • new_state (bool) – Set if the spikes are recording or not
  • sampling_interval (int or None) – The interval at which spikes are recorded. Must be a whole multiple of the timestep. None will be taken as the timestep.
  • indexes (list(int) or None) – The indexes of the neurons that will record spikes. If None the assumption is all neurons are recording
set_synapse_dynamics(synapse_dynamics)[source]

Set the synapse dynamics of this population

Parameters:synapse_dynamics (AbstractSynapseDynamics) – The synapse dynamics to set
set_value(key, value)[source]

Set a property

Parameters:
  • key (str) – the name of the parameter to change
  • value (Any or float or int or list(float) or list(int) Set a property of the overall model.) – the new value of the parameter to assign
size

The number of neurons in the vertex

Return type:int
spikes_per_second
state_variables

The state variables of the neuron in the population

Return type:SpyNNakerRangeDicationary
synapse_dynamics
The synapse dynamics used by the synapses e.g. plastic or static.
Settable.
Return type:AbstractSynapseDynamics or None
synapse_executable_suffix

The suffix of the executable name due to the type of synapses in use.

Return type:str
synapse_recordables

Get the names of variables that can be recorded by the synapses

Return type:list(str)
synapse_recorder

The recorder for synapses

Return type:SynapseRecorder
weight_scale
Return type:float
class spynnaker.pyNN.models.neuron.AbstractPyNNNeuronModel(model)[source]

Bases: spynnaker.pyNN.models.abstract_pynn_model.AbstractPyNNModel

Parameters:model (AbstractNeuronImpl) – The model implementation
create_vertex(n_neurons, label, constraints, spikes_per_second, ring_buffer_sigma, incoming_spike_buffer_size, 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
Returns:

An application vertex for the population

Return type:

ApplicationVertex

default_population_parameters = {'drop_late_spikes': None, 'incoming_spike_buffer_size': None, 'ring_buffer_sigma': None, 'spikes_per_second': None, 'splitter': None}
classmethod get_max_atoms_per_core()[source]

Get the maximum number of atoms per core for this model

Return type:int
classmethod set_model_max_atoms_per_core(n_atoms=256)[source]

Set the maximum number of atoms per core for this model

Parameters:n_atoms (int or None) – The new maximum, or None for the largest possible
class spynnaker.pyNN.models.neuron.AbstractPyNNNeuronModelStandard(model_name, binary, neuron_model, input_type, synapse_type, threshold_type, additional_input_type=None)[source]

Bases: spynnaker.pyNN.models.neuron.abstract_pynn_neuron_model.AbstractPyNNNeuronModel

A neuron model that follows the sPyNNaker standard composed model pattern for point neurons.

Parameters:
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
Returns:

An application vertex for the population

Return type:

ApplicationVertex

default_population_parameters = {'drop_late_spikes': None, 'incoming_spike_buffer_size': None, 'n_steps_per_timestep': 1, 'ring_buffer_sigma': None, 'spikes_per_second': None, 'splitter': None}
class spynnaker.pyNN.models.neuron.ConnectionHolder(data_items_to_return, as_list, n_pre_atoms, n_post_atoms, connections=None, fixed_values=None, notify=None)[source]

Bases: object

Holds a set of connections to be returned in a PyNN-specific format

Parameters:
  • data_items_to_return (list(int) or tuple(int) or None) – A list of data fields to be returned
  • as_list (bool) – True if the data will be returned as a list, False if it is to be returned as a matrix (or series of matrices)
  • n_pre_atoms (int) – The number of atoms in the pre-vertex
  • n_post_atoms (int) – The number of atoms in the post-vertex
  • connections (list(ndarray) or None) – Any initial connections, as a numpy structured array of source, target, weight and delay
  • fixed_values (list(tuple(str,int)) or None) – A list of tuples of field names and fixed values to be appended to the other fields per connection, formatted as [(field_name, value), …]. Note that if the field is to be returned, the name must also appear in data_items_to_return, which determines the order of items in the result
  • notify (callable(ConnectionHolder, None) or None) – A callback to call when the connections have all been added. This should accept a single parameter, which will contain the data requested
add_connections(connections)[source]

Add connections to the holder to be returned

Parameters:connections (ndarray) – The connection to add, as a numpy structured array of source, target, weight and delay
connections

The connections stored

Return type:list(ndarray)
finish()[source]

Finish adding connections

class spynnaker.pyNN.models.neuron.PopulationMachineVertex(resources_required, label, constraints, app_vertex, vertex_slice, slice_index, ring_buffer_shifts, weight_scales, all_syn_block_sz, structural_sz)[source]

Bases: spynnaker.pyNN.models.neuron.population_machine_common.PopulationMachineCommon, spynnaker.pyNN.models.neuron.population_machine_neurons.PopulationMachineNeurons, spynnaker.pyNN.models.neuron.population_machine_synapses.PopulationMachineSynapses, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_rewrites_data_specification.AbstractRewritesDataSpecification

A machine vertex for PyNN Populations

Parameters:
  • resources_required (ResourceContainer) – The resources used by the vertex
  • label (str) – The label of the vertex
  • constraints (list(AbstractConstraint)) – Constraints for the vertex
  • app_vertex (AbstractPopulationVertex) – The associated application vertex
  • vertex_slice (Slice) – The slice of the population that this implements
  • slice_index (int) – The index of the slice in the ordered list of slices
  • ring_buffer_shifts (list(int)) – The shifts to apply to convert ring buffer values to S1615 values
  • weight_scales (list(int)) – The scaling to apply to weights to store them in the synapses
  • all_syn_block_sz (int) – The maximum size of the synapses in bytes
  • structural_sz (int) – The size of the structural data
BACKGROUND_MAX_QUEUED_NAME = 'Max_backgrounds_queued'
BACKGROUND_OVERLOADS_NAME = 'Times_the_background_queue_overloaded'
COMMON_REGIONS = CommonRegions(system=0, provenance=8, profile=9, recording=15)
DMA_COMPLETE = "DMA's that were completed"
INPUT_BUFFER_FULL_NAME = 'Times_the_input_buffer_lost_packets'
MAX_FILLED_SIZE_OF_INPUT_BUFFER_NAME = 'Max_filled_size_input_buffer'
NEURON_REGIONS = NeuronRegions(neuron_params=1, neuron_recording=7)
N_LATE_SPIKES_NAME = 'Number_of_late_spikes'
N_REWIRES_NAME = 'Number_of_rewires'
class REGIONS[source]

Bases: enum.Enum

Regions for populations.

BIT_FIELD_BUILDER = 13
BIT_FIELD_FILTER = 12
BIT_FIELD_KEY_MAP = 14
CONNECTOR_BUILDER = 10
DIRECT_MATRIX = 11
NEURON_PARAMS = 1
NEURON_RECORDING = 7
POPULATION_TABLE = 3
PROFILING = 9
PROVENANCE_DATA = 8
RECORDING = 15
STRUCTURAL_DYNAMICS = 6
SYNAPSE_DYNAMICS = 5
SYNAPSE_PARAMS = 2
SYNAPTIC_MATRIX = 4
SYSTEM = 0
SPIKES_PROCESSED = 'How many spikes were processed'
SYNAPSE_REGIONS = SynapseRegions(synapse_params=2, direct_matrix=11, pop_table=3, synaptic_matrix=4, synapse_dynamics=5, structural_dynamics=6, bitfield_builder=13, bitfield_key_map=14, bitfield_filter=12, connection_builder=10)
generate_data_specification(spec, placement, routing_info, data_n_time_steps)[source]

Generate a data specification.

Parameters:
  • spec (DataSpecificationGenerator) – The data specification to write to
  • placement (Placement) – The placement the vertex is located at
  • routing_info – (injected)
  • data_n_time_steps – (injected)
Return type:

None

get_recorded_region_ids()[source]

Get the recording region IDs that have been recorded using buffering

Returns:The region numbers that have active recording
Return type:iterable(int)
parse_extra_provenance_items(label, x, y, p, provenance_data)[source]

Convert the remaining provenance words (those not in the standard set) into provenance items.

Called by get_provenance_data_from_machine()

Parameters:
  • label (str) – A descriptive label for the vertex (derived from label and placed position) to be used for provenance error reporting to the user.
  • x (int) – x coordinate of the chip where this core
  • y (int) – y coordinate of the core where this core
  • p (int) – virtual id of the core
  • provenance_data (list(int)) – The list of words of raw provenance data.
regenerate_data_specification(spec, placement)[source]

Regenerate the data specification, only generating regions that have changed and need to be reloaded

Parameters:
reload_required()[source]

Return true if any data region needs to be reloaded

Return type:bool
set_reload_required(new_value)[source]

Indicate that the regions have been reloaded

Parameters:new_value – the new value
Return type:None
class spynnaker.pyNN.models.neuron.PopulationNeuronsMachineVertex(resources_required, label, constraints, app_vertex, vertex_slice, slice_index, ring_buffer_shifts, weight_scales)[source]

Bases: spynnaker.pyNN.models.neuron.population_machine_common.PopulationMachineCommon, spynnaker.pyNN.models.neuron.population_machine_neurons.PopulationMachineNeurons, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_rewrites_data_specification.AbstractRewritesDataSpecification, spynnaker.pyNN.models.abstract_models.receives_synaptic_inputs_over_sdram.ReceivesSynapticInputsOverSDRAM

A machine vertex for the Neurons of PyNN Populations

Parameters:
  • resources_required (ResourceContainer) – The resources used by the vertex
  • label (str) – The label of the vertex
  • constraints (list(AbstractConstraint)) – Constraints for the vertex
  • app_vertex (AbstractPopulationVertex) – The associated application vertex
  • vertex_slice (Slice) – The slice of the population that this implements
  • slice_index (int) – The index of the slice in the ordered list of slices
  • ring_buffer_shifts (list(int)) – The shifts to apply to convert ring buffer values to S1615 values
  • weight_scales (list(int)) – The scaling to apply to weights to store them in the synapses
COMMON_REGIONS = CommonRegions(system=0, provenance=1, profile=2, recording=3)
NEURON_REGIONS = NeuronRegions(neuron_params=4, neuron_recording=5)
class REGIONS[source]

Bases: enum.Enum

Regions for populations.

NEURON_PARAMS = 4
NEURON_RECORDING = 5
PROFILING = 2
PROVENANCE_DATA = 1
RECORDING = 3
SDRAM_EDGE_PARAMS = 6
SYSTEM = 0
generate_data_specification(spec, placement, routing_info, data_n_time_steps)[source]

Generate a data specification.

Parameters:
  • spec (DataSpecificationGenerator) – The data specification to write to
  • placement (Placement) – The placement the vertex is located at
  • machine_graph – (injected)
  • routing_info – (injected)
  • data_n_time_steps – (injected)
  • n_key_map – (injected)
Return type:

None

get_recorded_region_ids()[source]

Get the recording region IDs that have been recorded using buffering

Returns:The region numbers that have active recording
Return type:iterable(int)
n_bytes_for_transfer
The number of bytes to be sent over the channel. This will be
calculated using the above numbers, but also rounded up to a number of words, and with the number of neurons rounded up to a power of 2
Return type:int
n_target_neurons

The number of neurons expecting to receive input

Return type:int
n_target_synapse_types

The number of synapse types expecting to receive input

Return type:int
parse_extra_provenance_items(label, x, y, p, provenance_data)[source]

Convert the remaining provenance words (those not in the standard set) into provenance items.

Called by get_provenance_data_from_machine()

Parameters:
  • label (str) – A descriptive label for the vertex (derived from label and placed position) to be used for provenance error reporting to the user.
  • x (int) – x coordinate of the chip where this core
  • y (int) – y coordinate of the core where this core
  • p (int) – virtual id of the core
  • provenance_data (list(int)) – The list of words of raw provenance data.
regenerate_data_specification(spec, placement)[source]

Regenerate the data specification, only generating regions that have changed and need to be reloaded

Parameters:
reload_required()[source]

Return true if any data region needs to be reloaded

Return type:bool
sdram_requirement(sdram_machine_edge)[source]

Asks a machine vertex for the sdram requirement it needs.

Parameters:sdram_machine_edge – The SDRAM edge in question
Returns:the size in bytes this vertex needs for the SDRAM edge
Return type:int (most likely a multiple of 4)
set_reload_required(new_value)[source]

Indicate that the regions have been reloaded

Parameters:new_value – the new value
Return type:None
set_sdram_partition(sdram_partition)[source]

Set the SDRAM partition. Must only be called once per instance

Parameters:SourceSegmentedSDRAMMachinePartition sdram_partition (machine) – The SDRAM partition to receive synapses from
weight_scales
A list of scale factors to be applied to weights that get passed
over SDRAM, one for each synapse type.
Return type:list(int)
class spynnaker.pyNN.models.neuron.NeuronProvenance[source]

Bases: _ctypes.Structure

Provenance items from neuron processing

N_ITEMS = 4
current_timer_tick

Structure/Union member

earliest_send

Structure/Union member

latest_send

Structure/Union member

n_tdma_misses

Structure/Union member

class spynnaker.pyNN.models.neuron.PopulationSynapsesMachineVertexCommon(resources_required, label, constraints, app_vertex, vertex_slice)[source]

Bases: spynnaker.pyNN.models.neuron.population_machine_common.PopulationMachineCommon, spynnaker.pyNN.models.abstract_models.sends_synaptic_inputs_over_sdram.SendsSynapticInputsOverSDRAM

Common parts of a machine vertex for the synapses of a Population

Parameters:
COMMON_REGIONS = CommonRegions(system=0, provenance=1, profile=2, recording=3)
DMA_COMPLETE = "DMA's that were completed"
INPUT_BUFFER_FULL_NAME = 'Times_the_input_buffer_lost_packets'
MAX_FILLED_SIZE_OF_INPUT_BUFFER_NAME = 'Max_filled_size_input_buffer'
MAX_SPIKES_PROCESSED = 'Max_spikes_processed_in_time_step'
MAX_SPIKES_RECEIVED = 'Max_spikes_received_in_time_step'
MAX_TRANSFER_TIMER_OVERRUNS = 'Max_transfer_overrn'
N_LATE_SPIKES_NAME = 'Number_of_late_spikes'
N_REWIRES_NAME = 'Number_of_rewires'
N_SKIPPED_TIME_STEPS = 'Times_a_time_step_was_skipped'
N_TRANSFER_TIMER_OVERRUNS = 'Times_the_transfer_did_not_complete_in_time'
class REGIONS[source]

Bases: enum.Enum

Regions for populations.

BIT_FIELD_BUILDER = 14
BIT_FIELD_FILTER = 10
BIT_FIELD_KEY_MAP = 15
CONNECTOR_BUILDER = 13
DIRECT_MATRIX = 5
KEY_REGION = 12
POPULATION_TABLE = 7
PROFILING = 2
PROVENANCE_DATA = 1
RECORDING = 3
SDRAM_EDGE_PARAMS = 11
STRUCTURAL_DYNAMICS = 9
SYNAPSE_DYNAMICS = 8
SYNAPSE_PARAMS = 4
SYNAPTIC_MATRIX = 6
SYSTEM = 0
SPIKES_PROCESSED = 'How many spikes were processed'
SYNAPSE_REGIONS = SynapseRegions(synapse_params=4, direct_matrix=5, pop_table=7, synaptic_matrix=6, synapse_dynamics=8, structural_dynamics=9, bitfield_builder=14, bitfield_key_map=15, bitfield_filter=10, connection_builder=13)
get_recorded_region_ids()[source]

Get the recording region IDs that have been recorded using buffering

Returns:The region numbers that have active recording
Return type:iterable(int)
parse_extra_provenance_items(label, x, y, p, provenance_data)[source]

Convert the remaining provenance words (those not in the standard set) into provenance items.

Called by get_provenance_data_from_machine()

Parameters:
  • label (str) – A descriptive label for the vertex (derived from label and placed position) to be used for provenance error reporting to the user.
  • x (int) – x coordinate of the chip where this core
  • y (int) – y coordinate of the core where this core
  • p (int) – virtual id of the core
  • provenance_data (list(int)) – The list of words of raw provenance data.
sdram_requirement(sdram_machine_edge)[source]

Asks a machine vertex for the sdram requirement it needs.

Parameters:sdram_machine_edge – The SDRAM edge in question
Returns:the size in bytes this vertex needs for the SDRAM edge
Return type:int (most likely a multiple of 4)
set_neuron_to_synapse_edge(neuron_to_synapse_edge)[source]

Set the edge that goes from the neuron core back to the synapse core.

Parameters:neuron_to_synapse_edge (MachineEdge) – The edge that we will receive spikes from
set_sdram_partition(sdram_partition)[source]

Set the SDRAM partition. Must only be called once per instance

Parameters:SourceSegmentedSDRAMMachinePartition sdram_partition (machine) – The SDRAM partition to receive synapses from
class spynnaker.pyNN.models.neuron.PopulationSynapsesMachineVertexLead(resources_required, label, constraints, app_vertex, vertex_slice, ring_buffer_shifts, weight_scales, all_syn_block_sz, structural_sz, synapse_references)[source]

Bases: spynnaker.pyNN.models.neuron.population_synapses_machine_vertex_common.PopulationSynapsesMachineVertexCommon, spynnaker.pyNN.models.neuron.population_machine_synapses.PopulationMachineSynapses, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification

A synaptic machine vertex that leads other Synaptic machine vertices, writing shared areas.

Parameters:
generate_data_specification(spec, placement, routing_info, data_n_time_steps)[source]

Generate a data specification.

Parameters:
  • spec (DataSpecificationGenerator) – The data specification to write to
  • placement (Placement) – The placement the vertex is located at
  • routing_info – (injected)
  • data_n_time_steps – (injected)
Return type:

None

get_recorded_region_ids()[source]

Get the recording region IDs that have been recorded using buffering

Returns:The region numbers that have active recording
Return type:iterable(int)
class spynnaker.pyNN.models.neuron.PopulationSynapsesMachineVertexShared(resources_required, label, constraints, app_vertex, vertex_slice, synapse_references)[source]

Bases: spynnaker.pyNN.models.neuron.population_synapses_machine_vertex_common.PopulationSynapsesMachineVertexCommon, spynnaker.pyNN.models.neuron.population_machine_synapses_provenance.PopulationMachineSynapsesProvenance, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification

A machine vertex for PyNN Populations

Parameters:
generate_data_specification(spec, placement, routing_info, data_n_time_steps)[source]

Generate a data specification.

Parameters:
  • spec (DataSpecificationGenerator) – The data specification to write to
  • placement (Placement) – The placement the vertex is located at
  • machine_graph – (injected)
  • routing_info – (injected)
  • data_n_time_steps – (injected)
  • n_key_map – (injected)
Return type:

None

class spynnaker.pyNN.models.neuron.SynapseProvenance[source]

Bases: _ctypes.Structure

Provenance items from synapse processing

N_ITEMS = 7
n_failed_bitfield_reads

Structure/Union member

n_filtered_by_bitfield

Structure/Union member

n_ghost_searches

Structure/Union member

n_invalid_pop_table_hits

Structure/Union member

n_plastic_saturations

Structure/Union member

n_pre_synaptic_events

Structure/Union member

n_saturations

Structure/Union member

class spynnaker.pyNN.models.neuron.SpikeProcessingProvenance[source]

Bases: _ctypes.Structure

N_ITEMS = 6
max_size_input_buffer

Structure/Union member

n_buffer_overflows

Structure/Union member

n_dmas_complete

Structure/Union member

n_late_packets

Structure/Union member

n_rewires

Structure/Union member

n_spikes_processed

Structure/Union member

class spynnaker.pyNN.models.neuron.SpikeProcessingFastProvenance[source]

Bases: _ctypes.Structure

N_ITEMS = 11
max_size_input_buffer

Structure/Union member

max_spikes_processed

Structure/Union member

max_spikes_received

Structure/Union member

max_transfer_timer_overrun

Structure/Union member

n_buffer_overflows

Structure/Union member

n_dmas_complete

Structure/Union member

n_late_packets

Structure/Union member

n_rewires

Structure/Union member

n_skipped_time_steps

Structure/Union member

n_spikes_processed

Structure/Union member

n_transfer_timer_overruns

Structure/Union member