Overview
A Memory Management Unit (MMU) is a hardware component that translates virtual addresses to physical addresses and enforces memory-access protection. The provided evidence discusses the MMU in three contexts:
- As a verification target for RISC-V processors, where directed suites target virtual-memory and protection behavior.[1][2]
- As an optional hardware block in the open-source ultraembedded/riscv core, where basic MMU support enables booting Linux (using SW-emulated atomics for the A extension).[3]
- As a security/comparison reference against alternative isolation mechanisms (e.g., CHERI capability isolation, MPUs) in embedded systems without an MMU.[4]
- As the conceptual basis for the PIM-MMU architecture, which applies MMU-style address translation and scheduling to processing-in-memory systems.[5]
RISC-V virtual memory schemes (Sv39 / Sv48)
In RISC-V, Sv39 and Sv48 are virtual memory schemes that use 39-bit and 48-bit virtual addresses, respectively. They define multi-level page table structures for address translation and are key targets for MMU-related verification.[6]
MMU in the ultraembedded/riscv core
The ultraembedded/riscv core is a 32-bit RISC-V CPU core written in Verilog, supporting the RV32IMZicsr ISA. It includes optional basic MMU support that is "capable of booting Linux with atomics (RV-A) SW emulation."[3]
Key configuration parameter related to the MMU in this core:
| Param Name | Valid Range | Description |
|---|---|---|
SUPPORT_MMU |
1/0 | Enable basic memory management unit. |
The core also supports user, supervisor, and machine mode privilege levels (supervisor/user modes gated by SUPPORT_SUPER), instruction/data caches, and AXI bus interfaces.[3]
Verification of the core has been performed using Google's RISCV-DV random instruction sequences with cosimulation against a C++ ISA model (exactstep).[3]
MMU as a verification target
In commercial RISC-V verification flows, the MMU is treated as a critical privilege-related verification area alongside PMP, ePMP, hypervisor, and vector features.[7]
MMU-related behavior is difficult to cover with random testing alone. Features such as privilege-mode transitions, page table walks, and memory protection may not be fully exercised by random generation.[8]
Hybrid verification methodology
MMU verification is presented as part of a hybrid RISC-V verification methodology that combines constrained-random stimulus with directed test suites. Constrained-random testing is used for broad exploration, while directed suites are used to close coverage gaps in specific feature areas.[1]
The ImperasTS family includes TS-MMU / PMP / ePMP directed suites for virtual memory and protection features. The evidence specifically describes TS-MMU as a directed suite for virtual memory management and notes that these suites can be configured to match the user's RISC-V processor.[2]
Page-table walks, Sv39/Sv48, and TLB flush logic
Coverage analysis can reveal weak points in Sv39 and Sv48 page table walks. In one cited example, adding TS-MMU tests after such coverage analysis exposed a subtle ordering issue in TLB flush logic.[9]
Constrained-random stimulus with STING has exposed issues including deadlocks in page-table walks, illustrating why MMU-adjacent behavior benefits from broad random exploration as well as directed testing.[10]
Role in coverage closure
MMU verification is part of a coverage-closure loop. A typical workflow starts with constrained-random sweeps using STING, then applies functional coverage analysis with ImperasFC. Coverage gaps are highlighted, results can be merged in Verdi, and failing cases can be replayed deterministically in VCS.[11]
The evidence recommends applying targeted ImperasTS suites for compliance, MMU, PMP, and vector extensions where coverage gaps remain.[12]
MMU vs. alternative isolation mechanisms (CHERI on MMU-less systems)
The MMU is also referenced as a baseline for isolation guarantees in security research. A case study on securing MMU-less Linux argues that such systems "lack security because it does not have protection or isolation mechanisms," and that MPUs are not used because of their "coarse-grained protection with fixed number of protected regions."[4]
The study uses CHERI (a hardware-software capability system) to provide isolation "similar to what the MMU offers (i.e., user programs cannot access each other's memory)" by isolating user programs as separate ELFs with distinct CHERI capability tables, and isolating the kernel via its own capability table.[4]
PIM-MMU (processing-in-memory variant)
The term MMU is also applied to a processing-in-memory context. PIM-MMU is described as "a hardware/software codesign that enables energy-efficient DRAM to/from PIM transfers for PIM systems." It synergistically combines a hardware-based data copy engine, a PIM-optimized memory scheduler, and a heterogeneity-aware memory mapping function. Reported results include 4.1× average improvement in DRAM-to/from-PIM transfer throughput and energy efficiency, leading to a 2.2× end-to-end speedup for real-world PIM workloads.[5]
Related concepts
- STING: Generates constrained-random and directed RISC-V tests and is reported as effective at stressing privilege levels, memory protection, CSRs, and hypervisor extensions.[13]
- ImperasTS TS-MMU: Directed suite for virtual memory management and protection-related verification.[2]
- Sv39 / Sv48: RISC-V virtual memory schemes relevant to page-table-walk coverage.[6]
- PMP / ePMP: Memory protection features often verified alongside MMU-related functionality; restrict memory-region access for privilege, isolation, and security policies.[14]
- ultraembedded/riscv: 32-bit RISC-V CPU core with optional basic MMU support sufficient to boot Linux.[3]
- CHERI: Capability-based alternative providing MMU-like isolation in MMU-less Linux configurations.[4]
- PIM-MMU: MMU-style architecture for accelerating data transfers in processing-in-memory systems.[5]
[7]: The hybrid verification flow treats MMU as a critical RISC-V privilege-related verification area.
[8]: Random testing may miss page table walks and related privilege or protection behavior.
[1]: Hybrid constrained-random and directed testing is recommended for RISC-V verification.
[2]: ImperasTS includes TS-MMU / PMP / ePMP directed suites for virtual memory and protection features.
[6]: Sv39 and Sv48 define multi-level RISC-V virtual-memory page-table structures using 39-bit and 48-bit virtual addresses.
[9]: TS-MMU tests exposed a TLB flush ordering issue after Sv39/Sv48 page-table-walk coverage gaps were found.
[10]: STING exposed deadlocks in page-table walks.
[11]: Coverage closure flow uses STING, ImperasFC, Verdi, and VCS.
[12]: Targeted ImperasTS suites are recommended for MMU coverage gaps.
[13]: STING stresses privilege and memory-protection-related RISC-V areas.
[14]: PMP and ePMP restrict memory-region access for privilege, isolation, and security policies.
[3]: The ultraembedded/riscv core is a 32-bit RISC-V Verilog CPU with optional basic MMU support capable of booting Linux using SW-emulated RV-A atomics; configurable via the SUPPORT_MMU parameter.
[4]: MMU-less Linux lacks protection/isolation; CHERI is proposed to provide MMU-like spatial memory safety in such systems by isolating user programs as separate ELFs and isolating the kernel via separate capability tables.
[5]: PIM-MMU is a hardware/software codesign providing energy-efficient DRAM-to/from-PIM transfers via a data copy engine, PIM-optimized memory scheduler, and heterogeneity-aware memory mapping.