Skip to content

Commit 36c4e22

Browse files
author
Derek Hower
committed
Merge remote-tracking branch 'origin/main' into pr/dhower/201
2 parents 150f118 + 6afa9d6 commit 36c4e22

File tree

119 files changed

+2560
-109
lines changed

Some content is hidden

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

119 files changed

+2560
-109
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Data Entry
3+
about: Add new data into the database
4+
title: ''
5+
labels: data entry
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the data**

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"files.watcherExclude": {
1010
"**/.home": true
1111
},
12-
"asciidoc.antora.enableAntoraSupport": true
12+
"asciidoc.antora.showEnableAntoraPrompt": true
1313
}

README.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This repository contains:
2828

2929
=== Working examples:
3030

31-
* Generate https://riscv-software-src.github.io/riscv-unified-db/manual/index.html[configuration-specific documentation] taylored to the set of implemented extensions and unnamed implementation options (_e.g._, `./do gen:html[generic_rv64]`).
31+
* Generate https://riscv-software-src.github.io/riscv-unified-db/manual/html/index.html[configuration-specific documentation] taylored to the set of implemented extensions and unnamed implementation options (_e.g._, `./do gen:html[generic_rv64]`).
3232
** Only implemented extensions/instructions/CSRs are included
3333
** Unreachable/unimplemented parts of the formal specification are pruned away
3434
** A dedicated documentation page for every implemented instruction, including its encoding, pruned execution behavior, and what types of exceptions it may cause.
@@ -108,5 +108,3 @@ Quick start:
108108
== More info
109109

110110
* xref:arch/README.adoc[Architecture specification format]
111-
* xref:_site/ruby/arch_def/index.html[Ruby database object model documentation]
112-
* xref:_site/ruby/idl/index.html[IDL Compiler documentation]

