/** \defgroup pmu8_functions PMU Functions for Armv8.1-M \brief Functions that relate to the Performance Monitoring Unit. \details The following functions support the Performance Monitoring Unit (PMU) that is available on the Cortex-M55 processor. The PMU is used to monitor events that occur during run-time of an application. Example: \code //todo \endcode @{ */ #define ARM_PMU_SW_INCR 0x0000 /*!< \brief Software update to the PMU_SWINC register, architecturally executed and condition code check pass */ #define ARM_PMU_L1I_CACHE_REFILL 0x0001 /*!< \brief L1 I-Cache refill */ #define ARM_PMU_L1D_CACHE_REFILL 0x0003 /*!< \brief L1 D-Cache refill */ #define ARM_PMU_L1D_CACHE 0x0004 /*!< \brief L1 D-Cache access */ #define ARM_PMU_LD_RETIRED 0x0006 /*!< \brief Memory-reading instruction architecturally executed and condition code check pass */ #define ARM_PMU_ST_RETIRED 0x0007 /*!< \brief Memory-writing instruction architecturally executed and condition code check pass */ #define ARM_PMU_INST_RETIRED 0x0008 /*!< \brief Instruction architecturally executed */ #define ARM_PMU_EXC_TAKEN 0x0009 /*!< \brief Exception entry */ #define ARM_PMU_EXC_RETURN 0x000A /*!< \brief Exception return instruction architecturally executed and the condition code check pass */ #define ARM_PMU_PC_WRITE_RETIRED 0x000C /*!< \brief Software change to the Program Counter (PC). Instruction is architecturally executed and condition code check pass */ #define ARM_PMU_BR_IMMED_RETIRED 0x000D /*!< \brief Immediate branch architecturally executed */ #define ARM_PMU_BR_RETURN_RETIRED 0x000E /*!< \brief Function return instruction architecturally executed and the condition code check pass */ #define ARM_PMU_UNALIGNED_LDST_RETIRED 0x000F /*!< \brief Unaligned memory memory-reading or memory-writing instruction architecturally executed and condition code check pass */ #define ARM_PMU_BR_MIS_PRED 0x0010 /*!< \brief Mispredicted or not predicted branch speculatively executed */ #define ARM_PMU_CPU_CYCLES 0x0011 /*!< \brief Cycle */ #define ARM_PMU_BR_PRED 0x0012 /*!< \brief Predictable branch speculatively executed */ #define ARM_PMU_MEM_ACCESS 0x0013 /*!< \brief Data memory access */ #define ARM_PMU_L1I_CACHE 0x0014 /*!< \brief Level 1 instruction cache access */ #define ARM_PMU_L1D_CACHE_WB 0x0015 /*!< \brief Level 1 data cache write-back */ #define ARM_PMU_L2D_CACHE 0x0016 /*!< \brief Level 2 data cache access */ #define ARM_PMU_L2D_CACHE_REFILL 0x0017 /*!< \brief Level 2 data cache refill */ #define ARM_PMU_L2D_CACHE_WB 0x0018 /*!< \brief Level 2 data cache write-back */ #define ARM_PMU_BUS_ACCESS 0x0019 /*!< \brief Bus access */ #define ARM_PMU_MEMORY_ERROR 0x001A /*!< \brief Local memory error */ #define ARM_PMU_INST_SPEC 0x001B /*!< \brief Instruction speculatively executed */ #define ARM_PMU_BUS_CYCLES 0x001D /*!< \brief Bus cycles */ #define ARM_PMU_CHAIN 0x001E /*!< \brief For an odd numbered counter, increment when an overflow occurs on the preceding even-numbered counter on the same PE */ #define ARM_PMU_L1D_CACHE_ALLOCATE 0x001F /*!< \brief Level 1 data cache allocation without refill */ #define ARM_PMU_L2D_CACHE_ALLOCATE 0x0020 /*!< \brief Level 2 data cache allocation without refill */ #define ARM_PMU_BR_RETIRED 0x0021 /*!< \brief Branch instruction architecturally executed */ #define ARM_PMU_BR_MIS_PRED_RETIRED 0x0022 /*!< \brief Mispredicted branch instruction architecturally executed */ #define ARM_PMU_STALL_FRONTEND 0x0023 /*!< \brief No operation issued because of the frontend */ #define ARM_PMU_STALL_BACKEND 0x0024 /*!< \brief No operation issued because of the backend */ #define ARM_PMU_L2I_CACHE 0x0027 /*!< \brief Level 2 instruction cache access */ #define ARM_PMU_L2I_CACHE_REFILL 0x0028 /*!< \brief Level 2 instruction cache refill */ #define ARM_PMU_L3D_CACHE_ALLOCATE 0x0029 /*!< \brief Level 3 data cache allocation without refill */ #define ARM_PMU_L3D_CACHE_REFILL 0x002A /*!< \brief Level 3 data cache refill */ #define ARM_PMU_L3D_CACHE 0x002B /*!< \brief Level 3 data cache access */ #define ARM_PMU_L3D_CACHE_WB 0x002C /*!< \brief Level 3 data cache write-back */ #define ARM_PMU_LL_CACHE_RD 0x0036 /*!< \brief Last level data cache read */ #define ARM_PMU_LL_CACHE_MISS_RD 0x0037 /*!< \brief Last level data cache read miss */ #define ARM_PMU_L1D_CACHE_MISS_RD 0x0039 /*!< \brief Level 1 data cache read miss */ #define ARM_PMU_OP_COMPLETE 0x003A /*!< \brief Operation retired */ #define ARM_PMU_OP_SPEC 0x003B /*!< \brief Operation speculatively executed */ #define ARM_PMU_STALL 0x003C /*!< \brief Stall cycle for instruction or operation not sent for execution */ #define ARM_PMU_STALL_OP_BACKEND 0x003D /*!< \brief Stall cycle for instruction or operation not sent for execution due to pipeline backend */ #define ARM_PMU_STALL_OP_FRONTEND 0x003E /*!< \brief Stall cycle for instruction or operation not sent for execution due to pipeline frontend */ #define ARM_PMU_STALL_OP 0x003F /*!< \brief Instruction or operation slots not occupied each cycle */ #define ARM_PMU_L1D_CACHE_RD 0x0040 /*!< \brief Level 1 data cache read */ #define ARM_PMU_LE_RETIRED 0x0100 /*!< \brief Loop end instruction executed */ #define ARM_PMU_LE_SPEC 0x0101 /*!< \brief Loop end instruction speculatively executed */ #define ARM_PMU_BF_RETIRED 0x0104 /*!< \brief Branch future instruction architecturally executed and condition code check pass */ #define ARM_PMU_BF_SPEC 0x0105 /*!< \brief Branch future instruction speculatively executed and condition code check pass */ #define ARM_PMU_LE_CANCEL 0x0108 /*!< \brief Loop end instruction not taken */ #define ARM_PMU_BF_CANCEL 0x0109 /*!< \brief Branch future instruction not taken */ #define ARM_PMU_SE_CALL_S 0x0114 /*!< \brief Call to secure function, resulting in Security state change */ #define ARM_PMU_SE_CALL_NS 0x0115 /*!< \brief Call to non-secure function, resulting in Security state change */ #define ARM_PMU_DWT_CMPMATCH0 0x0118 /*!< \brief DWT comparator 0 match */ #define ARM_PMU_DWT_CMPMATCH1 0x0119 /*!< \brief DWT comparator 1 match */ #define ARM_PMU_DWT_CMPMATCH2 0x011A /*!< \brief DWT comparator 2 match */ #define ARM_PMU_DWT_CMPMATCH3 0x011B /*!< \brief DWT comparator 3 match */ #define ARM_PMU_MVE_INST_RETIRED 0x0200 /*!< \brief MVE instruction architecturally executed */ #define ARM_PMU_MVE_INST_SPEC 0x0201 /*!< \brief MVE instruction speculatively executed */ #define ARM_PMU_MVE_FP_RETIRED 0x0204 /*!< \brief MVE floating-point instruction architecturally executed */ #define ARM_PMU_MVE_FP_SPEC 0x0205 /*!< \brief MVE floating-point instruction speculatively executed */ #define ARM_PMU_MVE_FP_HP_RETIRED 0x0208 /*!< \brief MVE half-precision floating-point instruction architecturally executed */ #define ARM_PMU_MVE_FP_HP_SPEC 0x0209 /*!< \brief MVE half-precision floating-point instruction speculatively executed */ #define ARM_PMU_MVE_FP_SP_RETIRED 0x020C /*!< \brief MVE single-precision floating-point instruction architecturally executed */ #define ARM_PMU_MVE_FP_SP_SPEC 0x020D /*!< \brief MVE single-precision floating-point instruction speculatively executed */ #define ARM_PMU_MVE_FP_MAC_RETIRED 0x0214 /*!< \brief MVE floating-point multiply or multiply-accumulate instruction architecturally executed */ #define ARM_PMU_MVE_FP_MAC_SPEC 0x0215 /*!< \brief MVE floating-point multiply or multiply-accumulate instruction speculatively executed */ #define ARM_PMU_MVE_INT_RETIRED 0x0224 /*!< \brief MVE integer instruction architecturally executed */ #define ARM_PMU_MVE_INT_SPEC 0x0225 /*!< \brief MVE integer instruction speculatively executed */ #define ARM_PMU_MVE_INT_MAC_RETIRED 0x0228 /*!< \brief MVE multiply or multiply-accumulate instruction architecturally executed */ #define ARM_PMU_MVE_INT_MAC_SPEC 0x0229 /*!< \brief MVE multiply or multiply-accumulate instruction speculatively executed */ #define ARM_PMU_MVE_LDST_RETIRED 0x0238 /*!< \brief MVE load or store instruction architecturally executed */ #define ARM_PMU_MVE_LDST_SPEC 0x0239 /*!< \brief MVE load or store instruction speculatively executed */ #define ARM_PMU_MVE_LD_RETIRED 0x023C /*!< \brief MVE load instruction architecturally executed */ #define ARM_PMU_MVE_LD_SPEC 0x023D /*!< \brief MVE load instruction speculatively executed */ #define ARM_PMU_MVE_ST_RETIRED 0x0240 /*!< \brief MVE store instruction architecturally executed */ #define ARM_PMU_MVE_ST_SPEC 0x0241 /*!< \brief MVE store instruction speculatively executed */ #define ARM_PMU_MVE_LDST_CONTIG_RETIRED 0x0244 /*!< \brief MVE contiguous load or store instruction architecturally executed */ #define ARM_PMU_MVE_LDST_CONTIG_SPEC 0x0245 /*!< \brief MVE contiguous load or store instruction speculatively executed */ #define ARM_PMU_MVE_LD_CONTIG_RETIRED 0x0248 /*!< \brief MVE contiguous load instruction architecturally executed */ #define ARM_PMU_MVE_LD_CONTIG_SPEC 0x0249 /*!< \brief MVE contiguous load instruction speculatively executed */ #define ARM_PMU_MVE_ST_CONTIG_RETIRED 0x024C /*!< \brief MVE contiguous store instruction architecturally executed */ #define ARM_PMU_MVE_ST_CONTIG_SPEC 0x024D /*!< \brief MVE contiguous store instruction speculatively executed */ #define ARM_PMU_MVE_LDST_NONCONTIG_RETIRED 0x0250 /*!< \brief MVE non-contiguous load or store instruction architecturally executed */ #define ARM_PMU_MVE_LDST_NONCONTIG_SPEC 0x0251 /*!< \brief MVE non-contiguous load or store instruction speculatively executed */ #define ARM_PMU_MVE_LD_NONCONTIG_RETIRED 0x0254 /*!< \brief MVE non-contiguous load instruction architecturally executed */ #define ARM_PMU_MVE_LD_NONCONTIG_SPEC 0x0255 /*!< \brief MVE non-contiguous load instruction speculatively executed */ #define ARM_PMU_MVE_ST_NONCONTIG_RETIRED 0x0258 /*!< \brief MVE non-contiguous store instruction architecturally executed */ #define ARM_PMU_MVE_ST_NONCONTIG_SPEC 0x0259 /*!< \brief MVE non-contiguous store instruction speculatively executed */ #define ARM_PMU_MVE_LDST_MULTI_RETIRED 0x025C /*!< \brief MVE memory instruction targeting multiple registers architecturally executed */ #define ARM_PMU_MVE_LDST_MULTI_SPEC 0x025D /*!< \brief MVE memory instruction targeting multiple registers speculatively executed */ #define ARM_PMU_MVE_LD_MULTI_RETIRED 0x0260 /*!< \brief MVE memory load instruction targeting multiple registers architecturally executed */ #define ARM_PMU_MVE_LD_MULTI_SPEC 0x0261 /*!< \brief MVE memory load instruction targeting multiple registers speculatively executed */ #define ARM_PMU_MVE_ST_MULTI_RETIRED 0x0261 /*!< \brief MVE memory store instruction targeting multiple registers architecturally executed */ #define ARM_PMU_MVE_ST_MULTI_SPEC 0x0265 /*!< \brief MVE memory store instruction targeting multiple registers speculatively executed */ #define ARM_PMU_MVE_LDST_UNALIGNED_RETIRED 0x028C /*!< \brief MVE unaligned memory load or store instruction architecturally executed */ #define ARM_PMU_MVE_LDST_UNALIGNED_SPEC 0x028D /*!< \brief MVE unaligned memory load or store instruction speculatively executed */ #define ARM_PMU_MVE_LD_UNALIGNED_RETIRED 0x0290 /*!< \brief MVE unaligned load instruction architecturally executed */ #define ARM_PMU_MVE_LD_UNALIGNED_SPEC 0x0291 /*!< \brief MVE unaligned load instruction speculatively executed */ #define ARM_PMU_MVE_ST_UNALIGNED_RETIRED 0x0294 /*!< \brief MVE unaligned store instruction architecturally executed */ #define ARM_PMU_MVE_ST_UNALIGNED_SPEC 0x0295 /*!< \brief MVE unaligned store instruction speculatively executed */ #define ARM_PMU_MVE_LDST_UNALIGNED_NONCONTIG_RETIRED 0x0298 /*!< \brief MVE unaligned noncontiguous load or store instruction architecturally executed */ #define ARM_PMU_MVE_LDST_UNALIGNED_NONCONTIG_SPEC 0x0299 /*!< \brief MVE unaligned noncontiguous load or store instruction speculatively executed */ #define ARM_PMU_MVE_VREDUCE_RETIRED 0x02A0 /*!< \brief MVE vector reduction instruction architecturally executed */ #define ARM_PMU_MVE_VREDUCE_SPEC 0x02A1 /*!< \brief MVE vector reduction instruction speculatively executed */ #define ARM_PMU_MVE_VREDUCE_FP_RETIRED 0x02A4 /*!< \brief MVE floating-point vector reduction instruction architecturally executed */ #define ARM_PMU_MVE_VREDUCE_FP_SPEC 0x02A5 /*!< \brief MVE floating-point vector reduction instruction speculatively executed */ #define ARM_PMU_MVE_VREDUCE_INT_RETIRED 0x02A8 /*!< \brief MVE integer vector reduction instruction architecturally executed */ #define ARM_PMU_MVE_VREDUCE_INT_SPEC 0x02A9 /*!< \brief MVE integer vector reduction instruction speculatively executed */ #define ARM_PMU_MVE_PRED 0x02B8 /*!< \brief Cycles where one or more predicated beats architecturally executed */ #define ARM_PMU_MVE_STALL 0x02CC /*!< \brief Stall cycles caused by an MVE instruction */ #define ARM_PMU_MVE_STALL_RESOURCE 0x02CD /*!< \brief Stall cycles caused by an MVE instruction because of resource conflicts */ #define ARM_PMU_MVE_STALL_RESOURCE_MEM 0x02CE /*!< \brief Stall cycles caused by an MVE instruction because of memory resource conflicts */ #define ARM_PMU_MVE_STALL_RESOURCE_FP 0x02CF /*!< \brief Stall cycles caused by an MVE instruction because of floating-point resource conflicts */ #define ARM_PMU_MVE_STALL_RESOURCE_INT 0x02D0 /*!< \brief Stall cycles caused by an MVE instruction because of integer resource conflicts */ #define ARM_PMU_MVE_STALL_BREAK 0x02D3 /*!< \brief Stall cycles caused by an MVE chain break */ #define ARM_PMU_MVE_STALL_DEPENDENCY 0x02D4 /*!< \brief Stall cycles caused by MVE register dependency */ #define ARM_PMU_ITCM_ACCESS 0x4007 /*!< \brief Instruction TCM access */ #define ARM_PMU_DTCM_ACCESS 0x4008 /*!< \brief Data TCM access */ #define ARM_PMU_TRCEXTOUT0 0x4010 /*!< \brief ETM external output 0 */ #define ARM_PMU_TRCEXTOUT1 0x4011 /*!< \brief ETM external output 1 */ #define ARM_PMU_TRCEXTOUT2 0x4012 /*!< \brief ETM external output 2 */ #define ARM_PMU_TRCEXTOUT3 0x4013 /*!< \brief ETM external output 3 */ #define ARM_PMU_CTI_TRIGOUT4 0x4018 /*!< \brief Cross-trigger Interface output trigger 4 */ #define ARM_PMU_CTI_TRIGOUT5 0x4019 /*!< \brief Cross-trigger Interface output trigger 5 */ #define ARM_PMU_CTI_TRIGOUT6 0x401A /*!< \brief Cross-trigger Interface output trigger 6 */ #define ARM_PMU_CTI_TRIGOUT7 0x401B /*!< \brief Cross-trigger Interface output trigger 7 */ /** \brief Enable the PMU */ __STATIC_INLINE void ARM_PMU_Enable(void); /** \brief Disable the PMU */ __STATIC_INLINE void ARM_PMU_Disable(void); /** \brief Set event to count for PMU event counter \param [in] num Event counter (0-30) to configure \param [in] type Event to count */ __STATIC_INLINE void ARM_PMU_Set_EVTYPER(uint32_t num, uint32_t type); /** \brief Reset cycle counter */ __STATIC_INLINE void ARM_PMU_CYCCNT_Reset(void); /** \brief Reset all event counters */ __STATIC_INLINE void ARM_PMU_EVCNTR_ALL_Reset(void); /** \brief Enable counters \param [in] mask Counters to enable \note Enables one or more of the following: - event counters (0-30) - cycle counter */ __STATIC_INLINE void ARM_PMU_CNTR_Enable(uint32_t mask); /** \brief Disable counters \param [in] mask Counters to enable \note Disables one or more of the following: - event counters (0-30) - cycle counter */ __STATIC_INLINE void ARM_PMU_CNTR_Disable(uint32_t mask); /** \brief Read cycle counter \return Cycle count */ __STATIC_INLINE uint32_t ARM_PMU_Get_CCNTR(void); /** \brief Read event counter \param [in] num Event counter (0-30) to read \return Event count */ __STATIC_INLINE uint32_t ARM_PMU_Get_EVCNTR(uint32_t num); /** \brief Read counter overflow status \return Counter overflow status bits for the following: - event counters (0-30) - cycle counter */ __STATIC_INLINE uint32_t ARM_PMU_Get_CNTR_OVS(void); /** \brief Clear counter overflow status \param [in] mask Counter overflow status bits to clear \note Clears overflow status bits for one or more of the following: - event counters (0-30) - cycle counter */ __STATIC_INLINE void ARM_PMU_Set_CNTR_OVS(uint32_t mask); /** \brief Enable counter overflow interrupt request \param [in] mask Counter overflow interrupt request bits to set \note Sets overflow interrupt request bits for one or more of the following: - event counters (0-30) - cycle counter */ __STATIC_INLINE void ARM_PMU_Set_CNTR_IRQ_Enable(uint32_t mask); /** \brief Disable counter overflow interrupt request \param [in] mask Counter overflow interrupt request bits to clear \note Clears overflow interrupt request bits for one or more of the following: - event counters (0-30) - cycle counter */ __STATIC_INLINE void ARM_PMU_Set_CNTR_IRQ_Disable(uint32_t mask); /** \brief Software increment event counter \param [in] mask Counters to increment \note Software increment bits for one or more event counters (0-30) */ __STATIC_INLINE void ARM_PMU_CNTR_Increment(uint32_t mask); /** @} */