SpiNNFrontEndCommon 7.3.1
Common support code for user-facing front end systems.
|
The implementation of the Chip Power Monitor. More...
#include <spin1_api.h>
#include <spinn_extra.h>
#include <simulation.h>
#include <spinnaker.h>
#include <recording.h>
#include <debug.h>
#include <data_specification.h>
Go to the source code of this file.
Data Structures | |
struct | sample_params |
Describes the format of the configuration region. More... | |
struct | recording |
Macros | |
#define | NUM_RANDOM_BITS 12 |
Enumerations | |
enum | { SYSTEM = 0 , CONFIG = 1 , RECORDING = 2 } |
The IDs of each DSG region used. More... | |
enum | { TIMER = 0 , SDP = 1 , DMA = 2 } |
values for the priority for each callback More... | |
Functions | |
static uint32_t | get_sample (void) |
Read which cores on the chip are asleep right now. | |
static uint32_t | get_random_busy (void) |
Computes a random value used to break up chance periodicities in sampling. | |
static void | record_aggregate_sample (void) |
Synchronously records the current contents of the core_counters to the recording region. | |
static void | reset_core_counters (void) |
Resets the state of the core_counters and the sample_count variables to zero. | |
static void | rescale_sim_ticks (void) |
Change simulation ticks to be a number related to sampling frequency. | |
static void | resume_callback (void) |
The function to call when resuming a simulation. | |
static void | count_core_states (void) |
Accumulate a count of how active each core on the current chip is. The counter for the core is incremented if the core is active. | |
static void | sample_in_slot (uint unused0, uint unused1) |
Called to actually record a sample. | |
static bool | read_parameters (struct sample_params *sample_params) |
Reads the configuration of the application out of the configuration region. | |
static bool | initialize (void) |
Initialises the program. | |
void | c_main (void) |
The application entry point. | |
Variables | |
static const uint32_t | RECORDING_CHANNEL_ID = 0 |
The recording channel we use. | |
static uint32_t | simulation_ticks = 0 |
The main simulation tick. | |
static uint32_t | infinite_run = 0 |
Whether we are running "forever". | |
static uint32_t | time |
Our internal notion of time. | |
static uint32_t | timer = 0 |
The main simulation time period. | |
static struct recording | recording |
Where we aggregate the sample activity counts. | |
static uint32_t | sample_count |
How many samples have we done so far within this aggregate step? | |
static uint32_t | sample_count_limit |
The number of samples to aggregate per recording entry. | |
static uint32_t | recording_flags |
General recording flags. (Unused by this code.) | |
static uint32_t | sample_frequency |
The frequency with which we sample the execution state of all cores. | |
The implementation of the Chip Power Monitor.
The purpose of this application is to monitor the activity of the other CPU cores on the chip on which it runs. It does this using the SpiNNaker System Controller, enabling it to run with just the overhead due to using a core; it does not change the individual performance of the other cores on the chip.
Definition in file chip_power_monitor.c.
struct sample_params |
Describes the format of the configuration region.
Definition at line 47 of file chip_power_monitor.c.
Data Fields | ||
---|---|---|
uint32_t | count_limit | The number of samples to aggregate per recording entry. |
uint32_t | frequency | The fundamental sampling frequency. |
struct recording |
Definition at line 54 of file chip_power_monitor.c.
Data Fields | ||
---|---|---|
uint32_t | time | |
uint32_t | core_counters[NUM_CPUS] |
#define NUM_RANDOM_BITS 12 |
The number of bits of randomness used to break up sampling periodicity errors.
Definition at line 37 of file chip_power_monitor.c.
The IDs of each DSG region used.
Enumerator | |
---|---|
SYSTEM | The system data region ID. |
CONFIG | The configuration region ID. |
RECORDING | The recorded data region ID. |
Definition at line 40 of file chip_power_monitor.c.
values for the priority for each callback
Enumerator | |
---|---|
TIMER | The timer callback is highest priority. |
SDP | Responding to communications from host is next highest. |
DMA | DMA processing is lowest priority. |
Definition at line 65 of file chip_power_monitor.c.
Read which cores on the chip are asleep right now.
Note that this accesses into the SpiNNaker System Controller hardware (see Data Sheet, section 14, register 25).
Definition at line 98 of file chip_power_monitor.c.
Computes a random value used to break up chance periodicities in sampling.
In range 0 to 4095.
Definition at line 106 of file chip_power_monitor.c.
Synchronously records the current contents of the core_counters to the recording region.
Definition at line 112 of file chip_power_monitor.c.
Resets the state of the core_counters and the sample_count variables to zero.
Definition at line 120 of file chip_power_monitor.c.
Change simulation ticks to be a number related to sampling frequency.
Definition at line 128 of file chip_power_monitor.c.
The function to call when resuming a simulation.
Definition at line 135 of file chip_power_monitor.c.
Accumulate a count of how active each core on the current chip is. The counter for the core is incremented if the core is active.
Uses get_sample() to obtain the state of the cores.
Definition at line 158 of file chip_power_monitor.c.
Called to actually record a sample.
unused0 | unused |
unused1 | unused |
Definition at line 171 of file chip_power_monitor.c.
|
static |
Reads the configuration of the application out of the configuration region.
[in] | sample_params | Pointer to the configuration region. |
Definition at line 212 of file chip_power_monitor.c.
Initialises the program.
Definition at line 222 of file chip_power_monitor.c.
The application entry point.
Initialises the application state, installs all required callbacks, and runs the "simulation" loop until told to terminate.
Definition at line 248 of file chip_power_monitor.c.
The recording channel we use.
Only one recording channel is used by this application.
Definition at line 62 of file chip_power_monitor.c.
|
static |
The main simulation tick.
Definition at line 72 of file chip_power_monitor.c.
|
static |
Whether we are running "forever".
Definition at line 74 of file chip_power_monitor.c.
|
static |
Our internal notion of time.
Definition at line 76 of file chip_power_monitor.c.
|
static |
The main simulation time period.
Definition at line 78 of file chip_power_monitor.c.
Where we aggregate the sample activity counts.
Definition at line 81 of file chip_power_monitor.c.
|
static |
How many samples have we done so far within this aggregate step?
Definition at line 83 of file chip_power_monitor.c.
|
static |
The number of samples to aggregate per recording entry.
Definition at line 85 of file chip_power_monitor.c.
|
static |
General recording flags. (Unused by this code.)
Definition at line 87 of file chip_power_monitor.c.
|
static |
The frequency with which we sample the execution state of all cores.
Definition at line 89 of file chip_power_monitor.c.