SpiNNFrontEndCommon 7.3.1
Common support code for user-facing front end systems.
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
rt_single.h File Reference

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_trouting_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_ttable
 The table being manipulated.
 
static const uint32_t DMA_READ_FLAGS
 DMA read flags.
 

Detailed Description

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.


Data Structure Documentation

◆ header_t

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 0 to load routing entries with the same application ID that was used to load this application.

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.

Macro Definition Documentation

◆ RTR_MC_SET_FAILED

#define RTR_MC_SET_FAILED   0

flag for if a rtr_mc_set() failure.

Definition at line 65 of file rt_single.h.

◆ DMA_COMPLETE

#define DMA_COMPLETE   0x400

Value of the masked DMA status register when transfer is complete.

Definition at line 77 of file rt_single.h.

◆ DMA_CHECK_MASK

#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.

Function Documentation

◆ routing_table_get_n_entries()

int routing_table_get_n_entries ( void  )

Get the number of entries in the routing table.

Returns
number of appended entries.

Definition at line 102 of file rt_single.h.

◆ routing_table_remove_from_size()

void routing_table_remove_from_size ( int  size_to_remove)

updates table stores accordingly.

will RTE if this causes the total entries to become negative.

Parameters
[in]size_to_removethe amount of size to remove from the table sets

Definition at line 106 of file rt_single.h.

◆ routing_table_get_entry()

entry_t * routing_table_get_entry ( uint32_t  entry_id_to_find)

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

Parameters
[in]entry_id_to_findId of entry to find pointer to
Returns
pointer to the entry's location

Definition at line 110 of file rt_single.h.

◆ print_header()

void print_header ( header_t header)

Print the header object for debug purposes.

Parameters
[in]headerthe header to print

Definition at line 116 of file rt_single.h.

◆ read_table()

static void read_table ( header_t header)
static

Read a new copy of the routing table from SDRAM.

Parameters
[in]headerthe header object

Definition at line 125 of file rt_single.h.

◆ load_routing_table()

bool load_routing_table ( uint32_t  app_id)

Load a routing table to the router.

Parameters
[in]app_idthe app id for the routing table entries to be loaded under
Returns
whether the table was loaded into the router

Definition at line 144 of file rt_single.h.

◆ routing_table_get_entries()

bool routing_table_get_entries ( uint32_t  start_entry,
uint32_t  n_entries,
entry_t output 
)

Gets a pointer to several entries.

Parameters
[in]start_entryThe first entry to get
[in]n_entriesThe number of entries to get
[out]outputWhere to put the entries read - must have enough space!
Returns
: Whether the entries are available now, or should be waited for

Definition at line 176 of file rt_single.h.

◆ dma_done()

static bool dma_done ( void  )
inlinestatic

Is there a DMA currently running?

Returns
True if there is something transferring now.

Definition at line 189 of file rt_single.h.

◆ routing_table_wait_for_last_transfer()

void routing_table_wait_for_last_transfer ( void  )

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.

Variable Documentation

◆ table

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

const uint32_t DMA_READ_FLAGS
static
Initial value:
=
DMA_WIDTH << 24 | DMA_BURST_SIZE << 21 | DMA_READ << 19
#define DMA_BURST_SIZE
Use DMA bursts of 16 (24) transfer units (double words)
DMA_READ
#define DMA_WIDTH

DMA read flags.

Definition at line 73 of file rt_single.h.