Skip to content

Commit 47267ea

Browse files
Merge branch 'riscv-software-src:main' into add-ssqosid-csr-yaml
2 parents 253613c + 48cbf1b commit 47267ea

File tree

759 files changed

+7887
-3565
lines changed

Some content is hidden

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

759 files changed

+7887
-3565
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ RUN \
2626
libc6-dev-riscv64-cross \
2727
libelf-dev \
2828
libgmp-dev \
29+
libnewlib-dev\
2930
libyaml-dev \
3031
nodejs \
3132
npm \

.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

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@
111111
},
112112
{
113113
"type": "rdbg",
114-
"name": "RVA20",
114+
"name": "RVI20",
115115
"request": "launch",
116116
"command": "bundle exec rake",
117-
"script": "gen:profile_release_pdf[RVA20]",
117+
"script": "gen:profile_release_pdf[RVI20]",
118118
"args": [],
119119
"askParameters": false
120120
},

Rakefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,15 @@ file "#{$root}/arch/csr/S/scounteren.yaml" => [
388388
File.write(t.name, insert_warning(erb.result(binding), t.prerequisites.first))
389389
end
390390

391+
file "#{$root}/arch/csr/Sscofpmf/scountovf.yaml" => [
392+
"#{$root}/arch/csr/Sscofpmf/scountovf.layout",
393+
__FILE__
394+
] do |t|
395+
erb = ERB.new(File.read($root / "arch/csr/Sscofpmf/scountovf.layout"), trim_mode: "-")
396+
erb.filename = "#{$root}/arch/csr/Sscofpmf/scountovf.layout"
397+
File.write(t.name, insert_warning(erb.result(binding), t.prerequisites.first))
398+
end
399+
391400
file "#{$root}/arch/csr/H/hcounteren.yaml" => [
392401
"#{$root}/arch/csr/H/hcounteren.layout",
393402
__FILE__
@@ -421,6 +430,7 @@ namespace :gen do
421430

422431
Rake::Task["#{$root}/arch/csr/I/mcounteren.yaml"].invoke
423432
Rake::Task["#{$root}/arch/csr/S/scounteren.yaml"].invoke
433+
Rake::Task["#{$root}/arch/csr/Sscofpmf/scountovf.yaml"].invoke
424434
Rake::Task["#{$root}/arch/csr/H/hcounteren.yaml"].invoke
425435
Rake::Task["#{$root}/arch/csr/Zicntr/mcountinhibit.yaml"].invoke
426436

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

0 commit comments

Comments
 (0)