Skip to content

Commit

Permalink
[CV32A65X] Update PMPADDRn spec to make bit 0 ROCST 0. Update config …
Browse files Browse the repository at this point in the history
…files. (openhwgroup#2651)

Update CV32A65X-annotated privileged ISA specification to reflect the fact that with PMP granularity 8 and only supported PMP address matching modes being OFF and TOR, bit 0 of the pmpaddr0..pmpaddr7 registers can be safely made read-only zero. Update riscv-config specifications and its generated files accordingly.
  • Loading branch information
zchamski authored Dec 9, 2024
1 parent 5ff6b2d commit ed89c71
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 25 deletions.
2 changes: 1 addition & 1 deletion config/gen_from_riscv_config/cv32a65x/csr/csr.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ Description:: Physical memory protection address register
|===
| Bits | Field Name | Reset Value | Type | Legal Values | Description
| [31:0] | PMPADDR[I] | 0x00000000 | WARL | 0x00000000 - 0xFFFFFFFF | Physical memory protection address register
| [31:0] | PMPADDR[I] | 0x00000000 | WARL | masked: & 0xFFFFFFFE \| 0x0 | Physical memory protection address register
|===
[[_PMPADDR8-63]]
Expand Down
10 changes: 5 additions & 5 deletions config/gen_from_riscv_config/cv32a65x/csr/csr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,13 @@ PMPCFG[0-1]
+---------+----------------+---------------+--------+----------------------+------------------------+
| Bits | Field Name | Reset Value | Type | Legal Values | Description |
+=========+================+===============+========+======================+========================+
| [7:0] | PMP[I*4 +0]CFG | 0x0 | WARL | masked: & 0x8f | 0x0 | pmp configuration bits |
| [7:0] | PMP[I*4 +0]CFG | 0x0 | WARL | masked: & 0x8f \| 0x0 | pmp configuration bits |
+---------+----------------+---------------+--------+----------------------+------------------------+
| [15:8] | PMP[I*4 +1]CFG | 0x0 | WARL | masked: & 0x8f | 0x0 | pmp configuration bits |
| [15:8] | PMP[I*4 +1]CFG | 0x0 | WARL | masked: & 0x8f \| 0x0 | pmp configuration bits |
+---------+----------------+---------------+--------+----------------------+------------------------+
| [23:16] | PMP[I*4 +2]CFG | 0x0 | WARL | masked: & 0x8f | 0x0 | pmp configuration bits |
| [23:16] | PMP[I*4 +2]CFG | 0x0 | WARL | masked: & 0x8f \| 0x0 | pmp configuration bits |
+---------+----------------+---------------+--------+----------------------+------------------------+
| [31:24] | PMP[I*4 +3]CFG | 0x0 | WARL | masked: & 0x8f | 0x0 | pmp configuration bits |
| [31:24] | PMP[I*4 +3]CFG | 0x0 | WARL | masked: & 0x8f \| 0x0 | pmp configuration bits |
+---------+----------------+---------------+--------+----------------------+------------------------+


Expand Down Expand Up @@ -462,7 +462,7 @@ PMPADDR[0-7]
+--------+--------------+---------------+--------+-------------------------+---------------------------------------------+
| Bits | Field Name | Reset Value | Type | Legal Values | Description |
+========+==============+===============+========+=========================+=============================================+
| [31:0] | PMPADDR[I] | 0x00000000 | WARL | 0x00000000 - 0xFFFFFFFF | Physical memory protection address register |
| [31:0] | PMPADDR[I] | 0x00000000 | WARL | masked: & 0xFFFFFFFE \| 0x00000000 | Physical memory protection address register |
+--------+--------------+---------------+--------+-------------------------+---------------------------------------------+


Expand Down
8 changes: 8 additions & 0 deletions config/gen_from_riscv_config/cv32a65x/spike/spike.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ spike_param_tree:
tdata2_accessible: 0
tdata3_accessible: 0
tselect_accessible: 0
pmpaddr0_write_mask: 0xFFFFFFFE
pmpaddr1_write_mask: 0xFFFFFFFE
pmpaddr2_write_mask: 0xFFFFFFFE
pmpaddr3_write_mask: 0xFFFFFFFE
pmpaddr4_write_mask: 0xFFFFFFFE
pmpaddr5_write_mask: 0xFFFFFFFE
pmpaddr6_write_mask: 0xFFFFFFFE
pmpaddr7_write_mask: 0xFFFFFFFE
mhartid: 0
mvendorid_override_mask : 0xFFFFFFFF
mvendorid_override_value: 1538
Expand Down
16 changes: 8 additions & 8 deletions config/riscv-config/cv32a65x/generated/isa_gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3165,7 +3165,7 @@ hart0:
warl:
dependency_fields: []
legal:
- pmpaddr0[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr0[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
fields: []
Expand All @@ -3186,7 +3186,7 @@ hart0:
warl:
dependency_fields: []
legal:
- pmpaddr1[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr1[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
fields: []
Expand All @@ -3207,7 +3207,7 @@ hart0:
warl:
dependency_fields: []
legal:
- pmpaddr2[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr2[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
fields: []
Expand All @@ -3228,7 +3228,7 @@ hart0:
warl:
dependency_fields: []
legal:
- pmpaddr3[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr3[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
fields: []
Expand All @@ -3249,7 +3249,7 @@ hart0:
warl:
dependency_fields: []
legal:
- pmpaddr4[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr4[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
fields: []
Expand All @@ -3270,7 +3270,7 @@ hart0:
warl:
dependency_fields: []
legal:
- pmpaddr5[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr5[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
fields: []
Expand All @@ -3291,7 +3291,7 @@ hart0:
warl:
dependency_fields: []
legal:
- pmpaddr6[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr6[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
fields: []
Expand All @@ -3312,7 +3312,7 @@ hart0:
warl:
dependency_fields: []
legal:
- pmpaddr7[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr7[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
fields: []
Expand Down
16 changes: 8 additions & 8 deletions config/riscv-config/cv32a65x/spec/isa_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ hart0: &hart0
warl:
dependency_fields: []
legal:
- pmpaddr0[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr0[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
rv64:
Expand All @@ -1453,7 +1453,7 @@ hart0: &hart0
warl:
dependency_fields: []
legal:
- pmpaddr1[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr1[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
rv64:
Expand All @@ -1466,7 +1466,7 @@ hart0: &hart0
warl:
dependency_fields: []
legal:
- pmpaddr2[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr2[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
rv64:
Expand All @@ -1479,7 +1479,7 @@ hart0: &hart0
warl:
dependency_fields: []
legal:
- pmpaddr3[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr3[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
rv64:
Expand All @@ -1492,7 +1492,7 @@ hart0: &hart0
warl:
dependency_fields: []
legal:
- pmpaddr4[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr4[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
rv64:
Expand All @@ -1505,7 +1505,7 @@ hart0: &hart0
warl:
dependency_fields: []
legal:
- pmpaddr5[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr5[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
rv64:
Expand All @@ -1518,7 +1518,7 @@ hart0: &hart0
warl:
dependency_fields: []
legal:
- pmpaddr6[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr6[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
rv64:
Expand All @@ -1531,7 +1531,7 @@ hart0: &hart0
warl:
dependency_fields: []
legal:
- pmpaddr7[31:0] in [0x00000000:0xFFFFFFFF]
- pmpaddr7[31:0] bitmask [0xFFFFFFFE, 0x00000000]
wr_illegal:
- unchanged
rv64:
Expand Down
4 changes: 1 addition & 3 deletions docs/riscv-isa/src/machine.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4346,9 +4346,7 @@ ifdef::archi-CVA6[]
[{ohg-config}] The PMP grain is 8 bytes (latexmath:[$2^{G+2}$] with G = 1)
and must be the same across all PMP regions.
As latexmath:[${\tt pmpcfg}_i$].A[1] is always clear, i.e. the mode is OFF or TOR,
then bit latexmath:[${\tt pmpaddr}_i$][0] read as zero. Bit
latexmath:[${\tt pmpaddr}_i$][0] does not affect the TOR address-matching
logic.
then bit latexmath:[${\tt pmpaddr}_i$][0] is read-only zero.
endif::[]

ifeval::[{note} == true]
Expand Down

0 comments on commit ed89c71

Please sign in to comment.