Skip to content

Commit a5dce13

Browse files
authored
Make support for menvcfg.CBIE == 01 optional (#191)
* Make support for menvcfg.CBIE == 01 optional * Added new parameter to generic_rv64 params.yaml * Fix typo
1 parent 1227ca2 commit a5dce13

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

arch/csr/menvcfg.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ menvcfg:
246246
definedBy: Zicbom
247247
type: RW-R
248248
sw_write(csr_value): |
249-
if (csr_value.CBIE == 0 || csr_value.CBIE == 1 || csr_value.CBIE == 3) {
249+
if ((csr_value.CBIE == 0) ||
250+
(ALLOW_CBO_INVAL_UPGRADE_TO_FLUSH && (csr_value.CBIE == 1)) ||
251+
(csr_value.CBIE == 3)) {
250252
return csr_value.CBIE;
251253
} else {
252254
return CSR[menvcfg].CBIE;

arch/ext/Zicbom.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,13 @@ Zicbom:
1414
The observable size of a cache block, in bytes
1515
also_defined_in: [Zicboz, Zicbop]
1616
schema:
17-
type: integer
17+
type: integer
18+
ALLOW_CBO_INVAL_UPGRADE_TO_FLUSH:
19+
description: |
20+
When true, an implementation can (when `menvcfg.CBIE` == `01`) upgrade a `cbo.inval`
21+
instruction to a `cbo.flush`.
22+
23+
When false, an implementation does not support the upgrade, and the value '01' cannot be
24+
written to `menvcfg.CBIE`.
25+
schema:
26+
type: boolean

cfgs/generic_rv64/params.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,3 +514,4 @@ params:
514514
MSTATUS_FS_WRITEABLE: true
515515
MSTATUS_TVM_IMPLEMENTED: true
516516
HW_MSTATUS_FS_DIRTY_UPDATE: precise
517+
ALLOW_CBO_INVAL_UPGRADE_TO_FLUSH: true

0 commit comments

Comments
 (0)