SpiNNFrontEndCommon 7.2.2
Common support code for user-facing front end systems.
|
The implementation of the Reverse IP tag Multicast Source. More...
#include <common-typedefs.h>
#include <data_specification.h>
#include <debug.h>
#include <simulation.h>
#include <sark.h>
#include <eieio.h>
#include <buffered_eieio_defs.h>
#include "recording.h"
#include <wfi.h>
Go to the source code of this file.
Data Structures | |
struct | config |
The configuration parameters for the application. More... | |
struct | ripmcs_provenance_t |
The provenance data items. More... | |
struct | recorded_packet_t |
What information is recorded about a packet. More... | |
struct | req_packet_sdp_t |
An EIEIO request-for-more-space message. More... | |
Macros | |
#define | NUMBER_OF_REGIONS_TO_RECORD 1 |
The number of regions that can be recorded. | |
#define | SPIKE_HISTORY_CHANNEL 0 |
The recording channel used to track the history of what spikes were sent. | |
#define | MIN_BUFFER_SPACE 10 |
the minimum space required for a buffer to work | |
#define | TICKS_BETWEEN_REQUESTS 25 |
the amount of ticks to wait between requests | |
#define | MAX_PACKET_SIZE 272 |
the maximum size of a packet excluding header | |
#define | BITS(value, shift, mask) (((value) >> (shift)) & (mask)) |
Extract a field from a bitfield value. | |
Enumerations | |
enum | interrupt_priorities { DMA = 0 , SDP_CALLBACK = 1 , TIMER = 2 } |
human readable versions of the different priorities and usages. More... | |
enum | region_ids { SYSTEM , CONFIGURATION , RECORDING_REGION , BUFFER_REGION , PROVENANCE_REGION } |
The memory regions. More... | |
Variables | |
static uint32_t | time |
Current simulation time. | |
static uint32_t | simulation_ticks |
The time that the simulation is scheduled to stop at. | |
static uint32_t | infinite_run |
True if the simulation will "run forever" (until user interrupt). | |
static bool | apply_prefix |
If a prefix should be applied. | |
static bool | check_key_in_space |
Whether only packets with keys in the masked key space should be sent. | |
static uint32_t | prefix |
The prefix to apply. | |
static bool | has_key |
Whether a key is present; nothing is sent if no key is present. | |
static uint32_t | key_space |
Pattern of keys that must be matched when check_key_in_space is true. | |
static uint32_t | mask |
Mask for keys to determine if the key matches the key_space. | |
static uint32_t | last_stop_notification_request |
DEBUG: time of last stop notification. | |
static eieio_prefix_types | prefix_type |
How to apply the prefix. | |
static uint32_t | buffer_region_size |
Size of buffer in buffer_region. | |
static uint32_t | space_before_data_request |
Threshold at which we ask for buffers to be cleared. | |
static ripmcs_provenance_t | provenance = {0} |
The provenance information that we're collecting. | |
static uint32_t | recording_flags = 0 |
Keeps track of which types of recording should be done to this model. | |
static uint8_t * | buffer_region |
Points to the buffer used to store data being collected to transfer out. | |
static uint8_t * | end_of_buffer_region |
Points to the end of the buffer (to first byte that must not be written) | |
static uint8_t * | write_pointer |
Points to next byte to write in buffer_region. | |
static uint8_t * | read_pointer |
Points to next byte to read in buffer_region. | |
static sdp_msg_t | sdp_host_req |
An SDP message ready to send to host. | |
static req_packet_sdp_t * | req_ptr |
Payload part of sdp_host_req. | |
static eieio_msg_t | msg_from_sdram |
DTCM buffer holding message copied from buffer_region. | |
static bool | msg_from_sdram_in_use |
Does msg_from_sdram currently contain a message being processed? | |
static int | msg_from_sdram_length |
Length of msg_from_sdram. | |
static uint32_t | next_buffer_time |
Simulation time associated with message in msg_from_sdram. | |
static uint8_t | pkt_last_sequence_seen |
Most recently seen message sequence number. | |
static bool | send_packet_reqs |
Whether request packets should be sent. | |
static buffered_operations | last_buffer_operation |
What the last operation done on buffer_region was. | |
static uint8_t | return_tag_id |
The SDP tag for sending messages to host. | |
static uint32_t | return_tag_dest |
The SDP destination for sending messages to host. | |
static uint32_t | buffered_in_sdp_port |
The SDP port that we buffer messages in on. | |
static uint32_t | tx_offset |
The timer offset to use for transmissions. | |
static uint32_t | last_space |
Last value of result of get_sdram_buffer_space_available() in send_buffer_request_pkt() | |
static uint32_t | last_request_tick |
Last (sim) time we forced the buffers clear from timer_callback() | |
static bool | stopped = false |
Whether this app has been asked to stop running. | |
static recorded_packet_t * | recorded_packet |
Buffer used for recording inbound packets. | |
The implementation of the Reverse IP tag Multicast Source.
The purpose of this application is to inject SpiNNaker packets into the on-chip network dynamically.
Definition in file reverse_iptag_multicast_source.c.
struct config |
The configuration parameters for the application.
Definition at line 52 of file reverse_iptag_multicast_source.c.
Data Fields | ||
---|---|---|
uint32_t | apply_prefix | Whether to always apply a prefix. |
uint32_t | prefix | The prefix to apply. |
uint32_t | prefix_type | The type of prefix that is supplied. |
uint32_t | check_keys | Whether only packets with keys in the masked key space should be sent. |
uint32_t | has_key | Whether a key is provided. |
uint32_t | key_space | The key space used for packet selection. |
uint32_t | mask | The mask used for packet selection. |
uint32_t | buffer_region_size | The size of the buffer region. |
uint32_t | space_before_data_request | The point where we ask for the host to clear up space. |
uint32_t | return_tag_id | The SDP tag for sending messages to host. |
uint32_t | return_tag_dest | The SDP destination for sending messages to host. |
uint32_t | buffered_in_sdp_port | The SDP port that we buffer messages in on. |
uint32_t | tx_offset |
The timer offset to use for transmissions. Used to ensure we don't send all messages at the same time and overload SpiNNaker routers. |
struct ripmcs_provenance_t |
The provenance data items.
Definition at line 94 of file reverse_iptag_multicast_source.c.
Data Fields | ||
---|---|---|
uint32_t | received_packets | How many EIEIO packets were received. |
uint32_t | sent_packets | How many MC packets were sent. |
uint32_t | incorrect_keys | Number of bad keys. |
uint32_t | incorrect_packets | Number of bad packets (in non-debug mode) |
uint32_t | late_packets | Number of packets dropped for being late. |
struct recorded_packet_t |
What information is recorded about a packet.
Definition at line 119 of file reverse_iptag_multicast_source.c.
Data Fields | ||
---|---|---|
uint32_t | length | The real length of recorded_packet_t::data. |
uint32_t | time | The timestamp of this recording event. |
uint8_t | data[MAX_PACKET_SIZE] | The content of the packet. |
struct req_packet_sdp_t |
An EIEIO request-for-more-space message.
Definition at line 126 of file reverse_iptag_multicast_source.c.
Data Fields | ||
---|---|---|
uint16_t | eieio_header_command | The command header. |
uint16_t | chip_id | What chip is making the request. |
uint8_t | processor | What core is making the request. |
uint8_t | region | What region is full. |
uint8_t | sequence | What sequence number we expect. |
uint32_t | space_available | How much space is available. |
#define NUMBER_OF_REGIONS_TO_RECORD 1 |
The number of regions that can be recorded.
Definition at line 103 of file reverse_iptag_multicast_source.c.
#define SPIKE_HISTORY_CHANNEL 0 |
The recording channel used to track the history of what spikes were sent.
Definition at line 105 of file reverse_iptag_multicast_source.c.
#define MIN_BUFFER_SPACE 10 |
the minimum space required for a buffer to work
Definition at line 108 of file reverse_iptag_multicast_source.c.
#define TICKS_BETWEEN_REQUESTS 25 |
the amount of ticks to wait between requests
Definition at line 111 of file reverse_iptag_multicast_source.c.
#define MAX_PACKET_SIZE 272 |
the maximum size of a packet excluding header
Definition at line 114 of file reverse_iptag_multicast_source.c.
Extract a field from a bitfield value.
[in] | value | the bitfield value |
[in] | shift | the index of the start of the LSB of the field |
[in] | mask | the mask for the value, once shifted to the bottom of the word |
Definition at line 261 of file reverse_iptag_multicast_source.c.
human readable versions of the different priorities and usages.
Definition at line 45 of file reverse_iptag_multicast_source.c.
The memory regions.
Definition at line 85 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
What is the size of a command message?
[in] | eieio_msg_ptr | Pointer to the message |
Definition at line 267 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
What is the size of an event message?
[in] | eieio_msg_ptr | Pointer to the message |
Definition at line 296 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
What is the size of a message?
[in] | eieio_msg_ptr | Pointer to the message |
Definition at line 338 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Dumps a message to IOBUF if debug messages are enabled.
[in] | eieio_msg_ptr | Pointer to the message to print |
[in] | length | Length of the message |
Definition at line 352 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Dumps a message to IOBUF if debug messages are enabled.
Combines calculate_eieio_packet_size() and print_packet_bytes()
[in] | eieio_msg_ptr | Pointer to the message to print |
Definition at line 376 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Flags up that bad input was received.
This triggers an RTE, but only in debug mode.
[in] | eieio_msg_ptr | The bad message |
[in] | length | The length of the message |
Definition at line 390 of file reverse_iptag_multicast_source.c.
Computes how much space is available in the buffer.
Definition at line 402 of file reverse_iptag_multicast_source.c.
Whether we have a packet in the buffer.
Definition at line 422 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Get the time from a message.
[in] | eieio_msg_ptr | The EIEIO message. |
Definition at line 438 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Places a packet into the buffer.
[in] | eieio_msg_ptr | The EIEIO message to store. |
[in] | length | The size of the message. |
Definition at line 507 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Handle an SDP message containing 16 bit events. The events are converted into SpiNNaker multicast packets and sent.
[in] | event_pointer | Where the events start |
[in] | pkt_prefix_upper | True if the prefix is an upper prefix. |
[in] | pkt_count | The number of events. |
[in] | pkt_key_prefix | The prefix for keys. |
[in] | pkt_payload_prefix | The prefix for payloads. |
[in] | pkt_has_payload | Whether there is a payload. |
[in] | pkt_payload_is_timestamp | Whether the payload is a timestamp. |
Definition at line 586 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Handle an SDP message containing 32 bit events. The events are converted into SpiNNaker multicast packets and sent.
[in] | event_pointer | Where the events start |
[in] | pkt_count | The number of events. |
[in] | pkt_key_prefix | The prefix for keys. |
[in] | pkt_payload_prefix | The prefix for payloads. |
[in] | pkt_has_payload | Whether there is a payload. |
[in] | pkt_payload_is_timestamp | Whether the payload is a timestamp. |
Definition at line 650 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Asynchronously record an EIEIO message.
[in] | eieio_msg_ptr | The message to record. |
[in] | length | The length of the message. |
Definition at line 703 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Parses an EIEIO message.
This may cause the message to be saved for later, or may cause SpiNNaker multicast messages to be sent at once.
[in] | eieio_msg_ptr | the message to handle |
[in] | length | the length of the message |
Definition at line 732 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Handle the command to stop parsing requests.
[in] | eieio_msg_ptr | The command message |
[in] | length | The length of the message |
Definition at line 839 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Handle the command to start parsing requests.
[in] | eieio_msg_ptr | The command message |
[in] | length | The length of the message |
Definition at line 849 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Handle the command to store a request for later processing.
[in] | eieio_msg_ptr | The command message |
[in] | length | The length of the message |
Definition at line 858 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Handle a command message.
[in] | eieio_msg_ptr | The command message |
[in] | length | The length of the message |
Definition at line 900 of file reverse_iptag_multicast_source.c.
|
inlinestatic |
Handle an EIEIO message, which can either be a command or an event description message.
[in] | eieio_msg_ptr | The message |
[in] | length | The length of the message |
Definition at line 934 of file reverse_iptag_multicast_source.c.
Process a stored packet.
Definition at line 951 of file reverse_iptag_multicast_source.c.
Sends a message saying what our state is.
Definition at line 1038 of file reverse_iptag_multicast_source.c.
Reads our configuration region.
[in] | config | The address of the configuration region. |
Definition at line 1057 of file reverse_iptag_multicast_source.c.
Initialises the buffer region.
[in] | region_address | The location of the region. |
Definition at line 1129 of file reverse_iptag_multicast_source.c.
Initialises the recording parts of the model.
Definition at line 1144 of file reverse_iptag_multicast_source.c.
Writes our provenance data into the provenance region.
[in] | address | Where to write |
Definition at line 1159 of file reverse_iptag_multicast_source.c.
Initialises the application.
[out] | timer_period | What to configure the timer with. |
Definition at line 1172 of file reverse_iptag_multicast_source.c.
Reinitialises the application after it was paused.
Definition at line 1216 of file reverse_iptag_multicast_source.c.
The fundamental operation loop for the application.
unused0 | unused |
unused1 | unused |
Definition at line 1238 of file reverse_iptag_multicast_source.c.
Handles an incoming SDP message.
Delegates to packet_handler_selector()
[in] | mailbox | The address of the message. |
port | The SDP port of the message. Ignored. |
Definition at line 1288 of file reverse_iptag_multicast_source.c.
Entry point.
Definition at line 1302 of file reverse_iptag_multicast_source.c.
|
static |
Current simulation time.
Definition at line 142 of file reverse_iptag_multicast_source.c.
|
static |
The time that the simulation is scheduled to stop at.
Definition at line 145 of file reverse_iptag_multicast_source.c.
|
static |
True if the simulation will "run forever" (until user interrupt).
Definition at line 148 of file reverse_iptag_multicast_source.c.
|
static |
If a prefix should be applied.
Definition at line 151 of file reverse_iptag_multicast_source.c.
|
static |
Whether only packets with keys in the masked key space should be sent.
Definition at line 154 of file reverse_iptag_multicast_source.c.
|
static |
The prefix to apply.
Definition at line 157 of file reverse_iptag_multicast_source.c.
|
static |
Whether a key is present; nothing is sent if no key is present.
Definition at line 160 of file reverse_iptag_multicast_source.c.
|
static |
Pattern of keys that must be matched when check_key_in_space is true.
Definition at line 163 of file reverse_iptag_multicast_source.c.
|
static |
Mask for keys to determine if the key matches the key_space.
Definition at line 166 of file reverse_iptag_multicast_source.c.
|
static |
DEBUG: time of last stop notification.
Definition at line 169 of file reverse_iptag_multicast_source.c.
|
static |
How to apply the prefix.
Definition at line 172 of file reverse_iptag_multicast_source.c.
|
static |
Size of buffer in buffer_region.
Definition at line 175 of file reverse_iptag_multicast_source.c.
|
static |
Threshold at which we ask for buffers to be cleared.
Definition at line 178 of file reverse_iptag_multicast_source.c.
|
static |
The provenance information that we're collecting.
Definition at line 181 of file reverse_iptag_multicast_source.c.
|
static |
Keeps track of which types of recording should be done to this model.
Definition at line 184 of file reverse_iptag_multicast_source.c.
|
static |
Points to the buffer used to store data being collected to transfer out.
Definition at line 187 of file reverse_iptag_multicast_source.c.
|
static |
Points to the end of the buffer (to first byte that must not be written)
Definition at line 190 of file reverse_iptag_multicast_source.c.
|
static |
Points to next byte to write in buffer_region.
Definition at line 193 of file reverse_iptag_multicast_source.c.
|
static |
Points to next byte to read in buffer_region.
Definition at line 196 of file reverse_iptag_multicast_source.c.
|
static |
An SDP message ready to send to host.
Definition at line 199 of file reverse_iptag_multicast_source.c.
|
static |
Payload part of sdp_host_req.
Definition at line 202 of file reverse_iptag_multicast_source.c.
|
static |
DTCM buffer holding message copied from buffer_region.
Definition at line 205 of file reverse_iptag_multicast_source.c.
|
static |
Does msg_from_sdram currently contain a message being processed?
Definition at line 208 of file reverse_iptag_multicast_source.c.
|
static |
Length of msg_from_sdram.
Definition at line 211 of file reverse_iptag_multicast_source.c.
|
static |
Simulation time associated with message in msg_from_sdram.
Definition at line 214 of file reverse_iptag_multicast_source.c.
|
static |
Most recently seen message sequence number.
Definition at line 217 of file reverse_iptag_multicast_source.c.
|
static |
Whether request packets should be sent.
Definition at line 220 of file reverse_iptag_multicast_source.c.
|
static |
What the last operation done on buffer_region was.
Definition at line 223 of file reverse_iptag_multicast_source.c.
|
static |
The SDP tag for sending messages to host.
Definition at line 226 of file reverse_iptag_multicast_source.c.
|
static |
The SDP destination for sending messages to host.
Definition at line 229 of file reverse_iptag_multicast_source.c.
|
static |
The SDP port that we buffer messages in on.
Definition at line 232 of file reverse_iptag_multicast_source.c.
|
static |
The timer offset to use for transmissions.
Used to ensure we don't send all messages at the same time and overload SpiNNaker routers.
Definition at line 238 of file reverse_iptag_multicast_source.c.
|
static |
Last value of result of get_sdram_buffer_space_available() in send_buffer_request_pkt()
Definition at line 242 of file reverse_iptag_multicast_source.c.
|
static |
Last (sim) time we forced the buffers clear from timer_callback()
Definition at line 245 of file reverse_iptag_multicast_source.c.
Whether this app has been asked to stop running.
Definition at line 248 of file reverse_iptag_multicast_source.c.
|
static |
Buffer used for recording inbound packets.
Definition at line 251 of file reverse_iptag_multicast_source.c.