armv8 aarch64 PMU寄存器介绍

2021-11-03  本文已影响0人  陈子晞CZX

1. PMCCFILTR_EL0, Performance Monitors Cycle Count Filter Register

作用
    决定循环计数器PMCCNTR_EL0的增长模式
位图

image.png

读MRS/写MSR

op0 op1 CRn CRm op2
0b11 0b011 0b1110 0b1111 0b111

2. PMCCNTR_EL0, Performance Monitors Cycle Count Register

作用
    统计进程的时钟周期
    只有实现了FEAT_PMUv3,此计数器才存在。并且PMCCNTR的计数还会受到时钟频率的改变的影响,例如时钟被WFI和WFE指令暂停了。
位图

image.png

读写

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1101 0b000

3. PMCEID0_EL0, Performance Monitors Common Event Identification register 0

作用
    表明哪些通用架构事件和通用微架构事件被实现/计数,PMU事件编号从0x0000到0x001F和0x4000到0x401F
位图

image.png

只读

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1100 0b110

4. PMCEID1_EL0, Performance Monitors Common Event Identification register 1

作用
    表明哪些通用架构事件和通用微架构事件被实现/计数,PMU事件编号从0x0020到0x003F和0x4020到0x403F
位图

image.png

只读

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1100 0b111

5. PMCNTENCLR_EL0, Performance Monitors Count Enable Clear register

作用
    可以使计数器去使能。直接读的话表明哪些计数器使能了。
位图

image.png

读写

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1100 0b010

6. PMCNTENSET_EL0, Performance Monitors Count Enable Set register

作用
    使能计数器。直接读的话表明哪些计数器使能了。
位图

image.png

读写

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1100 0b001

7. PMCR_EL0, Performance Monitors Control Register

作用
    描述了性能监控的实现细节,包括实现的计数器的数量、用来配置和控制计数器等。
位图

image.png

读写

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1100 0b000

8. PMEVCNTR<n>_EL0, Performance Monitors Event Count Registers, n = 0 - 30

作用
    用来事件计数的计数器,n从0到30
位图

image.png

访问
    可以直接访问计数器n,也可以将PMSELR_EL0.SEL置为n,然后通过PMXEVCNTR_EL0间接访问。
    如果访问的时候用的n的值大于实现的计数器的数量的话,此行为将会是未定义的行为。
    EL0想要访问的话,取决于PMUSERENR_EL0.{ER,EN}
读写

op0 op1 CRn CRm op2
0b11 0b011 0b1110 0b10:n[4:3] n[2:0]

这里假设要访问的是编号为7的计数器,对应的五位二进制是00111,所以上诉的n[4:3]就是00,n[2:0]就是111

9. PMEVTYPER<n>_EL0, Performance Monitors Event Type Registers, n = 0 - 30

作用
    事件类型寄存器n用来配置对应的计数器n。功能类似于PMCCFILTR_EL0对PMCCNTR的控制一样。
位图

image.png

访问
    可以直接访问计数器n,也可以将PMSELR_EL0.SEL置为n,然后通过PMXEVTYPER_EL0间接访问。
    如果访问的时候用的n的值大于实现的计数器的数量的话,此行为将会是未定义的行为。
    EL0想要访问的话,取决于PMUSERENR_EL0.{ER,EN}。
读写

op0 op1 CRn CRm op2
0b11 0b011 0b1110 0b11:n[4:3] n[2:0]

10. PMINTENCLR_EL1, Performance Monitors Interrupt Enable Clear register

作用
    禁用计数器的溢出中断请求功能
位图

image.png

读写

op0 op1 CRn CRm op2
0b11 0b000 0b1001 0b1110 0b010

11. PMINTENSET_EL1, Performance Monitors Interrupt Enable Set register

作用
    使能计数器的溢出中断请求功能
位图

image.png

读写

op0 op1 CRn CRm op2
0b11 0b000 0b1001 0b1110 0b001

12. PMMIR_EL1, Performance Monitors Machine Identification Register

作用
    描述特定于软件实现的性能监视器参数。
    仅当实现FEAT_PMUv3p4时,此寄存器才存在。否则,对PMMI_EL1的直接访问是未定义的。
位图

image.png

读写

op0 op1 CRn CRm op2
0b11 0b000 0b1001 0b1110 0b110

13. PMOVSCLR_EL0, Performance Monitors Overflow Flag Status Clear Register

作用
    保存有计数器溢出的状态标识。写此寄存器可以重置溢出状态。
位图

image.png

读写

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1100 0b011

14. PMOVSSET_EL0, Performance Monitors Overflow Flag Status Set register

作用
    当对应计数器溢出时,设置对应的位,表明溢出
位图

image.png

读写

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1110 0b011

15. PMSELR_EL0, Performance Monitors Event Counter Selection Register

作用
    用来选择对应编号的计数器。
    可以和PMXEVCNTR_EL0一起配合使用,来决定选择的计数器的值。
    也可以和PMXEVTYPER_EL0一起配合使用,来决定选择的计数器的计数事件,计数模式等。
位图

image.png

读写

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1100 0b101

16. PMSWINC_EL0, Performance Monitors Software Increment register

作用
    当某个PMEVCNTR<n>_EL0计数器被配置用来作为计算软件自增事件(事件编号0x00)的计数器时,将它的计数增加一。
位图

image.png

只写

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1100 0b100

17. PMUSERENR_EL0, Performance Monitors User Enable Register

作用
    决定EL0是否可以访问性能监视器
位图

image.png

读写

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1110 0b000

18. PMXEVCNTR_EL0, Performance Monitors Selected Event Count Register

作用
    读或者写某个计数器,计数器是由PMSELR_EL0.SEL的值决定的
位图
    如果实现了FEAT_PMUv3p5

image.png
    否则为
image.png

读写

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1101 0b010

19. PMXEVTYPER_EL0, Performance Monitors Selected Event Type Register

作用
    读或者写PMEVTYPER<n>_EL0或者PMCCFILTR_EL0,由PMSELR_EL0.SEL选择的计数器决定。
位图

image.png

读写

op0 op1 CRn CRm op2
0b11 0b011 0b1001 0b1101 0b001
上一篇 下一篇

猜你喜欢

热点阅读