Skip to content

Commit

Permalink
Make support for menvcfg.CBIE == 01 optional (#191)
Browse files Browse the repository at this point in the history
* Make support for menvcfg.CBIE == 01 optional

* Added new parameter to generic_rv64 params.yaml

* Fix typo
  • Loading branch information
dhower-qc authored Oct 25, 2024
1 parent 1227ca2 commit a5dce13
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion arch/csr/menvcfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ menvcfg:
definedBy: Zicbom
type: RW-R
sw_write(csr_value): |
if (csr_value.CBIE == 0 || csr_value.CBIE == 1 || csr_value.CBIE == 3) {
if ((csr_value.CBIE == 0) ||
(ALLOW_CBO_INVAL_UPGRADE_TO_FLUSH && (csr_value.CBIE == 1)) ||
(csr_value.CBIE == 3)) {
return csr_value.CBIE;
} else {
return CSR[menvcfg].CBIE;
Expand Down
11 changes: 10 additions & 1 deletion arch/ext/Zicbom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@ Zicbom:
The observable size of a cache block, in bytes
also_defined_in: [Zicboz, Zicbop]
schema:
type: integer
type: integer
ALLOW_CBO_INVAL_UPGRADE_TO_FLUSH:
description: |
When true, an implementation can (when `menvcfg.CBIE` == `01`) upgrade a `cbo.inval`
instruction to a `cbo.flush`.
When false, an implementation does not support the upgrade, and the value '01' cannot be
written to `menvcfg.CBIE`.
schema:
type: boolean
1 change: 1 addition & 0 deletions cfgs/generic_rv64/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -514,3 +514,4 @@ params:
MSTATUS_FS_WRITEABLE: true
MSTATUS_TVM_IMPLEMENTED: true
HW_MSTATUS_FS_DIRTY_UPDATE: precise
ALLOW_CBO_INVAL_UPGRADE_TO_FLUSH: true

0 comments on commit a5dce13

Please sign in to comment.