SpiNNFrontEndCommon 7.3.1
Common support code for user-facing front end systems.
|
SpiNNaker routing table minimisation. More...
#include <stdbool.h>
#include <spin1_api.h>
#include <spin1_api_params.h>
#include <debug.h>
#include <malloc_extras.h>
#include "../common/routing_table.h"
Go to the source code of this file.
Data Structures | |
struct | header_t |
The header of the routing table information in the input data block. More... | |
Macros | |
#define | RTR_MC_SET_FAILED 0 |
flag for if a rtr_mc_set() failure. | |
#define | DMA_COMPLETE 0x400 |
Value of the masked DMA status register when transfer is complete. | |
#define | DMA_CHECK_MASK 0x401 |
Mask to apply to the DMA status register to check for completion. | |
Functions | |
int | routing_table_get_n_entries (void) |
Get the number of entries in the routing table. | |
void | routing_table_remove_from_size (int size_to_remove) |
updates table stores accordingly. | |
entry_t * | routing_table_get_entry (uint32_t entry_id_to_find) |
Gets a pointer to where this entry is stored. | |
void | print_header (header_t *header) |
Print the header object for debug purposes. | |
static void | read_table (header_t *header) |
Read a new copy of the routing table from SDRAM. | |
bool | load_routing_table (uint32_t app_id) |
Load a routing table to the router. | |
bool | routing_table_get_entries (uint32_t start_entry, uint32_t n_entries, entry_t *output) |
Gets a pointer to several entries. | |
static bool | dma_done (void) |
Is there a DMA currently running? | |
void | routing_table_wait_for_last_transfer (void) |
Waits for the last transfer from routing_table_get_entries to complete. | |
Variables | |
table_t * | table |
The table being manipulated. | |
static const uint32_t | DMA_READ_FLAGS |
DMA read flags. | |
SpiNNaker routing table minimisation.
Minimise a routing table loaded into SDRAM and load the minimised table into the router using the specified application ID.
the exit code is stored in the user0 register
The memory address with tag "1" is expected contain the following struct (entry_t is defined in routing_table.h
but is described below).
Definition in file rt_single.h.
struct header_t |
The header of the routing table information in the input data block.
This is found looking for a memory block with the right tag.
Definition at line 85 of file rt_single.h.
Data Fields | ||
---|---|---|
uint32_t | app_id |
Application ID to use to load the routing table. This can be left as |
uint32_t | compress_as_much_as_possible |
flag that uses the available entries of the router table instead of compressing as much as possible. |
uint32_t | table_size | Initial size of the routing table. |
entry_t | entries[] | Routing table entries. |
#define RTR_MC_SET_FAILED 0 |
flag for if a rtr_mc_set() failure.
Definition at line 65 of file rt_single.h.
#define DMA_COMPLETE 0x400 |
Value of the masked DMA status register when transfer is complete.
Definition at line 77 of file rt_single.h.
#define DMA_CHECK_MASK 0x401 |
Mask to apply to the DMA status register to check for completion.
Definition at line 80 of file rt_single.h.
Get the number of entries in the routing table.
Definition at line 102 of file rt_single.h.
updates table stores accordingly.
will RTE if this causes the total entries to become negative.
[in] | size_to_remove | the amount of size to remove from the table sets |
Definition at line 106 of file rt_single.h.
Gets a pointer to where this entry is stored.
Will not check if there is an entry with this id but will RTE if the id is too large
[in] | entry_id_to_find | Id of entry to find pointer to |
Definition at line 110 of file rt_single.h.
Print the header object for debug purposes.
[in] | header | the header to print |
Definition at line 116 of file rt_single.h.
Read a new copy of the routing table from SDRAM.
[in] | header | the header object |
Definition at line 125 of file rt_single.h.
Load a routing table to the router.
[in] | app_id | the app id for the routing table entries to be loaded under |
Definition at line 144 of file rt_single.h.
Gets a pointer to several entries.
[in] | start_entry | The first entry to get |
[in] | n_entries | The number of entries to get |
[out] | output | Where to put the entries read - must have enough space! |
Definition at line 176 of file rt_single.h.
Is there a DMA currently running?
Definition at line 189 of file rt_single.h.
Waits for the last transfer from routing_table_get_entries to complete.
Returns immediately if the last transfer is already done
Definition at line 195 of file rt_single.h.
table_t* table |
The table being manipulated.
This is common across all the functions in this file.
Definition at line 70 of file rt_single.h.
DMA read flags.
Definition at line 73 of file rt_single.h.