Introduce PMA handling to Ibex
Nobody has claimed this yet.
- Dominant language
- SystemVerilog
- Stars
- 2.1k
- Forks
- 810
- Avg merge
- 5d 23h
- Merged PRs (30d)
- 9
Description
In the OT repo we have been discussing whether we should trigger an alignment fault on any non-aligned access to device memory: https://github.com/lowRISC/opentitan/issues/1868
The best way to accomplish this would be a check in Ibex to see if something is attempting to perform an unaligned access to a device region and trigger an exception if so.
The RISC-V privileged spec allows use of PMA (physical memory attributes) where the properties of memory and what operations are allowable varies by memory address. Unlike PMP it doesn't specify how this should work leaving it up to implementers to decide.
I propose we add an PMA module to Ibex that would be given details of every memory access and be able to trigger faults. For the OT use case we may want something as simple as triggering an alignment fault on any misaligned access with the upper address bit set (or some other similar simple address check) so it needs to be able to implement that without adding extra overhead.
On the other hand we need to ensure other users of Ibex who may have more complex PMA requirements are able to implement them without major modifications.
The PMA module actually supplied in Ibex would be a barebones/no-op module which implementers would replace.
To perform DV we could provide a basic implementation so the OT use case gets tested or have the module implemented as a UVM agent and instead have it act 'randomly' to better test the ability of the PMA to implement arbitary policies.
I can sketch out more details but wanted some feedback on the general concept first.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the RISC-V privileged specification and the related OpenTitan issue 1868, then use the proposed PMA concept in this issue to define the required interface and policy boundaries. Done would require an agreed PMA design that supports the barebones Ibex module and enables the proposed device-memory alignment-fault use case, with a verification approach selected.
Written by the indexing model from the issue text.
Assessment
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100