Skip to content

Commit aafc7c8

Browse files
Merge branch 'main' into H_CSRs
2 parents 626384d + b45a89f commit aafc7c8

File tree

472 files changed

+1799
-1527
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

472 files changed

+1799
-1527
lines changed

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,47 @@ repos:
4646
rev: 0.33.0
4747
hooks:
4848
- id: check-jsonschema
49+
name: Validate instruction files with jsonschema
4950
stages: [pre-commit]
5051
alias: check-jsonschema-inst
5152
files: ^arch/inst/.*\.(yaml|yml)$
5253
args: ["--schemafile", "schemas/inst_schema.json"]
5354
- id: check-jsonschema
55+
name: Validate CSR files with jsonschema
5456
stages: [pre-commit]
5557
alias: check-jsonschema-csr
5658
files: ^arch/csr/.*\.(yaml|yml)$
5759
args: ["--schemafile", "schemas/csr_schema.json"]
5860
- id: check-jsonschema
61+
name: Validate extension files with jsonschema
5962
stages: [pre-commit]
6063
alias: check-jsonschema-ext
6164
files: ^arch/ext/.*\.(yaml|yml)$
6265
args: ["--schemafile", "schemas/ext_schema.json"]
6366
- id: check-jsonschema
67+
name: Validate cert model files with jsonschema
6468
stages: [pre-commit]
6569
alias: check-jsonschema-cert-model
6670
files: ^arch/proc_cert_model/.*\.(yaml|yml)$
6771
args: ["--schemafile", "schemas/proc_cert_model_schema.json"]
6872
- id: check-jsonschema
73+
name: Validate cert class files with jsonschema
6974
stages: [pre-commit]
7075
alias: check-jsonschema-cert-class
7176
files: ^arch/proc_cert_class/.*\.(yaml|yml)$
7277
args: ["--schemafile", "schemas/proc_cert_class_schema.json"]
78+
- id: check-jsonschema
79+
name: Validate profile family files with jsonschema
80+
stages: [pre-commit]
81+
alias: check-jsonschema-profile-family
82+
files: ^arch/profile_family/.*\.(yaml|yml)$
83+
args: ["--schemafile", "schemas/profile_family_schema.json"]
84+
- id: check-jsonschema
85+
name: Validate profile release files with jsonschema
86+
stages: [pre-commit]
87+
alias: check-jsonschema-profile-release
88+
files: ^arch/profile_release/.*\.(yaml|yml)$
89+
args: ["--schemafile", "schemas/profile_release_schema.json"]
7390
# Commenting because throwing errors and not sure this is complete yet
7491
# - id: check-jsonschema
7592
# alias: check-jsonschema-manual-version

arch/csr/Smcntrpmf/mcyclecfg.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
2+
$schema: csr_schema.json#
3+
kind: csr
4+
name: mcyclecfg
5+
long_name: Machine Cycle Counter Configuration
6+
address: 0x321
7+
priv_mode: M
8+
length: 64
9+
definedBy: Smcntrpmf
10+
description: |
11+
The `mcyclecfg` CSR is a 64-bit machine-level register that configures privilege
12+
mode filtering for the cycle counter. Each inhibit bit (xINH) suppresses
13+
counting of events in the corresponding privilege mode when set.
14+
15+
| Field | Description |
16+
|---------|---------------------------------------------------------|
17+
| MINH | If set, then counting of events in M-mode is inhibited. |
18+
| SINH | If set, then counting of events in S/HS-mode is inhibited. |
19+
| UINH | If set, then counting of events in U-mode is inhibited. |
20+
| VSINH | If set, then counting of events in VS-mode is inhibited. |
21+
| VUINH | If set, then counting of events in VU-mode is inhibited. |
22+
23+
When all xINH bits are zero, event counting is enabled in all modes.
24+
25+
For each bit in 61:58, if the associated privilege mode is not implemented,
26+
the bit is read-only zero.
27+
28+
Bit 63 is hardwired to 0, as these counters do not generate overflow interrupts.
29+
30+
Bits [57:0] are reserved (WPRI) and read as zero.
31+
32+
For RV32, the upper 32 bits of `mcyclecfg` are accessed via `mcyclecfgh` (CSR 0x721).
33+
34+
Note: Although CSR address 0x320 would have been a more natural choice,
35+
it is already allocated to `mcountinhibit`.
36+
37+
fields:
38+
MINH:
39+
location: 62
40+
base: 64
41+
type: RW
42+
definedBy: M
43+
description: If set, then counting of events in M-mode is inhibited.
44+
reset_value: UNDEFINED_LEGAL
45+
46+
SINH:
47+
location: 61
48+
base: 64
49+
type: RW
50+
definedBy: S
51+
description: If set, then counting of events in S/HS-mode is inhibited.
52+
reset_value: UNDEFINED_LEGAL
53+
54+
UINH:
55+
location: 60
56+
base: 64
57+
type: RW
58+
definedBy: U
59+
description: If set, then counting of events in U-mode is inhibited.
60+
reset_value: UNDEFINED_LEGAL
61+
62+
VSINH:
63+
location: 59
64+
base: 64
65+
type: RW
66+
definedBy: H
67+
description: If set, then counting of events in VS-mode is inhibited.
68+
reset_value: UNDEFINED_LEGAL
69+
70+
VUINH:
71+
location: 58
72+
base: 64
73+
type: RW
74+
definedBy: H
75+
description: If set, then counting of events in VU-mode is inhibited.
76+
reset_value: UNDEFINED_LEGAL