arch/csr/menvcfg.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ menvcfg:
247247
type: RW-R
248248
sw_write(csr_value): |
249249
if ((csr_value.CBIE == 0) ||
250-
(ALLOW_CBO_INVAL_UPGRADE_TO_FLUSH && (csr_value.CBIE == 1)) ||
251-
(csr_value.CBIE == 3)) {
250+
(csr_value.CBIE == 1) ||
251+
((!FORCE_UPGRADE_CBO_INVAL_TO_FLUSH) && (csr_value.CBIE == 3))) {
252252
return csr_value.CBIE;
253253
} else {
254254
return CSR[menvcfg].CBIE;

arch/csr/mstatus.yaml

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,29 @@ mstatus:
2222
2323
Read-only bit that summarizes whether either the FS, XS, or VS
2424
fields signal the presence of some dirty state.
25-
type: RO-H
26-
reset_value: UNDEFINED_LEGAL
27-
affectedBy: [F, D, V]
25+
definedBy:
26+
anyOf: [F,V] # NOTE: if you implement a custom extension overlay that writes to XS, then you need to add your extension here in the overlay as well
27+
type(): |
28+
# this is read-only if FS and VS are both read-only
29+
# otherwise, it is read-only with hardware update
30+
31+
if (implemented?(ExtensionName::F) && (HW_MSTATUS_FS_DIRTY_UPDATE != "never")) {
32+
return CsrFieldType::ROH;
33+
} else if (implemented?(ExtensionName::V) && (HW_MSTATUS_VS_DIRTY_UPDATE != "never")) {
34+
return CsrFieldType::ROH;
35+
} else {
36+
return CsrFieldType::RO;
37+
}
38+
reset_value(): |
39+
# the reset value is known if both FS and VS are legal
40+
# make this a function call so that it can be displayed succinctly in docs
41+
42+
if (mstatus_sd_has_known_reset()) {
43+
return mstatus_sd_reset_value();
44+
} else {
45+
return UNDEFINED_LEGAL;
46+
}
47+
2848
MPV:
2949
location: 39
3050
base: 64
@@ -339,7 +359,8 @@ mstatus:
339359
# there will be no hardware update in this case because we know the F extension isn't implemented
340360
return MSTATUS_FS_WRITEABLE ? CsrFieldType::RW : CsrFieldType::RO;
341361
}
342-
definedBy: F
362+
definedBy:
363+
anyOf: [F, S]
343364
reset_value(): |
344365
if (CSR[misa].F == 1'b1){
345366
return UNDEFINED_LEGAL;
@@ -410,9 +431,38 @@ mstatus:
410431
When a vector register or vector CSR is written, VS obtains the value 3.
411432
Values 1 and 2 are valid write values for software, but are not interpreted by hardware
412433
other than to possibly enable a previously-disabled vector unit.
413-
type: RW-H
414-
reset_value: UNDEFINED_LEGAL
415-
definedBy: V
434+
definedBy:
435+
anyOf: [V, S]
436+
type(): |
437+
if (CSR[misa].V == 1'b1){
438+
return CsrFieldType::RWH;
439+
} else if ((CSR[misa].S == 1'b0) && (CSR[misa].V == 1'b0)) {
440+
# must be read-only-0
441+
return CsrFieldType::RO;
442+
} else {
443+
# there will be no hardware update in this case because we know the V extension isn't implemented
444+
return MSTATUS_VS_WRITEABLE ? CsrFieldType::RW : CsrFieldType::RO;
445+
}
446+
reset_value(): |
447+
if (CSR[misa].V == 1'b1){
448+
return UNDEFINED_LEGAL;
449+
} else if ((CSR[misa].S == 1'b0) && (CSR[misa].V == 1'b0)) {
450+
# must be read-only-0
451+
return 0;
452+
} else {
453+
# there will be no hardware update in this case because we know the V extension isn't implemented
454+
return MSTATUS_VS_WRITEABLE ? UNDEFINED_LEGAL : 0;
455+
}
456+
sw_write(csr_value): |
457+
if (CSR[misa].V == 1'b1){
458+
return ary_includes?<$array_size(MSTATUS_VS_LEGAL_VALUES), 2>(MSTATUS_VS_LEGAL_VALUES, csr_value.FS) ? csr_value.FS : UNDEFINED_LEGAL_DETERMINISTIC;
459+
} else if ((CSR[misa].S == 1'b0) && (CSR[misa].V == 1'b0)) {
460+
# must be read-only-0
461+
return 0;
462+
} else {
463+
# there will be no hardware update in this case because we know the V extension isn't implemented
464+
return ary_includes?<$array_size(MSTATUS_VS_LEGAL_VALUES), 2>(MSTATUS_VS_LEGAL_VALUES, csr_value.FS) ? csr_value.FS : UNDEFINED_LEGAL_DETERMINISTIC;
465+
}
416466
SPP:
417467
location: 8
418468
description: |

arch/ext/F.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,13 @@ F:
246246
Values are:
247247
[separator="!"]
248248
!===
249-
h! none ! Hardware never writes `mstatus.FS`
249+
h! never ! Hardware never writes `mstatus.FS`
250250
h! precise ! Hardware writes `mstatus.FS` to the Dirty (3) state precisely when F registers are modified
251251
h! imprecise ! Hardware writes `mstatus.FS` imprecisely. This will result in a call to unpredictable() on any attempt to read `mstatus` or write FP state.
252252
!===
253253
schema:
254254
type: string
255-
enum: ["none", "precise", "imprecise"]
255+
enum: ["never", "precise", "imprecise"]
256256
MSTATUS_FS_LEGAL_VALUES:
257257
description: |
258258
The set of values that mstatus.FS will accept from a software write.
@@ -268,4 +268,4 @@ F:
268268
assert MSTATUS_FS_LEGAL_VALUES.include?(0) && MSTATUS_FS_LEGAL_VALUES.include?(3) if ext?(:F)
269269
270270
# if HW is writing FS, then Dirty (3) better be a supported value
271-
assert MSTATUS_FS_LEGAL_VALUES.include?(3) if ext?(:F) && (HW_MSTATUS_FS_DIRTY_UPDATE != "none")
271+
assert MSTATUS_FS_LEGAL_VALUES.include?(3) if ext?(:F) && (HW_MSTATUS_FS_DIRTY_UPDATE != "never")

arch/ext/S.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,15 @@ S:
254254
type: boolean
255255
extra_validation:
256256
assert MSTATUS_FS_WRITEABLE == true if ext?(:F)
257+
MSTATUS_VS_WRITEABLE:
258+
description: |
259+
When `S` is enabled but `V` is not, mstatus.VS is optionally writeable.
260+
261+
This parameter only has an effect when both S and V mode are disabled.
262+
schema:
263+
type: boolean
264+
extra_validation:
265+
assert MSTATUS_VS_WRITEABLE == true if ext?(:V)
257266
MSTATUS_FS_LEGAL_VALUES:
258267
description: |
259268
The set of values that mstatus.FS will accept from a software write.
@@ -267,6 +276,22 @@ S:
267276
also_defined_in: F
268277
extra_validation: |
269278
assert MSTATUS_FS_LEGAL_VALUES.include?(0) && MSTATUS_FS_LEGAL_VALUES.include?(3) if ext?(:F)
279+
MSTATUS_VS_LEGAL_VALUES:
280+
description: |
281+
The set of values that mstatus.VS will accept from a software write.
282+
schema:
283+
type: array
284+
items:
285+
type: integer
286+
enum: [0,1,2,3]
287+
maxItems: 4
288+
uniqueItems: true
289+
also_defined_in: V
290+
extra_validation: |
291+
assert MSTATUS_VS_LEGAL_VALUES.include?(0) && MSTATUS_VS_LEGAL_VALUES.include?(3) if ext?(:V)
292+
293+
# if HW is writing VS, then Dirty (3) better be a supported value
294+
assert MSTATUS_VS_LEGAL_VALUES.include?(3) if ext?(:V) && (HW_MSTATUS_VS_DIRTY_UPDATE != "never")
270295
MSTATUS_TVM_IMPLEMENTED:
271296
description: |
272297
Whether or not mstatus.TVM is implemented.

arch/ext/V.yaml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,34 @@ V:
1414
description: |
1515
Indicates whether or not the `V` extension can be disabled with the `misa.V` bit.
1616
schema:
17-
type: boolean
17+
type: boolean
18+
HW_MSTATUS_VS_DIRTY_UPDATE:
19+
description: |
20+
Indicates whether or not hardware will write to `mstatus.VS`
21+
22+
Values are:
23+
[separator="!"]
24+
!===
25+
h! never ! Hardware never writes `mstatus.VS`
26+
h! precise ! Hardware writes `mstatus.VS` to the Dirty (3) state precisely when V registers are modified
27+
h! imprecise ! Hardware writes `mstatus.VS` imprecisely. This will result in a call to unpredictable() on any attempt to read `mstatus` or write vector state.
28+
!===
29+
schema:
30+
type: string
31+
enum: ["never", "precise", "imprecise"]
32+
MSTATUS_VS_LEGAL_VALUES:
33+
description: |
34+
The set of values that mstatus.VS will accept from a software write.
35+
schema:
36+
type: array
37+
items:
38+
type: integer
39+
enum: [0,1,2,3]
40+
maxItems: 4
41+
uniqueItems: true
42+
also_defined_in: S
43+
extra_validation: |
44+
assert MSTATUS_VS_LEGAL_VALUES.include?(0) && MSTATUS_VS_LEGAL_VALUES.include?(3) if ext?(:V)
45+
46+
# if HW is writing VS, then Dirty (3) better be a supported value
47+
assert MSTATUS_VS_LEGAL_VALUES.include?(3) if ext?(:V) && (HW_MSTATUS_VS_DIRTY_UPDATE != "never")

arch/ext/Zicbom.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ Zicbom:
1515
also_defined_in: [Zicboz, Zicbop]
1616
schema:
1717
type: integer
18-
ALLOW_CBO_INVAL_UPGRADE_TO_FLUSH:
18+
FORCE_UPGRADE_CBO_INVAL_TO_FLUSH:
1919
description: |
20-
When true, an implementation can (when `menvcfg.CBIE` == `01`) upgrade a `cbo.inval`
21-
instruction to a `cbo.flush`.
20+
When true, an implementation prohibits setting `menvcfg.CBIE` == `11` such that all `cbo.inval`
21+
instructions either trap (when `menvcfg.CBIE` == '00') or flush (when `menvcfg.CBIE` == '01').
2222
23-
When false, an implementation does not support the upgrade, and the value '01' cannot be
24-
written to `menvcfg.CBIE`.
23+
When false, an implementation allows a true INVAL operation for `cbo.inval`, and thus supports
24+
the setting `menvcfg.CBIE` == `11`.
2525
schema:
2626
type: boolean

arch/inst/A/lr.w.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ lr.w:
4545
Software should not set the _rl_ bit on an LR instruction unless the _aq_ bit is also set.
4646
LR.rl and SC.aq instructions are not guaranteed to provide any stronger ordering than those
4747
with both bits clear, but may result in lower performance.
48-
definedBy: A
48+
definedBy:
49+
anyOf: [A, Zalrsc]
4950
assembly: xd, xs1
5051
encoding:
5152
match: 00010--00000-----010-----0101111

0 commit comments

Comments
 (0)