76#if LOG_LEVEL >= LOG_DEBUG
81 int count = entry.
count;
82 int start = entry.
start;
83 log_info(
" core_mask: 0x%08x, core_shift: %u, n_neurons: %u, n_words: %u, n_colour_bits: %u",
85 for (uint16_t j = start; j < (start + count); j++) {
90 log_info(
" index %d: offset: %u, address: 0x%08x, row_length: %u",
104#if LOG_LEVEL >= LOG_DEBUG
106 uint32_t n_words = get_bit_field_size(filters[mp_i].n_atoms);
107 log_info(
"Bit field(s) for key 0x%08x, %u words for %u atoms:",
109 for (uint32_t i = 0; i < n_words; i++) {
132 "Couldn't initialise basic bit field holder. Will end up doing"
133 " possibly more DMA's during the execution than required."
134 " We required %d bytes where %d are available",
144 log_error(
"The number of filters doesn't match the population table");
153 log_error(
"Bitfield for %u keys do not match: bf=0x%08x vs mp=0x%08x",
157 uint32_t useful = !(filters[mp_i].
merged || filters[mp_i].
all_ones);
161 uint32_t n_words = get_bit_field_size(filters[mp_i].n_atoms);
181 spike_t spike, uint32_t *position) {
185 while (imin < imax) {
186 uint32_t imid = (imax + imin) >> 1;
188 if ((spike & entry.
mask) == entry.
key) {
191 }
else if (entry.
key < spike) {
204 uint32_t *master_pop_table_length,
210 *master_pop_table_length =
config->table_length;
212 if (*master_pop_table_length == 0) {
216 uint32_t n_master_pop_bytes =
220 *master_pop_table = spin1_malloc(n_master_pop_bytes);
221 if (*master_pop_table ==
NULL) {
222 log_error(
"Could not allocate master population table of %u bytes",
227 uint32_t address_list_length =
config->addr_list_length;
228 uint32_t n_address_list_bytes =
233 log_error(
"Could not allocate master population address list of %u bytes",
234 n_address_list_bytes);
241 n_address_list_bytes);
251 uint32_t *row_max_n_words) {
304 uint32_t local_spike_id;
320 bool is_valid =
false;
void log_error(const char *message,...)
void log_warning(const char *message,...)
void log_info(const char *message,...)
static uint32_t key
Base multicast key for sending messages.
uint32_t spike_t
The type of a spike.
Master pop(ulation) table API.
static uint32_t get_offset(address_list_entry entry)
Get the standard address offset out of an entry.
uint32_t key
The key to match against the incoming message.
uint32_t count
The number of entries in address_list for this entry.
uint32_t n_neurons
The number of neurons per core.
static uint32_t get_address(address_list_entry entry, uint32_t addr)
Get the standard address out of an entry.
uint32_t address
the address
static uint32_t get_row_length(address_list_entry entry)
Get the length of the row from the entry.
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.
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.
uint32_t mask
The mask to select the relevant bits of key for matching.
uint32_t n_colour_bits
The number of bits of key used for colour (0 if no colour)
uint32_t n_words
The number of words for n_neurons.
#define INVALID_ADDRESS
An Invalid address and row length.
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.
uint32_t core_mask
The mask to apply to the key once shifted to get the core index.
uint32_t mask_shift
The shift to apply to the key to get the core part.
uint32_t start
The index into address_list for this entry.
A packed address and row length (note: same size as extra info)
An entry in the master population table.
The memory layout in SDRAM of the first part of the population table configuration....
A structure to hold a response to a population table lookup.
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.
static uint16_t next_item
the index for the next item in the address_list
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.
static master_population_table_entry * master_population_table
The master population table. This is sorted.
static void print_bitfields(uint32_t mp_i, filter_info_t *filters)
Print bitfields for debugging.
static uint32_t last_colour
The last colour received.
static uint32_t synaptic_rows_base_address
Base address for the synaptic matrix's indirect rows.
static void print_master_population_table(void)
Prints the master pop table.
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 invalid_master_pop_hits
the number of times packet isnt in the master pop table at all!
uint32_t bit_field_filtered_packets
The number of packets dropped because the bitfield filter says they don't hit anything.
bool population_table_load_bitfields(filter_region_t *filter_region)
Initialise the bitfield filtering system.
static address_list_entry * address_list
The array of information that points into the synaptic matrix.
static uint32_t last_colour_mask
The last colour mask used.
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_position_in_the_master_pop_array(spike_t spike, uint32_t *position)
Get the position in the master population table.
static uint32_t last_neuron_id
The last neuron id for the key.
uint32_t ghost_pop_table_searches
the number of times a DMA resulted in 0 entries
static uint32_t master_population_table_length
The length of master_population_table.
bool population_table_initialise(address_t table_address, address_t synapse_rows_address, uint32_t *row_max_n_words)
Set up the table.
uint16_t items_to_go
The number of addresses from the same spike left to process.
static bit_field_t * connectivity_bit_field
The bitfield map.
static spike_t last_spike
The last spike received.
uint sark_heap_max(heap_t *heap, uint flag)
void spin1_memcpy(void *dst, void const *src, uint len)
implementation for handling the processing of synapse rows.
#define N_SYNAPSE_ROW_HEADER_WORDS
Number of header words per synaptic row.