Skip to content

File ns_pmu_utils.c

FileList > apollo5 > ns_pmu_utils.c

Go to the source code of this file

A collection of functions to collect and analyze performance data. More...

  • #include "ns_core.h"
  • #include "ns_pmu_map.h"
  • #include "ns_pmu_utils.h"
  • #include <string.h>

Public Attributes

Type Name
uint32_t g_ns_pmu_map_length
const ns_core_api_t ns_pmu_V0_0_1 = {.apiId = NS\_PMU\_API\_ID, .version = NS\_PMU\_V0\_0\_1}
const ns_core_api_t ns_pmu_V1_0_0 = {.apiId = NS\_PMU\_API\_ID, .version = NS\_PMU\_V1\_0\_0}
const ns_core_api_t ns_pmu_current_version = /* multi line expression */
const ns_pmu_map_t ns_pmu_map
const ns_core_api_t ns_pmu_oldest_supported_version = /* multi line expression */

Public Static Attributes

Type Name
am_util_pmu_config_t ns_am_pmu_config
uint32_t ns_pmu_config_index
bool ns_pmu_initialized = false
bool ns_pmu_profiling = false

Public Functions

Type Name
void ns_delta_pmu (ns_pmu_counters_t * s, ns_pmu_counters_t * e, ns_pmu_counters_t * d)
void ns_pmu_characterize_function (invoke_fp func, ns_pmu_config_t * cfg)
void ns_pmu_event_create (ns_pmu_event_t * event, uint32_t eventId, ns_pmu_event_counter_size_e counterSize)
uint32_t ns_pmu_get_counters (ns_pmu_config_t * cfg)
Get PMU counter values.
int ns_pmu_get_map_index (uint32_t eventId)
uint32_t ns_pmu_get_map_length ()
void ns_pmu_get_name (ns_pmu_config_t * cfg, uint32_t i, char * name)
uint32_t ns_pmu_init (ns_pmu_config_t * cfg)
Initialize and start the PMU profiling syste.
uint32_t ns_pmu_print_counters (ns_pmu_config_t * cfg)
void ns_pmu_reset_config (ns_pmu_config_t * cfg)
void ns_pmu_reset_counters ()

Public Static Functions

Type Name
uint32_t cntr_disable (uint32_t ui32CountersDisable)
uint32_t cntr_enable (uint32_t ui32CountersEnable)

Detailed Description

Author:

Ambiq

Version:

0.1

Date:

2024-08-15

Copyright:

Copyright (c) 2024

Public Attributes Documentation

variable g_ns_pmu_map_length

uint32_t g_ns_pmu_map_length;

variable ns_pmu_V0_0_1

const ns_core_api_t ns_pmu_V0_0_1;

variable ns_pmu_V1_0_0

const ns_core_api_t ns_pmu_V1_0_0;

variable ns_pmu_current_version

const ns_core_api_t ns_pmu_current_version;

variable ns_pmu_map

const ns_pmu_map_t ns_pmu_map[];

variable ns_pmu_oldest_supported_version

const ns_core_api_t ns_pmu_oldest_supported_version;

Public Static Attributes Documentation

variable ns_am_pmu_config

am_util_pmu_config_t ns_am_pmu_config;

variable ns_pmu_config_index

uint32_t ns_pmu_config_index[8];

variable ns_pmu_initialized

bool ns_pmu_initialized;

variable ns_pmu_profiling

bool ns_pmu_profiling;

Public Functions Documentation

function ns_delta_pmu

void ns_delta_pmu (
    ns_pmu_counters_t * s,
    ns_pmu_counters_t * e,
    ns_pmu_counters_t * d
) 

function ns_pmu_characterize_function

void ns_pmu_characterize_function (
    invoke_fp func,
    ns_pmu_config_t * cfg
) 

function ns_pmu_event_create

void ns_pmu_event_create (
    ns_pmu_event_t * event,
    uint32_t eventId,
    ns_pmu_event_counter_size_e counterSize
) 

function ns_pmu_get_counters

Get PMU counter values.

uint32_t ns_pmu_get_counters (
    ns_pmu_config_t * cfg
) 


function ns_pmu_get_map_index

int ns_pmu_get_map_index (
    uint32_t eventId
) 

function ns_pmu_get_map_length

uint32_t ns_pmu_get_map_length () 

function ns_pmu_get_name

void ns_pmu_get_name (
    ns_pmu_config_t * cfg,
    uint32_t i,
    char * name
) 

function ns_pmu_init

Initialize and start the PMU profiling syste.

uint32_t ns_pmu_init (
    ns_pmu_config_t * cfg
) 

Parameters:

  • cfg

Returns:

uint32_t status


function ns_pmu_print_counters

uint32_t ns_pmu_print_counters (
    ns_pmu_config_t * cfg
) 

function ns_pmu_reset_config

void ns_pmu_reset_config (
    ns_pmu_config_t * cfg
) 

function ns_pmu_reset_counters

void ns_pmu_reset_counters () 

Public Static Functions Documentation

function cntr_disable

static uint32_t cntr_disable (
    uint32_t ui32CountersDisable
) 

function cntr_enable

static uint32_t cntr_enable (
    uint32_t ui32CountersEnable
) 


The documentation for this class was generated from the following file neuralSPOT/neuralspot/ns-utils/src/apollo5/ns_pmu_utils.c