HPM SDK
HPMicro Software Development Kit
CSR driver APIs

CSR driver APIs. More...

Functions

static void hpm_csr_enable_access_to_csr_cycle (void)
 Enable access to CSR_CYCLE and CSR_MCYCLEH. More...
 
static void hpm_csr_disable_access_to_csr_cycle (void)
 Disable access to CSR_CYCLE and CSR_MCYCLEH. More...
 
static uint64_t hpm_csr_get_core_cycle (void)
 Get the core cycle value. More...
 
static uint64_t hpm_csr_get_core_mcycle (void)
 Get the core mcycle value. More...
 

Detailed Description

CSR driver APIs.

Function Documentation

◆ hpm_csr_disable_access_to_csr_cycle()

static void hpm_csr_disable_access_to_csr_cycle ( void  )
inlinestatic

#include <drivers/inc/hpm_csr_drv.h>

Disable access to CSR_CYCLE and CSR_MCYCLEH.

Note
This Function can be called in Machine mode only

◆ hpm_csr_enable_access_to_csr_cycle()

static void hpm_csr_enable_access_to_csr_cycle ( void  )
inlinestatic

#include <drivers/inc/hpm_csr_drv.h>

Enable access to CSR_CYCLE and CSR_MCYCLEH.

Note
This Function can be called in Machine mode only

◆ hpm_csr_get_core_cycle()

static uint64_t hpm_csr_get_core_cycle ( void  )
inlinestatic

#include <drivers/inc/hpm_csr_drv.h>

Get the core cycle value.

Note
The CY bit in MCOUNTEREN must be enabled before using this API whendevice is :
  • in supervisor mode if the device supports M/S/U mode, or
  • in user mode if the device supports M/U mode
Returns
CSR cycle value in 64-bit

◆ hpm_csr_get_core_mcycle()

static uint64_t hpm_csr_get_core_mcycle ( void  )
inlinestatic

#include <drivers/inc/hpm_csr_drv.h>

Get the core mcycle value.

Note
This function can be called in machine mode only
Returns
CSR mcycle value in 64-bit