spynnaker.pyNN.models.neuron.master_pop_table_generators package

Submodules

spynnaker.pyNN.models.neuron.master_pop_table_generators.abstract_master_pop_table_factory module

class spynnaker.pyNN.models.neuron.master_pop_table_generators.abstract_master_pop_table_factory.AbstractMasterPopTableFactory[source]

Bases: object

extract_synaptic_matrix_data_location(incoming_key, master_pop_base_mem_address, txrx, chip_x, chip_y)[source]
Parameters:
  • incoming_key (int) – the source key which the synaptic matrix needs to be mapped to
  • master_pop_base_mem_address (int) – the base address of the master pop
  • txrx (spinnman.transceiver.Transceiver) – the transceiver object
  • chip_y (int) – the y coordinate of the chip of this master pop
  • chip_x (int) – the x coordinate of the chip of this master pop
Returns:

a synaptic matrix memory position.

finish_master_pop_table(spec, master_pop_table_region)[source]

Complete the master pop table in the data specification.

Parameters:
  • spec – the data specification to write the master pop entry to
  • master_pop_table_region – the region to which the master pop table is being stored
get_edge_constraints()[source]

Gets the constraints for this table on edges coming in to a vertex.

Returns:a list of constraints
Return type:list(pacman.model.constraints.AbstractConstraint)
get_master_population_table_size(vertex_slice, in_edges)[source]

Get the size of the master population table in SDRAM

update_master_population_table(spec, block_start_addr, row_length, key_and_mask, master_pop_table_region, is_single=False)[source]

Update a data specification with a master pop entry in some form

Parameters:
  • spec – the data specification to write the master pop entry to
  • block_start_addr – the start address of the row in the region
  • row_length – the row length of this entry
  • key_and_mask (pacman.model.routing_info.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
  • master_pop_table_region – The region to which the master pop table is being stored
  • is_single – True if this is a single synapse, False otherwise

Module contents

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

Bases: spynnaker.pyNN.models.neuron.master_pop_table_generators.abstract_master_pop_table_factory.AbstractMasterPopTableFactory

Master population table, implemented as binary search master.

ADDRESS_LIST_DTYPE = '<u4'
ADDRESS_MASK = 2147483392
ADDRESS_SCALE = 16
ADDRESS_SCALED_SHIFT = 4
MASTER_POP_ENTRY_DTYPE = [('key', '<u4'), ('mask', '<u4'), ('start', '<u2'), ('count', '<u2')]
ROW_LENGTH_MASK = 255
SINGLE_BIT_FLAG_BIT = 2147483648
extract_synaptic_matrix_data_location(incoming_key, master_pop_base_mem_address, txrx, chip_x, chip_y)[source]
Parameters:
  • incoming_key (int) – the source key which the synaptic matrix needs to be mapped to
  • master_pop_base_mem_address (int) – the base address of the master pop
  • txrx (spinnman.transceiver.Transceiver) – the transceiver object
  • chip_y (int) – the y coordinate of the chip of this master pop
  • chip_x (int) – the x coordinate of the chip of this master pop
Returns:

a synaptic matrix memory position.

finish_master_pop_table(spec, master_pop_table_region)[source]

Complete the master pop table in the data specification.

Parameters:
  • spec – the data specification to write the master pop entry to
  • master_pop_table_region – the region to which the master pop table is being stored
get_allowed_row_length(row_length)[source]
Parameters:row_length – the row length being considered
Returns:the row length available
get_edge_constraints()[source]

Gets the constraints for this table on edges coming in to a vertex.

Returns:a list of constraints
Return type:list(pacman.model.constraints.AbstractConstraint)
get_exact_master_population_table_size(vertex, machine_graph, graph_mapper)[source]
Returns:the size the master pop table will take in SDRAM (in bytes)
get_master_population_table_size(vertex_slice, in_edges)[source]

Get the size of the master population table in SDRAM

Parameters:
  • vertex_slice – the slice of the vertex
  • in_edges – the in coming edges
Returns:

the size the master pop table will take in SDRAM (in bytes)

get_next_allowed_address(next_address)[source]
Parameters:next_address – The next address that would be used
Returns:The next address that can be used following next_address
initialise_table()[source]

Initialise the master pop data structure.

Return type:None
update_master_population_table(spec, block_start_addr, row_length, key_and_mask, master_pop_table_region, is_single=False)[source]

Add an entry in the binary search to deal with the synaptic matrix

Parameters:
  • spec – the writer for DSG
  • block_start_addr – where the synaptic matrix block starts
  • row_length – how long in bytes each synaptic entry is
  • key_and_mask – the key and mask for this master pop entry
  • master_pop_table_region – the region ID for the master pop
  • is_single – 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