21#ifndef _POPULATION_TABLE_H_
22#define _POPULATION_TABLE_H_
31#define BITS_PER_WORD 32
34#define TOP_BIT_IN_WORD 31
38#define NOT_IN_MASTER_POP_TABLE_FLAG -1
42#define N_ADDRESS_BITS 24
47#define INDIRECT_ADDRESS_SHIFT 4
81#define INVALID_ADDRESS ((1 << N_ADDRESS_BITS) - 1)
87 uint32_t table_length;
88 uint32_t addr_list_length;
98 size_t n_bytes_to_transfer;
158 return spike & ~entry.mask;
182 uint32_t neuron_offset = neuron_id * stride *
sizeof(uint32_t);
184 result->row_address = (
synaptic_row_t) (block_address + neuron_offset);
185 result->n_bytes_to_transfer = stride *
sizeof(uint32_t);
187 log_debug(
"neuron_id = %u, block_address = 0x%.8x, "
188 "row_length = %u, row_address = 0x%.8x, n_bytes = %u",
189 neuron_id, block_address, row_length, result->row_address,
190 result->n_bytes_to_transfer);
219 uint32_t *master_pop_table_length,
232 uint32_t *row_max_n_words);
void log_debug(const char *message,...)
static uint32_t colour_mask
The mask to apply to get the colour from the current timestep or key.
static uint32_t colour
The colour for the current time step.
Data type definitions for SpiNNaker Neuron-modelling.
struct synaptic_row * synaptic_row_t
The type of a synaptic row.
uint32_t spike_t
The type of a spike.
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.
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_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.
uint32_t count
The number of entries in address_list for this entry.
uint32_t n_neurons
The number of neurons per core.
#define N_ADDRESS_BITS
The number of bits of address. This is a constant as it is used more than once below.
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
uint32_t row_length
the length of the row
#define INDIRECT_ADDRESS_SHIFT
The shift to apply to indirect addresses. The address is in units of four words, so this multiplies b...
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 isn't 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.
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.
bool population_table_load_bitfields(filter_region_t *filter_region)
Initialise the bitfield filtering system.
uint32_t mask
The mask to select the relevant bits of key for matching.
static bool population_table_is_next(void)
Determine if there are more items with the same key.
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.
uint32_t n_colour_bits
The number of bits of key used for colour (0 if no colour)
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_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)
uint32_t n_words
The number of words for n_neurons.
uint32_t ghost_pop_table_searches
the number of times a DMA resulted in 0 entries
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.
bool population_table_initialise(address_t table_address, address_t synapse_rows_address, uint32_t *row_max_n_words)
Set up the table.
uint32_t core_mask
The mask to apply to the key once shifted to get the core index.
uint16_t items_to_go
The number of addresses from the same spike left to process.
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.
static uint32_t synaptic_rows_base_address
Base address for the synaptic matrix's indirect rows.
static address_list_entry * address_list
The array of information that points into the synaptic matrix.
implementation for handling the processing of synapse rows.
#define N_SYNAPSE_ROW_HEADER_WORDS
Number of header words per synaptic row.