Skip to content

Commit ed0289a

Browse files
committed
Merge branch 'main' into H_CSRs
2 parents 6ec7c09 + 612c0ac commit ed0289a

Some content is hidden

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

53 files changed

+566
-483
lines changed

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ namespace :test do
272272

273273
task schema: "#{$root}/.stamps/resolve-_.stamp" do
274274
puts "Checking arch files against schema.."
275-
Architecture.new("#{$root}/gen/resolved_arch/_").validate(show_progress: true)
275+
cfg_arch_for("_").validate(show_progress: true)
276276
puts "All files validate against their schema"
277277
end
278278

arch/csr/H/hgeie.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ fields:
6363
return NUM_EXTERNAL_GUEST_INTERRUPTS > 0 ? CsrFieldType::RW : CsrFieldType::RO;
6464
reset_value: UNDEFINED_LEGAL
6565
sw_write(csr_value): |
66-
return ((1 << NUM_EXTERNAL_GUEST_INTERRUPTS) - 1) & csr_value.GEI_ENABLE;
66+
return ((MXLEN'1 << NUM_EXTERNAL_GUEST_INTERRUPTS) - 1) & csr_value.GEI_ENABLE;
6767
description: |
6868
Enable bits; see description of hgeie

arch/csr/H/hgeip.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ fields:
5656
type: RO
5757
reset_value: UNDEFINED_LEGAL
5858
description: |
59-
Enable bits; see description of hgeip
59+
Pending bits; see description of hgeip

arch/csr/H/vsie.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@ fields:
4545
alias: hie.VSSIE[0]
4646
description: |
4747
SSIE. Read-only zero when hideleg[2] is 0. Else, alias of hie.VSSIE.
48-
48+
sw_read(): |
49+
if (CSR[hideleg].S == 1) {
50+
return CSR[hie].VSSIE[0];
51+
} else {
52+
return 0;
53+
}
54+
sw_write(csr_value): |
55+
if (CSR[hideleg].S == 1) {
56+
CSR[hie].VSSIE[0] = csr_value.VSSIE & ((1 << NUM_VSSI) - 1);
57+
}
4958
STIE:
5059
location: 5
5160
type: RW-H

arch/csr/H/vsip.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,16 @@ fields:
3838
3939
Indicates a pending software interrupt at the supervisor level.
4040
Read-only zero when `hideleg[2] == 0`, else aliased to `hip.VSSIP[0]`.
41-
41+
sw_read(): |
42+
if (CSR[hideleg].S == 1) {
43+
return CSR[hip].VSSIP[0];
44+
} else {
45+
return 0;
46+
}
47+
sw_write(csr_value): |
48+
if (CSR[hideleg].S == 1) {
49+
CSR[hip].VSSIP[0] = csr_value.VSSIP & ((MXLEN'1 << NUM_VSSI) - 1);
50+
}
4251
STIP:
4352
location: 5
4453
type: RW-H

arch/csr/H/vsscratch.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,10 @@ description:
2121
priv_mode: VS
2222
length: VSXLEN
2323
definedBy: H
24-
fields: {}
24+
fields:
25+
SCRATCH:
26+
type: RW
27+
reset_value: 0
28+
location: 0
29+
description: |
30+
Virtual supervisor scratch register.

arch/ext/Sm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ params:
404404
minimum: 0
405405
maximum: 0xFFFFFFFFFFFFFFFF
406406
when:
407+
name: Sm
407408
version: ">= 1.12.0"
408409
PMA_GRANULARITY:
409410
description: |

arch/inst/C/c.add.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ kind: instruction
55
name: c.add
66
long_name: Add
77
description: |
8-
Add the value in rs2 to rd, and store the result in rd.
9-
C.ADD expands into `add rd, rd, rs2`.
8+
Add the value in xs2 to xd, and store the result in xd.
9+
C.ADD expands into `add xd, xd, xs2`.
1010
definedBy:
1111
anyOf:
1212
- C
1313
- Zca
14-
assembly: xd, rs2
14+
assembly: xd, xs2
1515
encoding:
1616
match: 1001----------10
1717
variables:
18-
- name: rs2
18+
- name: xs2
1919
location: 6-2
2020
not: 0
21-
- name: rd
21+
- name: xd
2222
location: 11-7
2323
not: 0
2424
access:
@@ -27,9 +27,9 @@ access:
2727
vs: always
2828
vu: always
2929
operation(): |
30-
XReg t0 = X[rd];
31-
XReg t1 = X[rs2];
32-
X[rd] = t0 + t1;
30+
XReg t0 = X[xd];
31+
XReg t1 = X[xs2];
32+
X[xd] = t0 + t1;
3333
3434
# SPDX-SnippetBegin
3535
# SPDX-FileCopyrightText: 2017-2025 Contributors to the RISCV Sail Model <https://github.com/riscv/sail-riscv/blob/master/LICENCE>

arch/inst/C/c.addw.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@ kind: instruction
55
name: c.addw
66
long_name: Add word
77
description: |
8-
Add the 32-bit values in rs2 from rd, and store the result in rd.
9-
The rd and rs2 register indexes should be used as rd+8 and rs2+8 (registers x8-x15).
10-
C.ADDW expands into `addw rd, rd, rs2`.
8+
Add the 32-bit values in xs2 from xd, and store the result in xd.
9+
The xd and xs2 register indexes should be used as xd+8 and xs2+8 (registers x8-x15).
10+
C.ADDW expands into `addw xd, xd, xs2`.
1111
definedBy:
1212
anyOf:
1313
- C
1414
- Zca
1515
base: 64
16-
assembly: xd, rs2
16+
assembly: xd, xs2
1717
encoding:
1818
match: 100111---01---01
1919
variables:
20-
- name: rs2
20+
- name: xs2
2121
location: 4-2
22-
- name: rd
22+
- name: xd
2323
location: 9-7
2424
access:
2525
s: always
2626
u: always
2727
vs: always
2828
vu: always
2929
operation(): |
30-
Bits<32> t0 = X[creg2reg(rd)][31:0];
31-
Bits<32> t1 = X[creg2reg(rs2)][31:0];
32-
X[creg2reg(rd)] = $signed(t0 + t1);
30+
Bits<32> t0 = X[creg2reg(xd)][31:0];
31+
Bits<32> t1 = X[creg2reg(xs2)][31:0];
32+
X[creg2reg(xd)] = $signed(t0 + t1);
3333
3434
# SPDX-SnippetBegin
3535
# SPDX-FileCopyrightText: 2017-2025 Contributors to the RISCV Sail Model <https://github.com/riscv/sail-riscv/blob/master/LICENCE>

arch/inst/C/c.and.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@ kind: instruction
55
name: c.and
66
long_name: And
77
description: |
8-
And rd with rs2, and store the result in rd
9-
The rd and rs2 register indexes should be used as rd+8 and rs2+8 (registers x8-x15).
10-
C.AND expands into `and rd, rd, rs2`.
8+
And xd with xs2, and store the result in xd
9+
The xd and xs2 register indexes should be used as xd+8 and xs2+8 (registers x8-x15).
10+
C.AND expands into `and xd, xd, xs2`.
1111
definedBy:
1212
anyOf:
1313
- C
1414
- Zca
15-
assembly: xd, rs2
15+
assembly: xd, xs2
1616
encoding:
1717
match: 100011---11---01
1818
variables:
19-
- name: rs2
19+
- name: xs2
2020
location: 4-2
21-
- name: rd
21+
- name: xd
2222
location: 9-7
2323
access:
2424
s: always
2525
u: always
2626
vs: always
2727
vu: always
2828
operation(): |
29-
XReg t0 = X[creg2reg(rd)];
30-
XReg t1 = X[creg2reg(rs2)];
31-
X[creg2reg(rd)] = t0 & t1;
29+
XReg t0 = X[creg2reg(xd)];
30+
XReg t1 = X[creg2reg(xs2)];
31+
X[creg2reg(xd)] = t0 & t1;
3232
3333
# SPDX-SnippetBegin
3434
# SPDX-FileCopyrightText: 2017-2025 Contributors to the RISCV Sail Model <https://github.com/riscv/sail-riscv/blob/master/LICENCE>

0 commit comments

Comments
 (0)