MCUXpresso SDK API Reference Manual  Rev 2.12.1
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SYSPM: System Performance Monitor

Overview

The System Performance Monitor (SYSPM) is a memory mapped peripheral that enables the user to monitor system and/or CPU events. The SYSPM consists of sixteen 256 Byte sub-slots (SS). The first subslot is the configuration slot. The registers in the configuration SS0 describe the number of monitors, types of monitors and number of counters per monitor. Subsequent subslots are occupied by an optional Programmable System Activity Monitor (PSAM), and Performance Monitors (PERFMON) registers.

Enumerations

enum  syspm_monitor_t {
  kSYSPM_Monitor0 = 0U,
  kSYSPM_Monitor1 = 1U
}
 syspm select control monitor More...
 
enum  syspm_event_t {
  kSYSPM_Event1 = 0U,
  kSYSPM_Event2 = 1U,
  kSYSPM_Event3 = 2U
}
 syspm select event More...
 
enum  syspm_mode_t {
  kSYSPM_BothMode = 0x00,
  kSYSPM_UserMode = 0x02,
  kSYSPM_PrivilegedMode = 0x03
}
 syspm set count mode More...
 
enum  syspm_startstop_control_t {
  kSYSPM_Idle = 0x00,
  kSYSPM_LocalStop = 0x01,
  kSYSPM_LocalStart = 0x02,
  KSYSPM_EnableTraceControl = 0x04,
  kSYSPM_GlobalStart = 0x05,
  kSYSPM_GlobalStop = 0x06
}
 syspm start/stop control More...
 

Functions

void SYSPM_Init (SYSPM_Type *base)
 Initializes the SYSPM. More...
 
void SYSPM_Deinit (SYSPM_Type *base)
 Deinitializes the SYSPM. More...
 
void SYSPM_SelectEvent (SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event, uint8_t eventCode)
 Select event counters. More...
 
void SYSPM_ResetEvent (SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event)
 Reset event counters. More...
 
void SYSPM_ResetInstructionEvent (SYSPM_Type *base, syspm_monitor_t monitor)
 Reset Instruction Counter. More...
 
void SYSPM_SetCountMode (SYSPM_Type *base, syspm_monitor_t monitor, syspm_mode_t mode)
 Set count mode. More...
 
void SYSPM_SetStartStopControl (SYSPM_Type *base, syspm_monitor_t monitor, syspm_startstop_control_t ssc)
 Set Start/Stop Control. More...
 
void SYSPM_DisableCounter (SYSPM_Type *base, syspm_monitor_t monitor)
 Disable Counters if Stopped or Halted. More...
 
uint64_t SYSPM_GetEventCounter (SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event)
 This is the the 40-bits of eventx counter. More...
 

Driver version

#define FSL_SYSPM_DRIVER_VERSION   (MAKE_VERSION(2, 1, 0))
 SYSPM driver version.
 

Enumeration Type Documentation

Enumerator
kSYSPM_Monitor0 

Monitor 0.

kSYSPM_Monitor1 

Monitor 1.

Enumerator
kSYSPM_Event1 

Event 1.

kSYSPM_Event2 

Event 2.

kSYSPM_Event3 

Event 3.

Enumerator
kSYSPM_BothMode 

count in both modes

kSYSPM_UserMode 

count only in user mode

kSYSPM_PrivilegedMode 

count only in privileged mode

Enumerator
kSYSPM_Idle 

idle >

kSYSPM_LocalStop 

local stop

kSYSPM_LocalStart 

local start

KSYSPM_EnableTraceControl 

enable global TSTART/TSTOP

kSYSPM_GlobalStart 

global stop

kSYSPM_GlobalStop 

global start

Function Documentation

void SYSPM_Init ( SYSPM_Type *  base)

This function enables the SYSPM clock.

Parameters
baseSYSPM peripheral base address.
void SYSPM_Deinit ( SYSPM_Type *  base)

This function disables the SYSPM clock.

Parameters
baseSYSPM peripheral base address.
void SYSPM_SelectEvent ( SYSPM_Type *  base,
syspm_monitor_t  monitor,
syspm_event_t  event,
uint8_t  eventCode 
)
Parameters
baseSYSPM peripheral base address.
eventsyspm select event, see to syspm_event_t.
eventCodeselect which event to be counted in PMECTRx., see to table Events.
void SYSPM_ResetEvent ( SYSPM_Type *  base,
syspm_monitor_t  monitor,
syspm_event_t  event 
)
Parameters
baseSYSPM peripheral base address.
monitorsyspm control monitor, see to syspm_monitor_t.
void SYSPM_ResetInstructionEvent ( SYSPM_Type *  base,
syspm_monitor_t  monitor 
)
Parameters
baseSYSPM peripheral base address.
monitorsyspm control monitor, see to syspm_monitor_t.
void SYSPM_SetCountMode ( SYSPM_Type *  base,
syspm_monitor_t  monitor,
syspm_mode_t  mode 
)
Parameters
baseSYSPM peripheral base address.
monitorsyspm control monitor, see to syspm_monitor_t.
modesyspm select counter mode, see to syspm_mode_t.
void SYSPM_SetStartStopControl ( SYSPM_Type *  base,
syspm_monitor_t  monitor,
syspm_startstop_control_t  ssc 
)
Parameters
baseSYSPM peripheral base address.
monitorsyspm control monitor, see to syspm_monitor_t.
sscThis 3-bit field provides a three-phase mechanism to start/stop the counters. It includes a prioritized scheme with local start > local stop > global start > global stop > conditional TSTART > TSTOP. The global and conditional start/stop affect all configured PM/PSAM module concurrently so counters are "coherent". see to syspm_startstop_control_t
void SYSPM_DisableCounter ( SYSPM_Type *  base,
syspm_monitor_t  monitor 
)
Parameters
baseSYSPM peripheral base address.
monitorsyspm control monitor, see to syspm_monitor_t.
uint64_t SYSPM_GetEventCounter ( SYSPM_Type *  base,
syspm_monitor_t  monitor,
syspm_event_t  event 
)
  The value in this register increments each time the event
  selected in PMCRx[SELEVTx] occurs.
Parameters
baseSYSPM peripheral base address.
monitorsyspm control monitor, see to syspm_monitor_t.
eventsyspm select event, see to syspm_event_t.
Returns
get the the 40 bits of eventx counter.