arch/csr/Smcntrpmf/mcyclecfgh.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
2+
$schema: csr_schema.json#
3+
kind: csr
4+
name: mcyclecfgh
5+
long_name: Machine Cycle Counter Configuration High
6+
address: 0x721
7+
priv_mode: M
8+
length: 32
9+
definedBy: Smcntrpmf
10+
description: |
11+
Upper 32 bits of the 64-bit `mcyclecfg` CSR, used for RV32 systems to access
12+
the privilege mode filtering inhibit bits.
13+
14+
fields:
15+
MINH:
16+
alias: mcyclecfg.MINH
17+
location: 30
18+
type: RW
19+
definedBy: M
20+
description: If set, then counting of events in M-mode is inhibited.
21+
reset_value: UNDEFINED_LEGAL
22+
23+
SINH:
24+
alias: mcyclecfg.SINH
25+
location: 29
26+
type: RW
27+
definedBy: S
28+
description: If set, then counting of events in S/HS-mode is inhibited.
29+
reset_value: UNDEFINED_LEGAL
30+
31+
UINH:
32+
alias: mcyclecfg.UINH
33+
location: 28
34+
type: RW
35+
definedBy: U
36+
description: If set, then counting of events in U-mode is inhibited.
37+
reset_value: UNDEFINED_LEGAL
38+
39+
VSINH:
40+
alias: mcyclecfg.VSINH
41+
location: 27
42+
type: RW
43+
definedBy: H
44+
description: If set, then counting of events in VS-mode is inhibited.
45+
reset_value: UNDEFINED_LEGAL
46+
47+
VUINH:
48+
alias: mcyclecfg.VUINH
49+
location: 26
50+
type: RW
51+
definedBy: H
52+
description: If set, then counting of events in VU-mode is inhibited.
53+
reset_value: UNDEFINED_LEGAL
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
2+
$schema: csr_schema.json#
3+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
4+
kind: csr
5+
name: minstretcfg
6+
long_name: Machine Instructions-Retired Counter Configuration
7+
address: 0x322
8+
priv_mode: M
9+
length: 64
10+
definedBy: Smcntrpmf
11+
description: |
12+
The `minstretcfg` CSR is a 64-bit machine-level register that configures privilege
13+
mode filtering for the `minstret` (Machine Instructions-Retired Counter). Each inhibit bit (xINH)
14+
disables counting of retired instructions in the associated privilege mode.
15+
16+
| Field | Description |
17+
|---------|-----------------------------------------------------------|
18+
| MINH | If set, then counting of events in M-mode is inhibited. |
19+
| SINH | If set, then counting of events in S/HS-mode is inhibited. |
20+
| UINH | If set, then counting of events in U-mode is inhibited. |
21+
| VSINH | If set, then counting of events in VS-mode is inhibited. |
22+
| VUINH | If set, then counting of events in VU-mode is inhibited. |
23+
24+
When all inhibit bits are clear, instruction retirement is counted in all privilege modes.
25+
26+
For each bit in 61:58, if the associated privilege mode is not implemented, the bit is read-only zero.
27+
28+
Bit 63 (OF) always reads as zero, indicating that the counter does not generate overflow interrupts.
29+
30+
Bits [57:0] are reserved (WPRI) and read as zero; writes are ignored.
31+
32+
For RV32 systems, the upper 32 bits of `minstretcfg` are accessible via the `minstretcfgh` CSR (0x722).
33+
34+
fields:
35+
MINH:
36+
location: 62
37+
base: 64
38+
type: RW
39+
definedBy: M
40+
description: If set, then counting of events in M-mode is inhibited.
41+
reset_value: UNDEFINED_LEGAL
42+
43+
SINH:
44+
location: 61
45+
base: 64
46+
type: RW
47+
definedBy: S
48+
description: If set, then counting of events in S/HS-mode is inhibited.
49+
reset_value: UNDEFINED_LEGAL
50+
51+
UINH:
52+
location: 60
53+
base: 64
54+
type: RW
55+
definedBy: U
56+
description: If set, then counting of events in U-mode is inhibited.
57+
reset_value: UNDEFINED_LEGAL
58+
59+
VSINH:
60+
location: 59
61+
base: 64
62+
type: RW
63+
definedBy: H
64+
description: If set, then counting of events in VS-mode is inhibited.
65+
reset_value: UNDEFINED_LEGAL
66+
67+
VUINH:
68+
location: 58
69+
base: 64
70+
type: RW
71+
definedBy: H
72+
description: If set, then counting of events in VU-mode is inhibited.
73+
reset_value: UNDEFINED_LEGAL
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
2+
$schema: csr_schema.json#
3+
kind: csr
4+
name: minstretcfgh
5+
long_name: Machine Instructions-Retired Counter Configuration High
6+
address: 0x722
7+
priv_mode: M
8+
length: 32
9+
definedBy: Smcntrpmf
10+
description: |
11+
Upper 32 bits of the 64-bit `minstretcfg` CSR, used on RV32 systems to access
12+
privilege mode filtering inhibit bits for instruction retirement.
13+
14+
fields:
15+
MINH:
16+
alias: minstretcfg.MINH
17+
location: 30
18+
type: RW
19+
definedBy: M
20+
description: If set, then counting of events in M-mode is inhibited.
21+
reset_value: UNDEFINED_LEGAL
22+
23+
SINH:
24+
alias: minstretcfg.SINH
25+
location: 29
26+
type: RW
27+
definedBy: S
28+
description: If set, then counting of events in S/HS-mode is inhibited.
29+
reset_value: UNDEFINED_LEGAL
30+
31+
UINH:
32+
alias: minstretcfg.UINH
33+
location: 28
34+
type: RW
35+
definedBy: U
36+
description: If set, then counting of events in U-mode is inhibited.
37+
reset_value: UNDEFINED_LEGAL
38+
39+
VSINH:
40+
alias: minstretcfg.VSINH
41+
location: 27
42+
type: RW
43+
definedBy: H
44+
description: If set, then counting of events in VS-mode is inhibited.
45+
reset_value: UNDEFINED_LEGAL
46+
47+
VUINH:
48+
alias: minstretcfg.VUINH
49+
location: 26
50+
type: RW
51+
definedBy: H
52+
description: If set, then counting of events in VU-mode is inhibited.
53+
reset_value: UNDEFINED_LEGAL

arch/inst/C/c.nop.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ definedBy:
1010
anyOf:
1111
- C
1212
- Zca
13-
assembly: imm
13+
assembly: ""
1414
encoding:
1515
match: "0000000000000001"
1616
access:

arch/inst/V/vaadd.vx.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ encoding:
1515
location: 25-25
1616
- name: vs2
1717
location: 24-20
18-
- name: rs1
18+
- name: xs1
1919
location: 19-15
2020
- name: vd
2121
location: 11-7

arch/inst/V/vaaddu.vx.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ encoding:
1515
location: 25-25
1616
- name: vs2
1717
location: 24-20
18-
- name: rs1
18+
- name: xs1
1919
location: 19-15
2020
- name: vd
2121
location: 11-7

arch/inst/V/vadc.vim.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ encoding:
1313
variables:
1414
- name: vs2
1515
location: 24-20
16-
- name: simm5
16+
- name: imm
1717
location: 19-15
1818
- name: vd
1919
location: 11-7

arch/inst/V/vadc.vxm.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ encoding:
1313
variables:
1414
- name: vs2
1515
location: 24-20
16-
- name: rs1
16+
- name: xs1
1717
location: 19-15
1818
- name: vd
1919
location: 11-7

0 commit comments

Comments
 (0)