Skip to content

Commit 15c0c7a

Browse files
committed
cleanup
1 parent 7ae01d6 commit 15c0c7a

File tree

15 files changed

+41
-55
lines changed

15 files changed

+41
-55
lines changed

spec/std/isa/csr/misa.yaml

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,11 @@ fields:
139139
}
140140
definedBy: F
141141
sw_write(csr_value): |
142-
if (MISA_CSR_IMPLEMENTED) {
143-
if (csr_value.F == 0 && csr_value.D == 1) {
144-
return UNDEFINED_LEGAL_DETERMINISTIC;
145-
}
146-
147-
# fall-through; write the intended value
148-
return csr_value.F;
149-
} else {
150-
return 0;
151-
}
152-
legal?(csr_value): |
153-
if (MISA_CSR_IMPLEMENTED) {
154-
return !(csr_value.F == 0 && csr_value.D == 1);
155-
} else {
156-
return true;
142+
if (csr_value.F == 0 && csr_value.D == 1) {
143+
return UNDEFINED_LEGAL_DETERMINISTIC;
157144
}
145+
# fall-through; write the intended value
146+
return csr_value.F;
158147
G:
159148
location: 6
160149
description: |
@@ -272,22 +261,12 @@ fields:
272261
return MISA_CSR_IMPLEMENTED ? 1 : 0;
273262
definedBy: Q
274263
sw_write(csr_value): |
275-
if (MISA_CSR_IMPLEMENTED) {
276-
if ((csr_value.F == 0 || csr_value.D == 0) && csr_value.Q == 1) {
277-
return UNDEFINED_LEGAL_DETERMINISTIC;
278-
}
279-
280-
# fall-through; write the intended value
281-
return csr_value.Q;
282-
} else {
283-
return 0;
284-
}
285-
legal?(csr_value): |
286-
if (MISA_CSR_IMPLEMENTED) {
287-
return !(csr_value.Q == 1 && csr_value.D == 0);
288-
} else {
289-
return true;
264+
if ((csr_value.F == 0 || csr_value.D == 0) && csr_value.Q == 1) {
265+
return UNDEFINED_LEGAL_DETERMINISTIC;
290266
}
267+
268+
# fall-through; write the intended value
269+
return csr_value.Q;
291270
S:
292271
location: 18
293272
description: |
@@ -333,11 +312,8 @@ fields:
333312
description: |
334313
Indicates support for the `V` (vector) extension.
335314
336-
[when,"MUTABLE_MISA_V == true && MISA_CSR_IMPLEMENTED == true"]
315+
[when,"MUTABLE_MISA_V == true"]
337316
Writing 0 to this field will cause all attempts to execute a vector instruction to raise an `IllegalInstruction` trap.
338-
339-
[when,"MISA_CSR_IMPLEMENTED == false"]
340-
This field reads as 0 and cannot be modified.
341317
type(): |
342318
if (MISA_CSR_IMPLEMENTED && implemented?(ExtensionName::V) && MUTABLE_MISA_V) {
343319
return CsrFieldType::RW;

spec/std/isa/ext/A.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,4 @@ params:
128128
the extension can be disabled in the `misa.A` bit.
129129
schema:
130130
type: boolean
131+
extra_validation: assert MISA_CSR_IMPLEMENTED == true

spec/std/isa/ext/B.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ params:
4343
Indicates whether or not the `B` extension can be disabled with the `misa.B` bit.
4444
schema:
4545
type: boolean
46+
extra_validation: assert MISA_CSR_IMPLEMENTED == true

spec/std/isa/ext/C.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,4 @@ params:
319319
Indicates whether or not the `C` extension can be disabled with the `misa.C` bit.
320320
schema:
321321
type: boolean
322+
extra_validation: assert MISA_CSR_IMPLEMENTED == true

spec/std/isa/ext/D.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,4 @@ params:
112112
Indicates whether or not the `D` extension can be disabled with the `misa.D` bit.
113113
schema:
114114
type: boolean
115+
extra_validation: assert MISA_CSR_IMPLEMENTED == true

spec/std/isa/ext/F.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ params:
245245
Indicates whether or not the `F` extension can be disabled with the `misa.F` bit.
246246
schema:
247247
type: boolean
248+
extra_validation: assert MISA_CSR_IMPLEMENTED == true
248249
HW_MSTATUS_FS_DIRTY_UPDATE:
249250
description: |
250251
Indicates whether or not hardware will write to `mstatus.FS`

spec/std/isa/ext/H.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ params:
157157
Indicates whether or not the `H` extension can be disabled with the `misa.H` bit.
158158
schema:
159159
type: boolean
160+
extra_validation: assert MISA_CSR_IMPLEMENTED == true
160161
extra_validation: |
161162
# If S mode can be disabled, then H mode must also be disabled since you can't
162163
# be in H mode without S mode

spec/std/isa/ext/M.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ params:
3030
Indicates whether or not the `M` extension can be disabled with the `misa.M` bit.
3131
schema:
3232
type: boolean
33+
extra_validation: assert MISA_CSR_IMPLEMENTED == true

spec/std/isa/ext/Q.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ params:
2727
Indicates whether or not the `Q` extension can be disabled with the `misa.Q` bit.
2828
schema:
2929
type: boolean
30+
extra_validation: assert MISA_CSR_IMPLEMENTED == true

spec/std/isa/ext/S.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ params:
5050
Indicates whether or not the `S` extension can be disabled with the `misa.S` bit.
5151
schema:
5252
type: boolean
53+
extra_validation: assert MISA_CSR_IMPLEMENTED == true
5354
extra_validation: |
5455
# If U mode can be disabled, then S mode must also be disabled since you can't
5556
# be in S mode without U mode

0 commit comments

Comments
 (0)