sPyNNaker neural_modelling 7.3.1
|
Master pop(ulation) table API. More...
#include <common/neuron-typedefs.h>
#include <filter_info.h>
#include <neuron/synapse_row.h>
#include <debug.h>
Go to the source code of this file.
Data Structures | |
struct | master_population_table_entry |
An entry in the master population table. More... | |
struct | address_list_entry |
A packed address and row length (note: same size as extra info) More... | |
struct | pop_table_config_t |
The memory layout in SDRAM of the first part of the population table configuration. Address list data (array of ::address_and_row_length) is packed on the end. More... | |
struct | pop_table_lookup_result_t |
A structure to hold a response to a population table lookup. More... | |
Macros | |
#define | BITS_PER_WORD 32 |
bits in a word | |
#define | TOP_BIT_IN_WORD 31 |
The highest bit within the word. | |
#define | NOT_IN_MASTER_POP_TABLE_FLAG -1 |
The flag for when a spike isn't in the master pop table (so shouldn't happen) | |
#define | N_ADDRESS_BITS 24 |
The number of bits of address. This is a constant as it is used more than once below. | |
#define | INDIRECT_ADDRESS_SHIFT 4 |
The shift to apply to indirect addresses. The address is in units of four words, so this multiplies by 16 (= up shifts by 4) | |
#define | INVALID_ADDRESS ((1 << N_ADDRESS_BITS) - 1) |
An Invalid address and row length. | |
Support functions | |
uint32_t | ghost_pop_table_searches |
the number of times a DMA resulted in 0 entries | |
uint32_t | invalid_master_pop_hits |
the number of times packet isn't in the master pop table at all! | |
uint32_t | failed_bit_field_reads |
The number of bit fields which were not able to be read in due to DTCM limits. | |
uint32_t | bit_field_filtered_packets |
The number of packets dropped because the bitfield filter says they don't hit anything. | |
uint16_t | items_to_go |
The number of addresses from the same spike left to process. | |
static uint32_t | get_offset (address_list_entry entry) |
Get the standard address offset out of an entry. | |
static uint32_t | get_address (address_list_entry entry, uint32_t addr) |
Get the standard address out of an entry. | |
static uint32_t | get_row_length (address_list_entry entry) |
Get the length of the row from the entry. | |
static uint32_t | get_core_index (master_population_table_entry entry, spike_t spike) |
Get the source core index from a spike. | |
static uint32_t | get_core_sum (master_population_table_entry entry, spike_t spike) |
Get the total number of neurons on cores which come before this core. | |
static uint32_t | get_neuron_id (master_population_table_entry entry, spike_t spike) |
Get the source neuron ID for a spike given its table entry (without extra info) | |
static uint32_t | get_local_neuron_id (master_population_table_entry entry, spike_t spike) |
Get the neuron id of the neuron on the source core, for a spike with extra info. | |
static void | get_row_addr_and_size (address_list_entry item, uint32_t synaptic_rows_base_address, uint32_t neuron_id, pop_table_lookup_result_t *result) |
Get the row address and size for a given neuron. | |
bool | population_table_setup (address_t table_address, uint32_t *row_max_n_words, uint32_t *master_pop_table_length, master_population_table_entry **master_pop_table, address_list_entry **address_list) |
Set up and return the table for outside use. | |
bool | population_table_initialise (address_t table_address, address_t synapse_rows_address, uint32_t *row_max_n_words) |
Set up the table. | |
bool | population_table_load_bitfields (filter_region_t *filter_region) |
Initialise the bitfield filtering system. | |
bool | population_table_get_first_address (spike_t spike, pop_table_lookup_result_t *result) |
Get the first row data for the given input spike. | |
static bool | population_table_is_next (void) |
Determine if there are more items with the same key. | |
bool | population_table_get_next_address (spike_t *spike, pop_table_lookup_result_t *result) |
Get the next row data for a previously given spike. If no spike has been given, return False. | |
Master pop(ulation) table API.
Definition in file population_table.h.
struct master_population_table_entry |
An entry in the master population table.
Definition at line 50 of file population_table.h.
Data Fields | ||
---|---|---|
uint32_t | key | The key to match against the incoming message. |
uint32_t | mask |
The mask to select the relevant bits of key for matching. |
uint32_t | start: 13 | The index into address_list for this entry. |
uint32_t | n_colour_bits: 3 | The number of bits of key used for colour (0 if no colour) |
uint32_t | count: 16 | The number of entries in address_list for this entry. |
uint32_t | core_mask: 16 | The mask to apply to the key once shifted to get the core index. |
uint32_t | mask_shift: 16 | The shift to apply to the key to get the core part. |
uint32_t | n_neurons: 16 | The number of neurons per core. |
uint32_t | n_words: 16 | The number of words for n_neurons. |
struct address_list_entry |
A packed address and row length (note: same size as extra info)
Definition at line 72 of file population_table.h.
Data Fields | ||
---|---|---|
uint32_t | row_length: 8 | the length of the row |
uint32_t | address: N_ADDRESS_BITS | the address |
struct pop_table_config_t |
The memory layout in SDRAM of the first part of the population table configuration. Address list data (array of ::address_and_row_length) is packed on the end.
Definition at line 86 of file population_table.h.
Data Fields | ||
---|---|---|
uint32_t | table_length | |
uint32_t | addr_list_length | |
master_population_table_entry | data[] |
struct pop_table_lookup_result_t |
A structure to hold a response to a population table lookup.
Definition at line 93 of file population_table.h.
Data Fields | ||
---|---|---|
synaptic_row_t | row_address | |
size_t | n_bytes_to_transfer | |
uint32_t | colour | |
uint32_t | colour_mask |
#define BITS_PER_WORD 32 |
bits in a word
Definition at line 31 of file population_table.h.
#define TOP_BIT_IN_WORD 31 |
The highest bit within the word.
Definition at line 34 of file population_table.h.
#define NOT_IN_MASTER_POP_TABLE_FLAG -1 |
The flag for when a spike isn't in the master pop table (so shouldn't happen)
Definition at line 38 of file population_table.h.
#define N_ADDRESS_BITS 24 |
The number of bits of address. This is a constant as it is used more than once below.
Definition at line 42 of file population_table.h.
#define INDIRECT_ADDRESS_SHIFT 4 |
The shift to apply to indirect addresses. The address is in units of four words, so this multiplies by 16 (= up shifts by 4)
Definition at line 47 of file population_table.h.
#define INVALID_ADDRESS ((1 << N_ADDRESS_BITS) - 1) |
An Invalid address and row length.
Used to keep indices aligned between delayed and undelayed tables
Definition at line 81 of file population_table.h.
|
inlinestatic |
Get the standard address offset out of an entry.
The address is in units of four words, so this multiplies by 16 (= up shifts by 4)
[in] | entry | the table entry |
Definition at line 115 of file population_table.h.
|
inlinestatic |
Get the standard address out of an entry.
[in] | entry | the table entry |
Definition at line 122 of file population_table.h.
|
inlinestatic |
Get the length of the row from the entry.
Row lengths are stored offset by 1, to allow 1-256 length rows
[in] | entry | the table entry |
Definition at line 132 of file population_table.h.
|
inlinestatic |
Get the source core index from a spike.
[in] | entry | The master pop table entry |
[in] | spike | The spike received |
Definition at line 140 of file population_table.h.
|
inlinestatic |
Get the total number of neurons on cores which come before this core.
[in] | entry | The master pop table entry |
[in] | spike | The spike received |
Definition at line 148 of file population_table.h.
|
inlinestatic |
Get the source neuron ID for a spike given its table entry (without extra info)
[in] | entry | the table entry |
[in] | spike | the spike |
Definition at line 156 of file population_table.h.
|
inlinestatic |
Get the neuron id of the neuron on the source core, for a spike with extra info.
[in] | entry | the table entry |
[in] | spike | the spike received |
Definition at line 166 of file population_table.h.
|
inlinestatic |
Get the row address and size for a given neuron.
[in] | item | The address list item |
[in] | synaptic_rows_based_address | The address of all synaptic rows |
[in] | neuron_id | The incoming neuron to get the address of |
[out] | result | The place to write results to |
Definition at line 176 of file population_table.h.
bool population_table_setup | ( | address_t | table_address, |
uint32_t * | row_max_n_words, | ||
uint32_t * | master_pop_table_length, | ||
master_population_table_entry ** | master_pop_table, | ||
address_list_entry ** | address_list | ||
) |
Set up and return the table for outside use.
[in] | table_address | The address of the start of the table data |
[out] | row_max_n_words | Updated with the maximum length of any row in the table in words |
[out] | master_pop_table_length | Updated with the length of the table |
[out] | master_pop_table | Updated with the table entries |
[out] | address_list | Updated with the address list |
Definition at line 203 of file population_table_binary_search_impl.c.
bool population_table_initialise | ( | address_t | table_address, |
address_t | synapse_rows_address, | ||
uint32_t * | row_max_n_words | ||
) |
Set up the table.
[in] | table_address | The address of the start of the table data |
[in] | synapse_rows_address | The address of the start of the synapse data |
[out] | row_max_n_words | Updated with the maximum length of any row in the table in words |
Definition at line 249 of file population_table_binary_search_impl.c.
bool population_table_load_bitfields | ( | filter_region_t * | filter_region | ) |
Initialise the bitfield filtering system.
[in] | filter_region | Where the bitfield configuration is |
Definition at line 118 of file population_table_binary_search_impl.c.
bool population_table_get_first_address | ( | spike_t | spike, |
pop_table_lookup_result_t * | result | ||
) |
Get the first row data for the given input spike.
[in] | spike | The spike received |
[out] | result | Updated with the lookup details |
Definition at line 263 of file population_table_binary_search_impl.c.
|
inlinestatic |
Determine if there are more items with the same key.
Definition at line 248 of file population_table.h.
bool population_table_get_next_address | ( | spike_t * | spike, |
pop_table_lookup_result_t * | result | ||
) |
Get the next row data for a previously given spike. If no spike has been given, return False.
[out] | spike | The initiating spike |
[out] | result | Updated with the lookup details |
Definition at line 314 of file population_table_binary_search_impl.c.
|
extern |
the number of times a DMA resulted in 0 entries
Definition at line 60 of file population_table_binary_search_impl.c.
|
extern |
the number of times packet isn't in the master pop table at all!
the number of times packet isn't in the master pop table at all!
Definition at line 63 of file population_table_binary_search_impl.c.
|
extern |
The number of bit fields which were not able to be read in due to DTCM limits.
Definition at line 67 of file population_table_binary_search_impl.c.
|
extern |
The number of packets dropped because the bitfield filter says they don't hit anything.
Definition at line 71 of file population_table_binary_search_impl.c.
|
extern |
The number of addresses from the same spike left to process.
The number of relevant items remaining in the address_list NOTE: Exported for speed of check
Definition at line 54 of file population_table_binary_search_impl.c.