spinnaker_tools 3.4.0
SpiNNaker API, sark, sc&mp, bmp firmware and build tools
|
SC&MP interrupt routines. More...
Macros | |
#define | MAX_DIFF 10000 |
Maximum difference between timers over 2 seconds in clock ticks. | |
#define | N_ITEMS 16 |
Number of samples to keep to get an average. | |
#define | N_BEACONS_MASK 0xFFF |
The mask of the n_beacons part of the message. | |
#define | N_BEACONS_SHIFT 20 |
The shift of the n_beacons part of the message. | |
#define | SOURCE_T1_COUNT_MASK 0xFFFFF |
The mask of the source tc[T1_COUNT] part of the message. | |
Functions | |
void | p2p_rcv_data (uint data, uint key) |
Receive data on channel. | |
void | p2p_rcv_ctrl (uint data, uint key) |
Received P2P control packet. | |
void | nn_rcv_pkt (uint link, uint data, uint key) |
Nearest-neighbour packet received handler. | |
void | peek_ack_pkt (uint link, uint data, uint key) |
Initialises peek_pkt to contain the given arguments (presumably an acknowledge) | |
void | poke_ack_pkt (uint link, uint data, uint key) |
Initialises poke_pkt to contain the given arguments (presumably an acknowledge) | |
void | proc_1khz (uint a1, uint a2) |
Regular 1kHz timer callback, put on the event queue every millisecond. | |
void | proc_100hz (uint a1, uint a2) |
Regular 100Hz timer callback, put on the event queue every 10ms. | |
void | proc_1hz (uint a1, uint a2) |
Regular 1Hz timer callback, put on the event queue every second. | |
void | msg_queue_insert (sdp_msg_t *msg, uint srce_ip) |
Adds a message to SCAMP's master message queue, to be processed by proc_route_msg(). | |
void | pkt_tx_int (void) |
Packet transmit ready handler. | |
void | eth_rx_int (void) |
Ethernet packet received handler. Delegates to eth_receive() | |
void | pkt_mc_int (void) |
Multicast packet received handler. Delegates to signal_app() | |
void | test_mc_int (void) |
void | pkt_nn_int (void) |
Nearest-neighbour packet received handler. | |
void | pkt_p2p_int (void) |
Peer-to-peer packet received handler. | |
void | ms_timer_int (void) |
Millisecond timer interrupt handler. | |
void | ap_int (void) |
Application (local core) message available handler. | |
void | timer2_int_han (void) |
Interrupt handler for timer 2. Delegates to timer2_int() | |
void | vic_setup (void) |
Initialise the VIC. | |
Variables | |
pkt_queue_t | tx_pkt_queue |
Packet transmit queue. | |
uint | num_cpus |
Number of operational CPUs. | |
volatile uint | do_sync |
Whether to perform clock synchronization (on by default at start) | |
uint | mc_ping_count [NUM_LINKS] |
Reserved for performing MC and P2P pings. | |
static uint | centi_ms |
Counts 0 to 9 in ms. | |
static int | samples [N_ITEMS] |
Samples used when synchronising time. | |
static int | sum = 0 |
Sum to make moving average easy. | |
static int | last_ticks = 0 |
Ticks recorded last time. | |
static int | n_samples = 0 |
Number of samples recorded. | |
static uint | sample_pos = 0 |
Position of next sample. | |
static int | last_beacon = 0 |
Beacon id recorded last time to detect missed packets. | |
uint | n_beacons_sent = 0 |
Time beacon counter. | |
static uint | time_to_next_sync = TIME_BETWEEN_SYNC_US |
Inter-synchronisation time, in microseconds. | |
static uint | next_box |
Round robin counter for ap_int() | |
SC&MP interrupt routines.
#define MAX_DIFF 10000 |
Maximum difference between timers over 2 seconds in clock ticks.
Experiments have shown maximum difference is about 1ms over 160 seconds which is 6.25us over 1 second, which is 2500 clock ticks at 200Mhz. This is multiplied by 2 as drift could be in either direction. Further experiments show that slightly higher values are encountered, so 10000 is used.
#define SOURCE_T1_COUNT_MASK 0xFFFFF |
The mask of the source tc[T1_COUNT] part of the message.
The timer is set to 200,000 which fits in the bottom 20 bits.
Receive data on channel.
May write 1 or 2 bytes beyond end of buffer (buffer has pad word)
[in] | data | The payload from the packet |
[in] | addr | The sender address (lower 16 bits) from the packet |
Received P2P control packet.
Delegates to:
[in] | data | The payload from the packet |
[in] | addr | The sender address (lower 16 bits) from the packet |
Nearest-neighbour packet received handler.
[in] | link | What link was the packet received on |
[in] | data | The payload from the packet |
[in] | key | The key from the packet |
Initialises peek_pkt to contain the given arguments (presumably an acknowledge)
[in] | link | Which link to send the packet on |
[in] | data | The payload of the packet |
[in] | key | The key of the packet |
Initialises poke_pkt to contain the given arguments (presumably an acknowledge)
[in] | link | Which link to send the packet on |
[in] | data | The payload of the packet |
[in] | key | The key of the packet |
Regular 1kHz timer callback, put on the event queue every millisecond.
Used to PWM the LEDs.
a1 | unused |
a2 | unused |
Regular 100Hz timer callback, put on the event queue every 10ms.
Handles:
a1 | unused |
a2 | unused |
Regular 1Hz timer callback, put on the event queue every second.
It handles network physical state monitoring.
a1 | unused |
a2 | unused |
Adds a message to SCAMP's master message queue, to be processed by proc_route_msg().
[in] | msg | The message to dispatch. Transfers ownership of the message. |
[in] | srce_ip | Source IP address (if meaningful). |
void pkt_mc_int | ( | void | ) |
Multicast packet received handler. Delegates to signal_app()
Interrupt handlers for multicast.
void pkt_nn_int | ( | void | ) |
Nearest-neighbour packet received handler.
Delegates to one of:
void pkt_p2p_int | ( | void | ) |
Peer-to-peer packet received handler.
Delegates to one of:
void ms_timer_int | ( | void | ) |
Millisecond timer interrupt handler.
Delegates (with appropriate frequency) to: