-
Notifications
You must be signed in to change notification settings - Fork 776
Description
The PMP section says:
riscv-isa-manual/src/machine.adoc
Lines 3301 to 3307 in 98ea4b5
| On some implementations, misaligned loads, stores, and instruction | |
| fetches may also be decomposed into multiple accesses, some of which may | |
| succeed before an access-fault exception occurs. In particular, a | |
| portion of a misaligned store that passes the PMP check may become | |
| visible, even if another portion fails the PMP check. The same behavior | |
| may manifest for stores wider than XLEN bits (e.g., the FSD instruction | |
| in RV32D), even when the store address is naturally aligned. |
Stores with width greater than XLEN are allowed to tear against PMP checks. I didn't realise until I re-read this today that there is no such allowance for loads with width greater than XLEN.
Given loads are used for memory-mapped IO, the lack of tearing on loads is an observable aspect of the core's behaviour. This seems to make it illegal to implement Zilsd with a 32-bit data bus if you allow ld to IO regions and you have a PMP grain G = 0. (Or at least, illegal to implement ld as lw + lw).
I'm hoping this is an oversight given Zilsd was specifically modified in places to make it easier to implement on 32-bit-native RV32 implementations, and the Zilsd spec explicitly gives permission for 32-bit tearing in a few places. Could somebody please clarify?