Dskpimc? · 2023年03月14日 · 北京市

Armv9 system register class空间编码

1. 前言

Armv9 system register的编码空间由一组参数标识:{op0, op1, CRn, CRm, op2},它们形成了一个编码层次结构,其中:

  • op0:定义编码空间的最高类别划分。
  • op1:定义了可以访问这个编码空间的最低Exception level。具体如下:

    • Accessible at EL0:op1的值为3
    • Accessible at EL1:op1的值为0,1,2
    • Accessible at Secure EL1:op1的值为7
    • Accessible at EL2:op1的值为4,5。其中5是用于在VHE实现和HCR_EL2.E2H为1情况下,EL12编码访问EL1 system registers的。
    • Accessible at EL3:op1的值为6

ARM架构里预留了一些IMPLEMENTATION DEFINE的空间,它强烈建立这段空间的op1的值也要符合上述约定。

系统指令类的编码空间里的每条instruction有以下任意特性:

  • 转移到system register:这种system instruction具有写的特性;
  • 从system register转移。这种system instruction具有读的特性;

执行system instruction就像是对寄存器进行传输一样。

2. op0分类

在AArch64指令集中,system instruction class对{op0, op1, CRn, CRm, op2}的编码结构为:
image.png
 op0域提供了system instruction类型的最顶层编码分类,它的值有:

  • 0b00 These encodings provide:

    • Instructions with an immediate field for accessing PSTATE, the current PE state.
    • The architectural hint instructions.
    • Barriers and the CLREX instruction.
  • 0b01 These encodings provide:

    • Cache maintenance instructions.
    • TLB maintenance instructions.
    • Address translation instructions.
    • Prediction restriction instructions.
    • BRBE instructions.
  • 0b10 These encodings provide moves to and from:

    • Legacy AArch32 System registers for execution environments, to provide access to these registers from higher Exception levels that are using AArch64.
    • Debug and trace registers.
  • 0b11 These encodings provide:

    • Moves to and from Non-debug System registers. The accessed registers provide system control, and system status information.
    • Access to Special-purpose registers.

记忆原则就是43522,4是op1的类别,3522分别对应op1为0,1,,2,3的类别。
image.png

3. op0之下的分类

在上面我们看到系统寄存器的分类取决于{op0, op1, CRn, CRm, op2}参数。op0决定大类,在之下的根据op1,op2,CRn,CRm还可以继续细分有: 
image.png
上述是总体小类别划分的总结。

op0 == 0b00
image.png
op0 == 0b01
image.png
op0 == 0b10
image.png
op0 == 0b11
image.png

文章来源:谷公子

推荐阅读

更多IC设计技术干货请关注IC设计技术专栏。
迎添加极术小姐姐微信(id:aijishu20)加入技术交流群,请备注研究方向。
 
推荐阅读
关注数
11572
内容数
1229
主要交流IC以及SoC设计流程相关的技术和知识
目录
极术微信服务号
关注极术微信号
实时接收点赞提醒和评论通知
安谋科技学堂公众号
关注安谋科技学堂
实时获取安谋科技及 Arm 教学资源
安谋科技招聘公众号
关注安谋科技招聘
实时获取安谋科技中国职位信息