MMU¶
Overview¶
Status: RTL complete, interim documentation
The MMU as built so far, the ITLB, the shared page table walker and the PMP and PMA checker, and the planned DTLB and L2 TLB.
Related: IA tasks: BP-123, BP-124, SYS-001; Frontend demo: fd14_translation: Sv39 Walk, Sv39x4 Nested Walk and Svadu CAS
Working specification
This page shows the planning documents and specifications for RTL tag fe-1.0.0.
mmu_decisions.md
planning/arch/mmu_decisions.md on GitHub
MMU Decisions¶
FILE: mmu_decisions.md
SOURCE: session-069
STATUS: DRAFT
UPDATED: 2026-10-14
CONTACT: Jeff Nye
Owns the MMU-N, TD-MMU-N and MMU-UN registries.
Scope is the page table walker and the PMP and PMA checkers. There
is no L2 TLB now (MMU-1, session-077); what this document says about
one is the plan for when it is added. The L1 instruction TLB is in
itlb_decisions.md. The L1 data TLB does not exist. Everything here
is shared I and D by construction, which is why it is not in the
ITLB document.
1. Origin¶
icache_decisions.md L1I-U3 and L1I-U4, both ruled session-069.
U4 was unrecommended and the recommendation was made and ruled in
the same session.
The walker is written from this document, the way the bpu and the ftq were written from theirs. It is not a cachegen node. What L1I-U3 reaches into cachegen for is one thing only, and only once an L2 exists: the l2 must accept a third master, and the l2 is emitted. That is MMU-U3.
MMU-1 WAS REVERSED session-077: there is no L2 TLB now, and the ITLB is the walker's client directly.
2. Topology¶
MMU-1 THERE IS NO L2 TLB NOW. An ITLB miss goes directly to the
page table walker. The walker is shared by the instruction
and data sides; the DTLB, when it exists, is its second
client. An L2 TLB is a later performance step, added with
the DTLB and placed behind the same client port
(itlb_l2tlb_interfaces.md). RULED session-077 (Jeff),
REVERSING the session-069 rule, which read "One shared L2
TLB serving the instruction and data sides. The page table
walker is inside it."
MMU-1a THE WALKER IS OUTSIDE THE FRONT-END TOP, at rtl/mmu/ptw.
It is shared I and D, and FE-U10 puts the front-end
boundary between the ITLB and the shared translation level.
tb_fe_top instantiates the front-end top and the walker
beside it. Ruled session-077 (Jeff). BUILT by BP-123.
MMU-2 The walker reaches memory through its own port,
`ptw_mem_interfaces.md`: an 8-byte read and an 8-byte
compare-and-swap. A testbench memory model answers it,
sharing one memory image with the model that answers the
L1I's memory port (fe_decisions.md FE-21). THE L2 PLAN
STANDS: when an L2 exists the walker's traffic goes on a
master edge into it, alongside up_i and up_d, and
icache_decisions.md L1I-25 rests on that. Ruled session-077
(Jeff). This read "It drives a TileLink master port into
l2, alongside up_i and up_d."
MMU-3 The L1 TLBs are clients of the walker, on the port of
`itlb_l2tlb_interfaces.md`. A client miss is presented to
the walker and starts a walk. This read "A client miss is
presented to the L2 TLB; an L2 TLB miss starts a walk."
The D side has no client yet. The walker is built with one client and the second arrives with the DTLB.
MMU-U1 CLOSED session-077 by MMU-1: there is no L2 TLB to size.
Its geometry, and how a set-associative array holds a
64 KiB NAPOT entry (MMU-U7), are decided when the L2 TLB is
added. It read: "L2 TLB entry count, associativity and
page-size handling. Comparable points: Neoverse N1 and N2
at 1280 entries 5-way, Neoverse V2 and Cortex X2 at 2048
8-way, Zen 2 with a split 512-entry 8-way L2 ITLB and
2048-entry 12-way L2 DTLB."
3. Walker¶
MMU-4 The walker issues physical addresses directly. They do not
pass through any L1 TLB.
MMU-5 Walk reads and the Svadu update of MMU-8 go out on the
MMU-2 port. This read "Walk reads go out on the MMU-2
master edge."
MMU-U2 CLOSED session-077 (Jeff). THE WALKER PERFORMS ONE WALK AT
A TIME. A client request that arrives while a walk is in
progress is answered retry (itlb_l2tlb_interfaces.md IL-6).
This matches the ITLB's tracker depth of 1 (ITLB-15). More
concurrent walks are a later performance step, measured
with the TD#128 harness. It read: "How many walks may be
outstanding. The l2 slave holds one transaction, TD#118, so
concurrent walks serialise there until that is fixed."
3a. Two-stage translation¶
H is MANDATORY in RVA23 through Sha, so every translation this MMU performs is potentially two-stage.
MMU-19 The MMU supports both single-stage and two-stage
translation. `V=0` accesses translate through `satp` only.
`V=1` accesses translate through `vsatp` for the VS-stage
and `hgatp` for the G-stage.
MMU-19a M-MODE FETCH IS NOT TRANSLATED, whatever satp holds.
mstatus.MPRV affects loads and stores only. Accepted
session-075 (Jeff) as BP-118 built it.
MMU-20 Shvsatpa: every translation mode supported in `satp` is
supported in `vsatp`. Shgatpa: for each SvNN supported in
`satp` the corresponding `hgatp` SvNNx4 mode is supported,
and `hgatp` mode Bare is supported. Pacino is Sv39, so the
G-stage is Sv39x4 and its root table is four times the
normal size.
THE GUEST PHYSICAL ADDRESS IS 41 BITS, ZERO EXTENDED.
Sv39x4 widens the incoming address by two bits and requires
bits 63:41 to be zero or the access guest-page faults. With
`V=1` and `vsatp.MODE=Bare` that address is the fetch PC
itself, which is why VA_WIDTH is 41 and GPA_WIDTH = 41.
fe_decisions.md FE-19, TD#122.
MMU-21 The walk is NESTED, not sequential. Every address the
VS-stage walk produces is a guest physical address and
needs its own G-stage walk before it can be used. A
three-level VS-stage walk therefore costs up to four
G-stage walks, one per VS-stage PTE fetch plus one for the
final guest physical address.
MMU-21 is the reason the outstanding walk count matters more than it did. A single two-stage walk occupies the walker for far longer than a single-stage one. MMU-U2 is ruled at one walk for now.
MMU-22 The MMU raises a GUEST page fault when the G-stage fails
and an ordinary page fault when the VS-stage or a
single-stage walk fails. They are distinct causes; see
section 7.
MMU-23 Shtvala: `htval` is written with the faulting guest
physical address on a guest page fault. The MMU produces
that address; the trap path writes it. THE FAULTING GPA IS
FAULT_GPA_WIDTH = 56 BITS, not GPA_WIDTH: a VS-stage PTE
carries a 44-bit PPN, so a walk can form a guest physical
address of up to 56 bits that faults under Sv39x4 (MMU-28),
and Shtvala requires htval to carry it in all circumstances
the ISA permits. It travels on `l2t_itlb_gpa` and
`itlb_ifu_gpa`, both declared `[FAULT_GPA_WIDTH-1:0]`, and
in `ifu_pd_pkt_t.fault_gpa`. GPA_WIDTH stays 41 everywhere
else: it is the width of an address that translates. RULED
session-077 (Jeff), after BP-123; BUILT by BP-124. This read
"IT IS GPA_WIDTH = 41 BITS (MMU-20)", which left a GPA above
bit 40 with no representation; MMU-30 papered over it with a
zero sentinel that collides with guest page 0 (BP-123,
risk 1). Before session-074 it read that the widths were
defined nowhere.
For kind 00 (MMU-29) the walker returns the faulting GPA's
page and the IFU fills the page offset from the faulting
halfword's virtual address (ifu_decisions.md IFU-2a). For
kinds 01 and 10 the GPA is the guest physical address of
the VS-stage PTE. Built by BP-123 (D5); unconditional since
the sentinel is gone.
MMU-24 The MMU reads the translation regime from the CSR file
directly: `satp.PPN` for a single-stage root, `vsatp.PPN`
and `hgatp.PPN` for the two stages, the MODE fields, and
the ADUE bits of MMU-7 and MMU-7a.
MMU-25 It does NOT hold a current ASID or VMID. Those are
identity, they belong to the request, and the client sends
them. `itlb_l2tlb_interfaces.md` IL-3 and IL-3c.
MMU-26 THE WALKER CHECKS G-STAGE PERMISSIONS and returns cause 20
on a failure. Every G-stage access is treated as a
user-mode access, so the result does not depend on the
current privilege and can be decided once, at walk time.
VS-stage and single-stage permissions are checked by the L1
TLB on every hit (itlb_decisions.md ITLB-16), because
privilege changes without a fence. Ruled session-075 (Jeff).
THE WALKER ALSO CHECKS THEM, ONCE, BEFORE IT SETS A
(MMU-8c). The ITLB's check on every hit stands; the
walker's check exists so a walk never sets A on a PTE whose
permission check fails. Session-077. This said the L1 TLB
checks them "instead".
MMU-26a THE WALKER CHECKS THE PRIVILEGE-INDEPENDENT LEAF
PERMISSIONS: X for a fetch and W for a store, and at the
G-stage U and the access type. Built by BP-123 (D8). D8's
other half, U against the privilege left to the ITLB alone,
is modified by MMU-8c (session-077, Jeff). This read "R for
a load (with the DTLB)" as well, which D8 does not say. R
FOR A READ IS CHECKED NOW, with MXR clear until the DTLB
presents it, so a read on an execute-only leaf never sets A
on an access that faults: BUILT by BP-124 (D1), accepted
session-077 (Jeff). This read that R for a read "is added
with" the DTLB.
MMU-24a THE WALKER'S CSR INPUTS ARE ITS OWN INPUT GROUP. The
walker is outside the front-end top (MMU-1a), so the
front-end csr group of fe_decisions.md FE-20 does not reach
it. Its group carries satp, vsatp and hgatp PPN and MODE,
menvcfg and henvcfg ADUE and PBMTE, and the PMP registers
for its checker (MMU-11a). The CSR file does not exist; the
testbench drives the group. Ruled session-077 (Jeff).
The walker samples the group when a walk starts and holds
it for that walk: a walk that began under one regime may
complete under it (supervisor chapter, satp: translations
that began while satp was active need not terminate when it
changes). Built by BP-123 (its Assumption 7); CONFIRMED
session-079 (Jeff). The sampled members are MODE, PPN, ADUE
and PBMTE; the walker's PMP checker reads the PMP registers
every cycle. Since SYS-001 the group is the ptw_csr_t port
(csr_decisions.md CSR-6).
MMU-24c THE REQUEST CARRIES THE ACCESS TYPE AND THE PRIVILEGE.
`itlb_l2t_acc [1:0]` (0 read, 1 write, 2 execute, 3
reserved) selects the leaf permission of MMU-26a and the D
update of MMU-8. Built by BP-123 (D2) on the walker only,
accepted session-077 (Jeff); tb_fe_top ties it to execute.
BP-124 has the ITLB drive it, always execute, and fe_top
carry it (BUILT), as itlb_l2tlb_interfaces.md 2 lists it.
`itlb_l2t_priv [1:0]` (2'b00 U, 2'b01 S; 2'b10 is reserved and 2'b11 is
M, neither ever presented, M-mode fetch being untranslated, MMU-19a)
together with `itlb_l2t_v` is the effective privilege the walk checks U
against (MMU-8c). The ITLB presents its own current privilege from its
CSR group (ITLB-17). RULED session-077 (Jeff), after BP-123; built by
BP-124. SUM and MXR, which a DTLB request will also need, are added with
the DTLB: nothing would drive them before it exists.
THE CAUSE FOLLOWS THE ACCESS TYPE, as the privileged
specification numbers them: a page fault is 12, 13 or 15
for execute, read or write; a guest-page fault 20, 21 or
23; an access fault 1, 5 or 7. The ITLB sees only 1, 12 and
20 (MMU-16), since it presents execute. Added session-077 by
the PA so that tb_ptw's read and store cases have defined
causes; flagged for Jeff. Having the ITLB drive
`itlb_l2t_acc` (above) is likewise a PA addition, flagged.
MMU-24b THE ROOT POINTERS ALWAYS FIT. The CSR file implements
`satp.PPN` and `hgatp.PPN` at PPN_WIDTH bits and
`vsatp.PPN` at GPA_WIDTH - 12 = 29 bits, the bits above
read-only zero. The privileged specification lets satp.PPN
hold fewer than all physical page numbers, and the hgatp
fields are WARL; vsatp.PPN is narrowed on the same footing
as satp.PPN, whose role it takes at V=1. A root can then
never name an address this implementation cannot form, and
MMU-28 applies to PTEs only. No CSR file exists, so this is
an obligation on it, and the walker's root inputs are
declared at those widths. Ruled session-077 (Jeff).
MMU-27 THE SIZE OF A TWO-STAGE TRANSLATION is the SMALLER of the
VS-stage leaf size and the G-stage leaf size for the final
guest physical address, and the PPN returned is the final
supervisor physical page at that size
(itlb_l2tlb_interfaces.md IL-7). This holds for the 64 KiB
NAPOT size at either stage: if the smaller size is 64 KiB,
PA[15:12] equals VA[15:12] through both stages, so the
ITLB's PPN[3:0] substitution (MMU-U7) is right. Stated
session-077; no document had said it.
The line between MMU-24 and MMU-25 is that identity is a property of one request and the regime is not. A root pointer is not something one request has and another does not.
4. A and D bits¶
MMU-6 Both Svade and Svadu are supported. CONFIRMED session-077
(Jeff), after a session-076 recommendation to narrow to
Svade alone. Svade is mandatory in RVA23S64 and Svadu is an
expansion option (rva23-profile.adoc); with ADUE clear the
hardware behaves exactly as Svade, so supporting both loses
nothing.
MMU-7 `menvcfg.ADUE` selects the behaviour at runtime. With ADUE
clear the walker raises a page fault when A is clear on
access or D is clear on write, which is Svade. With ADUE
set the walker updates the bits in memory, which is Svadu.
MMU-7a For a `V=1` access, `henvcfg.ADUE` selects the behaviour of
the VS-stage. `menvcfg.ADUE` continues to govern the
G-stage. The two stages of one nested walk can therefore
be under different rules at the same time. `henvcfg.ADUE`
is read-only zero when `menvcfg.ADUE` is zero (machine
ISA, menvcfg); that is the CSR file's rule, and the walker
reads both bits as given.
MMU-8 THE SVADU UPDATE IS A COMPARE AND STORE, the privileged
translation algorithm's step 9. When ADUE selects Svadu for
the stage and the leaf PTE has A clear (fetch never needs
D), the walker:
- checks that a STORE to the PTE passes PMP and PMA
(MMU-10d, MMU-12a); otherwise access fault, cause 1;
- compares the PTE it read against memory and, if they
are equal, stores the PTE with A set, as ONE atomic
operation on the MMU-2 port (ptw_mem_interfaces.md);
- if they are not equal, restarts the walk from step 2.
Every check of the leaf is made before the update. The
translation is returned to the client only after the update
has completed, so the update precedes the fetch that needed
it in the global order, as the specification requires.
The walker also holds the D update for the data-side client;
until a DTLB exists it is checked at walker unit level only.
This read "The Svadu update is atomic with respect to other
harts. The walker performs it as a read-modify-write that
cannot be split." A read-modify-write does not compare, and
the compare is what stops the walker setting A on a PTE
software changed after it was read. Corrected session-077.
MMU-8a UNDER H, a VS-stage PTE is in guest physical memory, so its
update is a store through the G-stage. The G-stage leaf
must grant write, checked as an implicit store at user
level (MMU-26), and the update sets the G-stage leaf's A
and D under `menvcfg.ADUE`, or raises a guest-page fault
under Svade at the G-stage. A failure is cause 20, reported
for the original access type, with implicit-access kind
WRITE (MMU-29). Stated session-077 from the hypervisor
chapter, two-stage address translation.
MMU-8b SPECULATION. A walk for a wrong-path fetch may set A: the
specification permits A updates as a result of speculation,
and permits a VS-stage A update only when the effective
mode is VS or VU, which every `V=1` fetch is. The G-stage D
set by a VS-stage update may be speculative only when the
G-stage PTE grants write, which MMU-8a requires anyway. A
walk killed by an invalidate (ITLB-14) may already have set
A; that is permitted. Stated session-077.
MMU-8c THE WALKER SETS A ONLY ON A PERMITTED ACCESS. Before the
update of MMU-8 on a leaf, EVERY check the translation algorithm makes
on that leaf before step 9 has passed: the reserved-encoding checks
(MMU-U6, MMU-U7), the permission checks of MMU-26a, the
misaligned-superpage check (these three are a PA addition beyond the
ruling, flagged for Jeff), and the leaf's U bit against the request's
privilege and V (MMU-24c): a fetch at U or VU needs U set; a fetch at S
or VS needs U clear (SUM does not apply to fetch). On a failure it
returns the fault and writes nothing. This is the order of the
privileged translation algorithm: the permission checks are steps 6 to 8
and the A/D update is step 9, and a speculative walk behaves as a
non-speculative one except that it sets no D and raises no exception
(supervisor chapter). A VS-stage leaf's A is set before its GPA is
translated by the G-stage, which the hypervisor chapter adds at the end
of the VS-stage walk, so a G-stage fault on that GPA may follow a VS A
update (permitted, MMU-8b). RULED session-077 (Jeff), after BP-123;
BUILT by BP-124. Until the DTLB adds SUM to the request (MMU-24c), a
read or write request's U check is made with SUM clear, the
architectural result for that value; added by the PA, flagged for Jeff,
so that tb_ptw's read and store cases have a defined U rule. BP-123
built the walker with the U check left to the ITLB alone (D8), so a
fetch that faulted on U could leave A set (BP-123, risk 2). BP-124
showed the walker's other checks already preceded the update
(reversions B3, B4), added the U and R checks, and binds W11 in
ptw_assert: no CAS on a leaf that fails a check.
The ITLB holds a walk fault for the re-request (ITLB-10a);
because this fault depends on the privilege, every held
fault records the privilege and V it was raised at
(ITLB-10b).
MMU-9 The MMU-2 port is not read-only: it carries the
compare-and-swap of MMU-8. Supporting Svadu fixes the port
type, which is why MMU-6 is recorded here and not left
implicit; Svade alone would have permitted a read-only
port. This read that the edge's TileLink conformance level
must include atomics; that is the L2 plan, MMU-U3.
MMU-U3 OPEN, MOVED TO THE L2 WORK (session-077). Two parts. How the
compare-and-swap of MMU-8 is carried when the walker's port
goes into an L2 (MMU-2): TileLink's atomic operations, as
the PA recalls them, include no compare-and-swap, so either
the L2 adds one or the walker builds it from another
primitive; check the TileLink specification before the L2
task. And whether the emitted l2 needs a schema or emitter
change to accept a third master. Neither is needed while a
testbench answers the port. This read "Whether the MMU-8
atomic is a TileLink AMO on the MMU-2 port or a reservation
pair."
5. PMP¶
MMU-10 PMP is checked at two sites. On the translated physical
address before any L1 request is issued (itlb_decisions.md
ITLB-12), and on every address the walker issues. This read
"before an L1 access completes", the response-gating form
ITLB-12 withdrew. Session-071.
MMU-10a ONE CHECKER, SPECIFIED HERE, INSTANTIATED TWICE. The PMP
and PMA checker is one module. Site 1's instance sits with
the ITLB, which has the translated physical address first;
site 2's sits in the walker, whose addresses never reach
an L1 TLB. This document owns the checker's behaviour; it
does not own both instances. BUILT by BP-118 as
rtl/mmu/pmp/rtl/pmp_pma_chk.sv, instantiated inside the
ITLB. References for the PMP rules are in the BP-118
record: tools/spike's csrs.cc and mmu.cc.
MMU-10b Each instance produces cause 1 on its own response path.
The ITLB-side instance drives `itlb_ifu_cause`
(`itlb_ifu_interfaces.md` IT-6); the walker-side instance
drives `l2t_itlb_cause` (`itlb_l2tlb_interfaces.md`
IL-10). Neither the IFU nor the ITLB re-checks what the
other produced.
MMU-10c THE IFU NEVER CHECKS. It CONSUMES a result that arrived
with the translation. IT-12 says the results are consumed
by the IFU before it issues an L1I request; that is
consumption, not evaluation.
MMU-10d THE WALKER'S ACCESSES ARE CHECKED AT PRIVILEGE S, whatever
the current privilege: the machine ISA, PMP and paging,
gives the effective privilege of implicit page-table
accesses as S. A PTE read is checked as a read and the
Svadu update of MMU-8 as a write. The checker therefore
takes an access type and a privilege; the walker's
instance always presents S. The walker's instance sits in
rtl/mmu/ptw. Ruled session-077 (Jeff), checked against
machine.adoc.
Two sites are forced, not chosen. MMU-4 has walk addresses bypass the L1 TLBs, so a single checker at the L1 boundary would leave walk traffic unchecked. CVA6 checks PMP on every access a walk makes for the same reason.
MMU-11 16 PMP entries, with TOR and NAPOT address matching. The
count is a parameter. THE GRAIN IS 4 KiB, G = 10, accepted
session-075 (Jeff) as BP-118 built it: the ITLB checks one
page base per entry, which is exact only when no PMP
boundary falls inside a page, and a 4 KiB grain guarantees
that. The privileged specification leaves G to the
platform.
MMU-11a THE CHECKER READS THE PMP REGISTERS AS INPUTS. The pmpcfg
and pmpaddr values and the current privilege come in on a
CSR input group; the checker holds no CSR. Each instance
takes the group from its parent. For the ITLB-side
instance that group crosses the front-end boundary
(fe_decisions.md FE-20), because the CSR file does not
exist. Ruled session-075 (Jeff).
MMU-U4 CLOSED session-070. Smepmp is NOT mandatory in RVA23S64.
The full mandatory privileged list was read from the
ratified `rva23-profile.adoc`: Ss1p13, then Svbare, Sv39,
Svade, Ssccptr, Sstvecd, Sstvala, Sscounterenw, Svpbmt and
Svinval carried from RVA22S64, then Svnapot, Sstc,
Sscofpmf, Ssnpm, Ssu64xl and Sha as new. Smepmp is not in
it, nor in the expansion options. MMU-11 is unchanged at 16
entries with TOR and NAPOT. Session-069 saw a partial list;
this is the whole one.
6. PMA¶
MMU-12 PMA IS CHECKED ON EVERY PHYSICAL ACCESS: the final
translated address of a fetch (ITLB-12), and every PTE read
and every Svadu update the walker makes. The privileged
translation algorithm raises an access fault of the
original access type when a PTE access violates a PMA or
PMP check (steps 2 and 9); for a fetch that is cause 1. Not
on the virtual address. This read "PMA is checked on the
final translated physical address only, not on the virtual
address and not mid-walk", which the specification
contradicts. Corrected session-077.
MMU-12a PAGE TABLES MUST BE IN A REGION THAT IS CACHEABLE AND
COHERENT (MMU-13 bits [0] and [1]). A PTE read or update
anywhere else is an access fault, cause 1. Legal: the
machine ISA lets each region say which hardware page-table
reads and writes it supports, Ssccptr requires them only in
cacheable, coherent main memory, and Svadu requires page
tables in memory with hardware page-table write access and
RsrvEventual, which Ziccrse gives main memory. Ruled
session-077 (Jeff).
MMU-13 The attributes carried per region are cacheable, coherent,
executable and idempotent. Wherever they travel as a
PMA_WIDTH vector the positions are [0] cacheable,
[1] coherent, [2] executable, [3] idempotent. Session-074,
as BP-116 built it (itlb_ifu_interfaces.md IT-10).
MMU-14 Non-idempotent regions are never fetched speculatively and
never prefetched. This binds the L1I-21 prefetch bit: a
prefetch to a non-idempotent region is dropped, not
faulted. The attributes are the EFFECTIVE ones of MMU-U6,
not the region table's alone: a fetch uses the L1I only
when the effective type is cacheable and idempotent, and
otherwise takes the uncached path of `ifu_decisions.md`
IFU-21, which since session-076 goes through the L1I marked
uncached and does not allocate (icache_decisions.md L1I-24).
So a page marked NC or IO never allocates in the L1I. Session-071; this
read "Non-idempotent regions" against the region table only.
MMU-15 PMA comes from a static region table fixed at
configuration, one entry per address range.
MMU-15a THE REGION TABLE IS A PARAMETER OF THE CHECKER, and its
default is one main-memory region and a default for the
rest. Ruled session-075 (Jeff):
0x0_8000_0000 .. 0xF_FFFF_FFFF main memory, 62 GiB
cacheable, coherent,
executable, idempotent
everything else none of the four
Main memory starts at the reset vector (ftq_decisions.md
4.7) and runs to the top of the 36-bit physical space
(l1i_ifu_interfaces.md IF-1). 64 GiB is the whole space at
PA_WIDTH 36, so 62 GiB is the most main memory there can
be above 0x8000_0000; a larger memory needs a wider
PA_WIDTH, which moves PPN_WIDTH, the ITLB entry, l1i_pkg
and cachegen's pa_bits together. The shape is XiangShan's
documented map: main memory from 0x8000_0000 to the top of
the physical space, devices below it, which in pacino are
not yet placed. The table classifies addresses and costs
no storage, so a later device map changes the parameter
and nothing else.
MMU-15b NON-IDEMPOTENT MEMORY IS NEVER EXECUTABLE. The region
table of MMU-15a never marks a region executable unless it
is also idempotent, and the checker rejects such a parameter
at elaboration. An instruction fetch therefore never reads a
device. The only uncached fetch is from main memory whose
PTE makes it NC or IO (MMU-U6), and a whole-line read there
has no side effect, so the uncached path needs no narrow
read. RULED session-076 (Jeff). Closes ifu_decisions.md
IFU-U4. A later device map that wants executable device
memory, such as a boot ROM, places it in an idempotent
region.
itlb_decisions.md ITLB-12 gates the REQUEST: the PMP permission
check, the PMA executable check and the PMA idempotent read all
complete in the IFU's translation pipeline before any L1I request is
issued, so the L1I array is never read for an access that fails
them. MMU-14 stands on its own: a non-idempotent region takes the
uncached path of ifu_decisions.md IFU-21 and is never fetched
speculatively or prefetched, because a read there can have a side
effect whether or not it is permitted.
The split is: PMA decides whether the access may be speculated, PMP decides whether it may be issued.
AN EARLIER REVISION of this paragraph had MMU-14 make ITLB-12 safe, on ITLB-12's withdrawn form: gating the response rather than the request, so the L1I array was read before the check completed and MMU-14 was the precondition for that timing decision. ITLB-12 was revised in session-069 and this paragraph was not. Session-071.
Ssccptr is mandatory in RVA23S64 and requires main memory regions carrying the cacheability and coherence PMAs to support hardware page-table reads. The walker sees the same attributes as the L1 clients.
MMU-U5 CLOSED session-070 AS MANDATORY. `rva23-profile.adoc`
lists Svpbmt, page-based memory types, among the privileged
extensions mandatory in RVA23S64 and carried from RVA22S64.
So the PTE supplies a memory type and IS a second PMA source
alongside MMU-15. The precedence rule is required, not
conditional, and is MMU-U6.
MMU-U6 CLOSED session-071 (Jeff). THE EFFECTIVE MEMORY TYPE IS
THE MOST RESTRICTIVE of the MMU-15 region table, the G-stage
PBMT and the VS-stage PBMT. A PTE can make an access less
cacheable, non-idempotent or strongly ordered, never the
reverse; the region table still decides what the memory is.
Ordered PMA < NC < IO, the walker returns the more
restrictive of the two stages' PBMT as one 2-bit value
(itlb_l2tlb_interfaces.md IL-9), the L1 TLB stores it per
entry, and on a hit combines it with the region attributes
of the physical address. The combination is order-free, so
the specification's G-stage-then-VS-stage override sequence
needs no separate handling.
THIS IS A LEGAL STRICT IMPLEMENTATION OF SVPBMT'S OVERRIDE,
not the override as the specification describes it. The
specification lets NC on an I/O region make accesses
idempotent and weakly ordered, and names write-combining and
speculative access as the use. Those relaxations are
permissions: forgoing speculation is always legal and
stronger ordering always satisfies RVWMO. The cost is on the
D side, where a driver mapping device memory NC gets
strongly-ordered, non-speculative access. XiangShan gates its
uncached path the same way, on the region's MMIO bit OR a
non-PMA PBMT.
WALKER OBLIGATIONS, beside the Svnapot ones of MMU-U7:
PBMT = 3 is reserved and raises a page fault; with PBMTE
clear, bits 62-61 of a leaf PTE must be zero and a non-zero
value raises a page fault; bits 62-61 of a non-leaf PTE are
reserved. THE PBMTE BIT IS PER STAGE: menvcfg.PBMTE governs
single-stage and G-stage translation, henvcfg.PBMTE the
VS-stage (machine chapter, menvcfg; hypervisor chapter,
henvcfg). Cause 12 at a single or VS stage, 20 at the
G-stage (MMU-16). This read "with menvcfg.PBMTE clear, or
henvcfg.PBMTE clear for the G-stage", which has the stages
crossed; BP-123 built it as the specification says (D3) and
the PA had read past it. Corrected session-077.
It read: "Which wins, and what happens when the PTE names a
type the region does not support, is not decided."
6a. Svnapot¶
MMU-U7 SVNAPOT IS MANDATORY. Ruled session-071 for the L1 TLB and
the walker; until session-070 it was absent from every
document in this tree.
`rva23-profile.adoc` lists Svnapot, NAPOT translation
contiguity, among the new mandatory privileged extensions
in RVA23S64. It was optional in RVA22 and is not.
`itlb_decisions.md` ITLB-3 and `itlb_l2tlb_interfaces.md`
IL-7 named three Sv39 page sizes, 4 KiB, 2 MiB and 1 GiB,
until session-071; both now name four. Svnapot adds the
64 KiB contiguous case through the
PTE N bit, so there is a fourth. `l2t_itlb_size` is two
bits, which encodes four, so the port width survived; IL-7's
wording and the ITLB's install path, written for three, were
updated session-071.
THIS DOCUMENT HAS NO L2 TLB PAGE-SIZE DECISION TO CONTRADICT.
There is no L2 TLB now (MMU-1, session-077); its entry count,
associativity and page-size handling are decided when it is
added (MMU-U1, closed). So Svnapot enlarges that later work
rather than overturning anything decided here, and it is the
L1 side, ITLB-3 and IL-7, that carries a stated three. This
read "are MMU-U1, unresolved".
IT REACHES THE G-STAGE, NOT ONLY THE TLB ARRAYS. Privileged
11.1.7 states that when the hypervisor extension is
implemented, Svnapot is also supported in G-stage
translation. H is mandatory here, so the walker of MMU-4 and
the nested walk of MMU-21 must honour the PTE N bit at both
stages, and a NAPOT G-stage PTE can cover a range of the
guest physical addresses a VS-stage walk produces.
The encoding is one case: N=1 with ppn[0] = xxxx1000 is a
64 KiB contiguous region. Every other N=1 encoding in
Table 7 is reserved and MUST raise a page fault, which is a
walker obligation, not a TLB one.
RULED session-071 (Jeff):
- a NAPOT entry is HELD ONCE in the L1 TLB, which is fully
associative (ITLB-2), and matched across its range by
masking VPN[3:0] out of the compare, the same mechanism
the 2 MiB and 1 GiB sizes use
- on every output, at BOTH stages, PPN[3:0] is REPLACED by
VPN[3:0] (for the G-stage, by GPA[15:12]); the stored
PPN[3:0] is the size marker, not an address
- reserved N encodings page-fault IN THE WALKER, at each
stage of the nested walk, cause 12 or 20 (MMU-16)
The PBMT reserved-encoding and PBMTE checks of MMU-U6 are
the same kind of walker obligation.
The two output sites are the ones public implementations
have got wrong: CVA6 issue 3569 substitutes on the
first-stage output and not the G-stage one, and QEMU's IOMMU
model did not check N at all and produced an address 32 KB
off. The test plan must cover a 64 KiB mapping at each stage
and every reserved N encoding.
MOVED TO THE L2 TLB WORK (MMU-1, MMU-U1 closed session-077):
how a set-associative L2 TLB holds a NAPOT entry. The
published precedent (Rocket, arXiv 2406.17802) drops
VPN[3:0] from the index. It read "Two decisions, then ...
Unresolved."
7. Faults¶
MMU-16 Three fault causes reach the front end from translation and
checking:
1 instruction access fault PMP or PMA, MMU-10, MMU-12
12 instruction page fault single-stage, or VS-stage
20 instruction guest-page fault G-stage, MMU-22
MMU-16a Guest page fault exists because H is mandatory. It is not
an optional third case to be dropped when H is absent,
because H is not absent.
MMU-U9 CLOSED session-077 by MMU-28 and MMU-29 (MMU-30, a zero
sentinel, was withdrawn after BP-123), after reading the
ratified supervisor and hypervisor chapters. It read: "A PTE
PPN WIDER THAN THE IMPLEMENTED PHYSICAL ADDRESS IS NOT
CHECKED ANYWHERE. ... Both a page fault at the stage that
read the PTE (cause 12 or 20) and an access fault from the
MMU-10 PMP check (cause 1) are defensible." The roots are
MMU-24b.
MMU-28 A PPN IS NEVER TRUNCATED. The supervisor chapter states that
the translation algorithm does not admit ignoring
high-order PPN bits on an implementation with fewer
physical address bits. Bits 53:10 of a Sv39 PTE are all
PPN, so a large PPN is not a reserved-bit page fault. The
walker reads all 44 PPN bits of every PTE:
- a PTE whose PPN is a SUPERVISOR physical page (single
stage, or G-stage): a bit set above bit 23 names an
address outside every PMA region, so the access made
with it -- the next PTE read, or the fetch -- is an
access fault, cause 1;
- a PTE whose PPN is a GUEST physical page (VS-stage): a
guest physical address with a bit set above bit 40 is a
guest-page fault, cause 20 (Sv39x4, hypervisor
chapter).
The checks fall where the algorithm's steps put them, so a
page fault found earlier in the walk is reported first. The
ITLB is never filled with a truncated PPN. Ruled
session-077 (Jeff).
MMU-29 THE IMPLICIT-ACCESS KIND. A guest-page fault the walker
raises carries, beside its guest physical address
(MMU-23), a two-bit kind:
2'b00 the GPA is the fetch's own guest physical address
2'b01 an implicit READ of a VS-stage page table
2'b10 an implicit WRITE of one, the Svadu update (MMU-8a)
2'b11 reserved
Shtvala makes htval carry the faulting guest physical
address, including for an implicit access, and the
hypervisor chapter then forbids htinst zero: it must be the
pseudoinstruction 0x00003000 (64-bit read) or 0x00003020
(64-bit write). The backend chooses htinst from this kind;
the front end carries it (itlb_l2tlb_interfaces.md IL-11b,
itlb_ifu_interfaces.md IT-6c, dcd_decisions.md DCD-16).
Ruled session-077 (Jeff).
MMU-30 WITHDRAWN session-077 (Jeff), after BP-123. The faulting
GPA is carried whole at FAULT_GPA_WIDTH = 56 (MMU-23), so
no GPA needs a sentinel. It read: "When the faulting guest
physical address has a bit set above bit 40 (MMU-28), the
GPA returned is 0 ... Whether this meets Shtvala's 'in all
circumstances permitted by the ISA' is an interpretation."
BP-123 found the sentinel collides with guest page 0, where
a kind-00 fault's GPA is also 0 and htval would lose the
offset (risk 1).
MMU-31 A G-STAGE-ONLY TRANSLATION (V=1, vsatp.MODE Bare) has no
single-stage or VS-stage leaf. The walker returns the
G-stage leaf's permission byte with G cleared, and the ITLB
applies ITLB-16 only when a single-stage or VS-stage leaf
exists: a G-stage leaf always has U set, so applying it
faulted every VS-mode fetch through such an entry (found and
fixed by BP-123). A single-stage PPN is the leaf PTE's; a
two-stage PPN is the final supervisor physical page for the
request's address (MMU-27). Built by BP-123 (D7), accepted
session-077 (Jeff).
Sstvala is mandatory in RVA23S64 and requires stval to carry the faulting virtual address for page-fault, access-fault and misaligned exceptions on load, store and instruction, and for breakpoint exceptions that write an address (rva23-profile.adoc). That covers causes 1 and 12. IT DOES NOT NAME CAUSE 20: for a guest-page fault the profile mandates Shtvala, htval written with the faulting guest physical address (MMU-23), and Shvstvala, vstval written in all the cases described for stval. What stval holds on cause 20 is the ISA's rule, not Sstvala's.
The VA travels with the cause on all three inside the front end regardless, because the IFU pairs them (itlb_ifu_interfaces.md IT-5, ifu_ibuf_interfaces.md IB-9); that is this design's doing, not a profile requirement. This read "for both causes" until session-072, then "for ALL THREE causes, cause 20 included," which attributed to Sstvala more than it says. Session-072.
8. Maintenance¶
MMU-17 THE WALKER HOLDS NO TRANSLATION, so it has no invalidate
port while there is no L2 TLB. A walk in progress when the
ITLB receives an invalidate completes, and the ITLB discards
its result (ITLB-14, IL-13, IL-14). Ruled session-077 (Jeff)
with MMU-1.
WHEN AN L2 TLB IS ADDED: SFENCE.VMA invalidates its entries
by the same forms as the L1 TLBs, and a walk in flight when
an invalidate arrives is completed and its result is not
installed. This read so of the L2 TLB as built.
THE FORMS ARE `itlb_decisions.md` ITLB-13, WHICH STATES ALL
FOUR EXPLICITLY. The one worth knowing before implementing
this: global entries are excluded only by the two forms that
name an ASID (rs2!=x0). The address-only form, rs1!=x0 with
rs2=x0, DOES invalidate global mappings for that address.
ITLB-13 read otherwise until session-070. Do not re-summarise
the four forms here; point at ITLB-13. Source is RISC-V
Privileged chapter 11 section 11.1.2.1, version 1.13.
MMU-17a H adds two more. HFENCE.VVMA invalidates VS-stage
translations for the current VMID, by VA and by ASID.
HFENCE.GVMA invalidates G-stage translations, by guest
physical address and by VMID. Both reach the ITLB on its
port, ITLB-14, with an operation field; when an L2 TLB is
added they reach it the same way, MMU-18, distinguished by
an operation field rather than by a separate port. This
read as of a built L2 TLB; session-077.
MMU-18 The L2 TLB's invalidate port, when it is added, is a
distinct port written with the module. This read as of a
built L2 TLB; session-077.
MMU-17 and MMU-17a name three instructions; the five Svinval instructions are handled by MMU-U8 below. Session-071.
MMU-U8 SVINVAL IS MANDATORY. Adopted session-071 as the fence
equivalents, below; until then it was not in MMU-17 or
MMU-17a.
`rva23-profile.adoc` lists Svinval, fine-grained
address-translation cache invalidation, among the privileged
extensions mandatory in RVA23S64 and carried from RVA22S64.
MMU-17 and MMU-17a name three instructions: SFENCE.VMA,
HFENCE.VVMA and HFENCE.GVMA. Svinval adds SINVAL.VMA,
SFENCE.W.INVAL and SFENCE.INVAL.IR, and with H also
HINVAL.VVMA and HINVAL.GVMA. Five more, and the last two are
mandatory here because H is.
MMU-17a already distinguishes its operations by an operation
field rather than a separate port, so the port shape is
likely to hold. What is not decided is whether the invalidate
and the fence are separable inside the L2 TLB, which is the
whole point of Svinval, or whether SINVAL.VMA is implemented
as SFENCE.VMA and the ordering instructions as no-ops.
The second is architecturally legal and is what most
implementations do.
ADOPTED session-071 (Jeff), the second:
SINVAL.VMA = SFENCE.VMA, same four rs1/rs2 forms
HINVAL.VVMA = HFENCE.VVMA
HINVAL.GVMA = HFENCE.GVMA
SFENCE.W.INVAL no operation at the TLBs
SFENCE.INVAL.IR no operation at the TLBs
The invalidates arrive on the MMU-18 and ITLB-14 ports with
the operation field of MMU-17a; no port changes. XiangShan
Kunminghu does the same: its TLB treats Svinval.vma and
Sfence.vma identically. Any ordering the two fences imply
outside the TLBs belongs to the backend.
TD#119 does not reach this document. That gap stops the emitted L1I from carrying an invalidate port.
9. Open¶
MMU-U1 CLOSED session-077 by MMU-1: no L2 TLB now. Section 2.
MMU-U2 CLOSED session-077: one walk at a time. Section 3.
MMU-U3 The L2 half of the Svadu atomic, and the l2 third-master
change. Moved to the L2 work. Section 4.
MMU-U4 CLOSED session-070. Smepmp is not mandatory. Section 5.
MMU-U5 CLOSED session-070. Svpbmt is mandatory. Section 6.
MMU-U6 CLOSED session-071. Most restrictive of region and both
PBMTs. Section 6.
MMU-U7 CLOSED session-071 for the L1 TLB and the walker; the L2
TLB half moved to the L2 TLB work (MMU-1). Section 6a.
MMU-U8 CLOSED session-071. Svinval as the fence equivalents.
Section 8.
MMU-U9 CLOSED session-077 by MMU-28 and MMU-29; MMU-30
withdrawn after BP-123 for MMU-23's full-width GPA.
Section 7.
10. Bindings¶
L1I-U3 Ruled session-069 as recommended. MMU-1 to MMU-3.
L1I-U4 Ruled session-069. MMU-10 to MMU-16.
L1I-21 Bound by MMU-14.
ITLB-U1 Closed by ITLB-15; MMU-U2 closed at one walk.
ITLB-12 Gates the request; MMU-10 site 1. It no longer depends
on MMU-14, which read "Depends on MMU-14" until
session-071.
IL-* The client boundary is `itlb_l2tlb_interfaces.md`.
Written to be instantiated twice; the DTLB is the
second client.
TD#118 No longer bounds the walker, which has its own port
(MMU-2). It bounds the L2 plan.
11. Document History¶
2026-09-17 session-070 audit. MMU-U4 and MMU-U5 both turned on
the same unread list. The ratified
rva23-profile.adoc was fetched and the RVA23S64
mandatory privileged set read in full.
MMU-U5 CLOSED as mandatory. Svpbmt is in the set, so
the PTE is a second PMA source and the precedence
rule is required. Raised as MMU-U6.
MMU-U4 CLOSED the other way. Smepmp is absent from
the mandatory set and from the expansion options.
MMU-11 unchanged.
Three mandatory extensions were found to be absent
from every document in the tree. MMU-U7 Svnapot,
which makes a fourth page size against the three of
ITLB-3 and IL-7. MMU-U8 Svinval, which adds five
instructions to the three of MMU-17 and MMU-17a.
Ssnpm, pointer masking, was also found absent and
was WRONGLY reported as reaching the front end. The
ratified Pointer Masking specification v1.0 applies
the ignore transformation to explicit memory accesses
only and states it does not apply to implicit
accesses such as page-table walks or instruction
fetches. The claim came from the J extension WORKING
DRAFT and concerns data accesses. Ssnpm has no
front-end or fetch-path consequence. It may still
reach the D side when the DTLB exists.
MMU-U7 extended: privileged 11.1.7 has Svnapot
supported in G-stage translation when H is
implemented, so it reaches the walker and the nested
walk, not only the TLB arrays. The reserved N=1
encodings of Table 7 must page fault.
MMU-U7's first draft attributed a three-page-size
statement to MMU-1. MMU-1 states the topology only;
page-size handling in the L2 TLB is MMU-U1 and is
unresolved. Corrected.
2026-09-19 session-071. MMU-10 and the MMU-14 paragraph restated
against ITLB-12 as revised in session-069: the checks
gate the L1I REQUEST, so the L1I array is never read
before they complete and MMU-14 is no longer the
precondition for a timing decision. The bindings
entry for ITLB-12 corrected to match.
2026-09-19 session-071. MMU-17 and MMU-17a marked incomplete
against MMU-U8. ITLB-3, IL-7, IL-9 and IL-12 now
point to MMU-U7, MMU-U6 and MMU-U8 instead of stating
complete sets.
2026-09-19 session-071, rulings (Jeff). MMU-U6 closed: the
effective type is the most restrictive of region and
both PBMTs, with the PBMT walker checks. MMU-U7 ruled:
NAPOT held once, masked match, PPN[3:0] substituted on
every output at both stages, reserved N faults in the
walker; the L2 TLB half stays in MMU-U1. MMU-U8
adopted: Svinval as its fence equivalents. MMU-14
reads the effective attributes and sends
non-cacheable fetch to the uncached path.
2026-09-20 session-072. section 7: Sstvala named two causes
beside a three-cause table; all three carry stval,
and htval carries the GPA on cause 20.
2026-09-20 session-072. E3: the history section renumbered 13 to 11;
11 and 12 do not exist.
2026-09-20 session-072. D30: Sstvala's requirement stated as the
profile defines it; cause 20 is Shtvala and
Shvstvala, not Sstvala.
2026-09-22 session-073. MMU-U9 raised from TD#122: with
PPN_WIDTH ruled at 24 against a 44-bit PTE PPN
field, nothing faults a PTE that names a physical
address this implementation cannot form. The cause
and the stage are not ruled, and the specification
has not been checked.
2026-10-01 session-074. MMU-13 fixes the PMA bit positions as
BP-116 built them. MMU-23 no longer says the widths
are undefined; BP-109 declared them.
2026-10-07 session-075, rulings (Jeff). MMU-11a: the checker
takes the PMP registers on an input group. MMU-15a:
the region table is a parameter, default main memory
0x8000_0000 to the top of the 36-bit space. MMU-26:
G-stage permissions are checked by the walker.
2026-10-07 session-075, after BP-118. MMU-10a built. MMU-11:
the PMP grain is 4 KiB. MMU-19a: M-mode fetch is not
translated.
2026-10-09 session-076, rulings (Jeff). MMU-15b: non-idempotent
memory is never executable, enforced on the region
table parameter. MMU-14: the uncached path goes
through the L1I without allocating (IFU-21 reversed).
2026-10-09 session-077, rulings (Jeff), for BP-123. MMU-1
REVERSED: no L2 TLB now; the walker serves the ITLB
directly, outside the front-end top (MMU-1a), on its
own memory port (MMU-2, ptw_mem_interfaces.md). MMU-6
confirmed, full Svadu. MMU-U1 and MMU-U2 closed (one
walk at a time). MMU-U9 closed by MMU-28 to MMU-30,
checked against the ratified supervisor and
hypervisor chapters. MMU-24a, MMU-24b, MMU-27,
MMU-12a, MMU-10d added.
Corrected against the specification: MMU-8 is a
compare and store, not a read-modify-write; MMU-12
checks PMA on every walker access, not on the final
address only; MMU-8a and MMU-8b state the H and
speculation rules. MMU-17 and MMU-18 restated for a
walker with no translation cache. MMU-U3 moved to
the L2 work.
2026-10-09 session-077, after BP-123, rulings (Jeff). MMU-1a
built. MMU-23: the faulting GPA is FAULT_GPA_WIDTH =
56, the kind-00 offset filled by the IFU; MMU-30
withdrawn. MMU-8c and MMU-24c: the walker checks U
against the request's privilege before setting A.
MMU-26a, MMU-31 and the access type of MMU-24c as
BP-123 built them (D7, D8, D2). MMU-24a: the CSR group
is held for a walk. MMU-U6: PBMTE is per stage, which
this document had crossed (D3).
2026-10-09 session-077, after review of the BP-124 draft. MMU-8c:
every leaf check precedes the A/D update, not U alone;
a read or write's U check uses SUM clear. MMU-24c:
itlb_l2t_acc was built on the walker only; 2'b10 is
reserved; the walker's cause follows the access type.
MMU-26a: no R check was built. MMU-24a: the held CSR
group is BP-123's Assumption 7, for Jeff.
2026-10-10 session-077, after BP-124 (Jeff). MMU-8c, MMU-23,
MMU-24c and MMU-30's removal built; MMU-26a: R for a
read is checked now, MXR clear (BP-124 D1, accepted).
2026-10-14 session-079. MMU-24a confirmed (Jeff); the sampled
members named; the group is ptw_csr_t (SYS-001).
itlb_decisions.md
planning/arch/itlb_decisions.md on GitHub
L1 Instruction TLB Decisions¶
FILE: itlb_decisions.md
SOURCE: session-069
STATUS: DRAFT
UPDATED: 2026-10-09
CONTACT: Jeff Nye
Owns the ITLB-N, TD-ITLB-N and ITLB-UN registries. The numbers are issue order and the sections are topical, so they do not run in numeric order: section 7 runs ITLB-13, ITLB-13a, ITLB-14, ITLB-13b. Session-072.
Scope is the L1 instruction TLB only. The page table walker and
the PMP and PMA checkers are in mmu_decisions.md. There is no L2
TLB now: an ITLB miss goes to the walker directly (MMU-1, reversed
session-077). This document names the ITLB side of each
boundary and does not restate the other side.
The ITLB is written from this document. cachegen currently does not support TLB generation.
1. Origin¶
icache_decisions.md L1I-U2 asked for the ITLB parameters and
L1I-U3 for the walker topology. Both were ruled in session-069.
This document records the ITLB half. TD#115 closes on it.
L1I-3 makes the L1I physically indexed, so translation sits in the
fetch path ahead of the array. l1i_ifu_interfaces.md IF-8 has the
IFU issue only on a valid non-faulting translation.
2. Array¶
ITLB-1 64 entries.
ITLB-2 Fully associative.
ITLB-3 One array holds every page size: the three Sv39 sizes,
4 KiB, 2 MiB and 1 GiB, and the 64 KiB Svnapot case. No
separate large-page array. A NAPOT entry is HELD ONCE and
matched across its range by masking VPN[3:0] out of the
compare; on a hit the output PPN[3:0] is VPN[3:0], not the
stored value, which is the size marker (mmu_decisions.md
MMU-U7, ruled session-071). Svnapot is mandatory in
RVA23S64. This read "all three Sv39 page sizes".
A response whose size code is reserved (3'b1xx,
itlb_l2tlb_interfaces.md IL-7) is never installed; it is
handled as a reserved status (IT-4). Built by BP-119.
ITLB-3a Each entry also holds the page's PBMT, the more restrictive
of the two stages' values as returned on
itlb_l2tlb_interfaces.md IL-9. On a hit it is combined with
the region attributes of the physical address to give the
effective type (mmu_decisions.md MMU-U6). Session-071.
ITLB-4 ASID tagged. Entries carry an ASID field and a global bit
taken from the PTE G bit. A global entry matches
regardless of ASID.
ITLB-4a VMID tagged as well, and carry a V bit. H is mandatory in
RVA23 through Sha, so an entry is either a `V=0`
single-stage translation or a `V=1` two-stage one, and a
`V=1` entry belongs to one guest. A hit requires the V bit
to match, and for `V=1` the VMID to match. The global bit
applies within a VMID, not across guests.
ITLB-5 Hit latency is one cycle. The PMP and PMA check is not in
this path. See ITLB-12.
64 fully associative holding all page sizes in one array is the Zen shape, which is the largest fully associative L1 ITLB found in the survey. Neoverse N1 and V2 and XiangShan Kunminghu are at 48. The only 128-entry L1 ITLB in the survey, Broadwell, is 4-way with a separate 8-entry array for large pages, so it is not evidence that 64 fully associative can be exceeded.
3. Replacement and sizing¶
ITLB-6 Replacement is not-most-recently-used over the 64 entries.
ITLB-7 ASID width is 16 bits, the Sv39 maximum. VMID width is 14
bits, the Sv39x4 maximum.
Neither of these was in the L1I-U2 recommendation. Both are required to build the array and are recorded here rather than left unstated.
4. Miss protocol¶
ITLB-8 The ITLB is non-blocking. On a miss it returns a miss
response to the requester and remains available to serve
hits from other requests while the walk is outstanding.
ITLB-9 The requester re-requests. The ITLB does not hold the
faulting request and does not retry on the requester's
behalf.
ITLB-10 The ITLB tracks outstanding walks and does not issue a
second walk for a VA and ASID that already has one in
flight. A re-request that matches an in-flight walk
receives a miss response without generating walk traffic.
ITLB-10 is the consequence of ITLB-9. The requester re-requests the same VA while the walk is outstanding, so without a match against in-flight walks the ITLB issues duplicate walks for every retry. This is the same shape as the L1I-14 MSHR target problem.
ITLB-10a A WALK FAULT IS HELD in its tracker slot until the IFU
re-requests that address, and is answered then as a
fault. Under ITLB-9 the requester re-requests rather than
waiting, so the fault has to be kept for it. An invalidate
drops held faults (ITLB-14). Built by BP-118, accepted
session-075 (Jeff). The held fault keeps everything the
walker returned with it: the cause, the GPA and its
implicit-access kind (IL-11a, IL-11b, IT-6c); session-077.
ITLB-10b A HELD FAULT RECORDS THE PRIVILEGE AND V it was raised at.
The walker's U check depends on them (mmu_decisions.md
MMU-8c), so a fault raised at one privilege is not the
answer at another. A re-request whose privilege or V
differs from the held fault's drops the held fault and
issues a new walk at the current privilege; one that
matches is answered with the held fault as ITLB-10a says.
Every held fault is tagged, whatever its cause, so the
rule has no per-cause case. RULED session-077 (Jeff),
after BP-123; BUILT by BP-124. As built, a held fault for
the same page is dropped when a request at another
privilege or V is answered miss; ASID and VMID do not enter
the condition, since a change of V changes which one is
compared (BP-124 Assumption 6).
ITLB-U1 CLOSED session-075 (Jeff) by ITLB-15. The question was
the depth of the in-flight walk tracker. One outstanding
walk makes ITLB-8 mean only that hits continue during a
miss. More than one requires the walker to accept more
than one, which is an `mmu_decisions.md` question and is
bounded by how many transactions the l2 slave accepts,
TD#118.
ITLB-15 The walk tracker depth is a parameter, default 1. The
walker performs one walk at a time (MMU-U2, ruled
session-077), so more buys nothing until it performs more.
IL-1's two-bit tag allows up to four and is not tied to
this value. This read "The l2 serialises walks (TD#118,
MMU-U2)".
5. Faults¶
ITLB-11 The ITLB returns a fault cause, not a single non-faulting
bit. Three outcomes: hit, miss, fault.
The faulting virtual address is not returned on the port. The IFU
supplied it and holds it against the request tag, and pairs it
with the cause on the way into ifu_pd_pkt_t (this read
predecode_pkt_t; DCD-16, session-075).
itlb_ifu_interfaces.md IT-5. The pair still reaches the backend
as Sstvala requires; it is assembled one step later.
Three fault causes reach the IFU: instruction access fault, cause 1,
from the PMP or PMA check in mmu_decisions.md; instruction page
fault, cause 12, from a single-stage or VS-stage translation; and
instruction guest-page fault, cause 20, from the G-stage. The third
exists because H is mandatory in RVA23 through Sha. The IFU cannot
collapse them.
Sstvala is mandatory in RVA23S64 and requires stval to carry the faulting virtual address for page-fault, access-fault and misaligned exceptions, and for breakpoint exceptions that write an address; it does not name the guest-page fault, cause 20, for which the profile mandates Shtvala and Shvstvala instead (mmu_decisions.md 7, rva23-profile.adoc). The VA travels with the cause on all three here because the IFU pairs them (IT-5), not because Sstvala requires it on cause 20. On cause 20 the guest PHYSICAL address travels separately, on IT-6a, for htval (MMU-23). This named page-fault and access-fault only, then all three. Session-072.
l1i_ifu_interfaces.md needs no amendment for this. IF-8 is a
gate condition, issue only on a valid non-faulting translation,
and section 8 already separates what lies behind it: IF-23 is the
fault case and IF-24 the miss case. Nothing there collapses two
causes into one bit.
ITLB-16 THE PTE PERMISSION CHECK IS MADE ON EVERY HIT, against
the current privilege, and raises cause 12. The entry
holds the permission byte of IL-8. A fetch faults when X
is clear; in U-mode, or VU-mode for a V=1 entry, when U is
clear; in S-mode, or VS-mode, when U is set. SUM does not
apply to instruction fetch, and MXR concerns loads only.
Ruled session-075 (Jeff).
It cannot be made once at walk time and cached as a
result: privilege changes without a fence, so the same
entry can be legal at one hit and faulting at the next.
G-STAGE PERMISSIONS ARE NOT CHECKED HERE. Every G-stage
access is treated as a user-mode access, so the result
does not depend on the current privilege, and the walker
checks it and returns cause 20 (mmu_decisions.md MMU-26).
THIS CHECK APPLIES ONLY WHEN A SINGLE-STAGE OR VS-STAGE
LEAF EXISTS. A G-stage-only entry (V=1, vsatp.MODE Bare)
holds the G-stage leaf's byte with G cleared (IL-8,
mmu_decisions.md MMU-31); a G-stage leaf always has U set,
so applying this check faulted every VS-mode fetch through
such an entry. Found and fixed by BP-123 (D7), accepted
session-077 (Jeff). This read as applying to every hit.
THE WALKER ALSO CHECKS U, ONCE, BEFORE IT SETS A
(mmu_decisions.md MMU-8c), so a walk never sets A on a
leaf this check would fault. The check on every hit stands:
privilege changes without a fence. Ruled session-077
(Jeff); BUILT by BP-124.
ITLB-17 The ITLB reads its translation regime from a CSR input
group on the front-end boundary: V, the current privilege,
satp ASID and MODE, vsatp ASID and MODE, hgatp VMID and
MODE. It holds no CSR of its own. fe_decisions.md FE-20.
Ruled session-075 (Jeff).
A WALK REQUEST CARRIES THE ACCESS TYPE AND THE PRIVILEGE
(itlb_l2tlb_interfaces.md IL-3d, mmu_decisions.md MMU-24c).
The ITLB presents execute on `itlb_l2t_acc` and its current
privilege from this group on `itlb_l2t_priv`, with V on
`itlb_l2t_v`. Ruled session-077 (Jeff); BUILT by BP-124.
As built, `itlb_l2t_priv` is the privilege recorded when the
miss allocated its tracker slot, the one the walk is for and
the one a held fault is tagged with; it is not re-read while
the request waits (BP-124 Assumption 5).
BP-123 built `itlb_l2t_acc` on the walker only (D2), tied to
execute in tb_fe_top.
6. Check placement¶
ITLB-12 The PMP permission check, the PMA executable check and the
read of the EFFECTIVE cacheable and idempotent attributes
(ITLB-3a, mmu_decisions.md MMU-14) all complete BEFORE any
L1I request is issued. A request that fails them is never
made. This read "the PMA idempotent read"; the effective
type includes the PTE's PBMT. Session-071.
ITLB-12a None of these checks is in the ITLB-5 hit path. They run
in the translation pipeline, `ifu_decisions.md` IFU-23a,
which is a whole pipeline ahead of the fetch pipeline
that issues to the L1I. The translation returns at the
ITLB-5 latency and the checks complete before the result
leaves the queue.
AN EARLIER REVISION OF ITLB-12 HAD THE CHECK GATE THE RESPONSE RATHER THAN THE REQUEST, on the reasoning that a serial check after a fully-associative hit would not fit in one cycle and that L1iReadLatency of 2 left a cycle to hide it in. Two things were wrong with it.
It contradicted l1i_ifu_interfaces.md IF-22, which states that a
faulting request never reaches the L1I and that this interface
carries no fault port in either direction. Letting a PMP failure
reach the array and blocking only the response is exactly the
traffic IF-22 forbids.
And its timing argument counted sixty-four PMP range compares. MMU-11 sets sixteen entries.
The argument is moot in any case. The IFU now translates in a pipeline ahead of fetch, so the checks have a pipeline to complete in rather than a cycle, and gating the request costs nothing. Session-069.
The idempotent read was separated from the other two in an earlier revision because a check that gates a response cannot also decide whether a request is made. With ITLB-12 gating the request, the separation is unnecessary: all three are read before the request and all three can stop it. MMU-14 and IT-11 are unchanged.
7. Maintenance¶
ITLB-13 SFENCE.VMA invalidates ITLB entries by VA, by ASID, by
both, or all. GLOBAL ENTRIES ARE EXCLUDED BY THE TWO FORMS
THAT NAME AN ASID, not by everything except the all form.
The four forms, from RISC-V Privileged Architecture
chapter 11, Supervisor-Level ISA version 1.13, section
11.1.2.1 (library version v20260120):
rs1=x0, rs2=x0 all entries, all address spaces global INCLUDED
rs1=x0, rs2!=x0 that ASID global EXCLUDED
rs1!=x0, rs2=x0 that VA, all address spaces global INCLUDED
rs1!=x0, rs2!=x0 that VA and that ASID global EXCLUDED
The specification attaches "except for entries containing
global mappings" to the two rs2!=x0 forms only. The
address-only form invalidates entries for the address in
rs1 "for all address spaces", with no exclusion stated.
Corroborated from the other side by the G bit description
in 11.1.3.1: global mappings need not be flushed when
SFENCE.VMA is executed with rs2!=x0. The exclusion is tied
to rs2!=x0 exactly.
AN EARLIER REVISION SAID "global entries are invalidated
only by the all form". That dropped the address-only form
and would leave a stale global translation alive across
`sfence.vma rs1, x0`. That is a correctness bug, not a
prediction-quality one: the ITLB would answer a later fetch
from an invalidated mapping. Corrected session-070.
It affects `V=0` entries and, when executed in VS-mode, the
current guest's VS-stage entries.
ITLB-13a HFENCE.VVMA invalidates `V=1` VS-stage entries for the
current VMID, by VA and by ASID. HFENCE.GVMA invalidates
`V=1` entries by guest physical address and by VMID.
Both arrive on the ITLB-14 port with an operation field.
HFENCE.VVMA CARRIES THE SAME GLOBAL RULE AS ITLB-13. The
privileged specification says its effect "is much the same
as temporarily entering VS-mode and executing SFENCE.VMA",
so it has the same four rs1/rs2 forms and global entries
are excluded only by the two that name an ASID (rs2!=x0).
The VA-only form invalidates global VS-stage mappings for
that address. Global is per-VMID here, not across guests,
ITLB-4a. Checked session-070 when ITLB-13 was corrected.
HFENCE.GVMA HAS NO GLOBAL CASE. It selects by guest
physical address and VMID and takes no ASID, so the
exclusion has nothing to key on.
GVMA INVALIDATES EVERY V=1 ENTRY OF THE VMID, or of all
VMIDs, whatever address it names. An entry holds the
guest virtual page and the final physical page, not the
guest physical address, so it cannot be matched by GPA.
Invalidating more than required is legal. Built by BP-118,
accepted session-075 (Jeff).
ITLB-14 The invalidate port is a distinct port, not carried on the
translation request path. It is written with the module.
The front-end top exposes it as a boundary input, since its
producer is the backend, which does not exist (FE-20).
Ruled session-075 (Jeff). AS BUILT BY BP-118, one cycle, no
ready:
bkend_itlb_inv_val backend -> ITLB
bkend_itlb_inv_op [1:0] 0 VMA SFENCE.VMA,
SINVAL.VMA
1 VVMA HFENCE.VVMA,
HINVAL.VVMA
2 GVMA HFENCE.GVMA,
HINVAL.GVMA
3 reserved, all
bkend_itlb_inv_rs1_nz select by address
bkend_itlb_inv_rs2_nz select by ASID (VMA,
VVMA) or VMID (GVMA)
bkend_itlb_inv_vpn [VA_WIDTH-13:0] the rs1 page
bkend_itlb_inv_asid [ASID_WIDTH-1:0]
bkend_itlb_inv_vmid [VMID_WIDTH-1:0] VVMA the current VMID;
GVMA rs2's VMID
VMA acts on V=0 entries and VVMA on the V=1 entries of
inv_vmid; global entries are excluded only when rs2_nz
(ITLB-13). An SFENCE.VMA in VS-mode is presented as VVMA
with the current VMID. SFENCE.W.INVAL and SFENCE.INVAL.IR
are not presented (ITLB-13b). Every invalidate releases the
walk tracker: unsent walks are dropped, in-flight walks are
killed and install nothing (IL-13, IL-14), and held faults
(ITLB-10a) are dropped.
ITLB-13b Svinval, mandatory in RVA23S64, per mmu_decisions.md
MMU-U8 (adopted session-071): SINVAL.VMA acts as
SFENCE.VMA with ITLB-13's four forms and global rule,
HINVAL.VVMA as HFENCE.VVMA and HINVAL.GVMA as HFENCE.GVMA
(ITLB-13a), all on the ITLB-14 port. SFENCE.W.INVAL and
SFENCE.INVAL.IR do nothing at the ITLB.
TD#119 does not reach this document. It is the cachegen schema gap that stops the emitted L1I from carrying an invalidate port. The ITLB is written from this document, so its port is written with it.
8. Open¶
None. ITLB-U1 closed session-075 by ITLB-15.
MMU-U6, MMU-U7 and MMU-U8, which bounded ITLB-3, ITLB-3a, ITLB-12 and section 7, were ruled session-071.
9. Bindings¶
L1I-3 PIPT, translation ahead of the array.
L1I-U2 Ruled session-069 at 64 entries, ITLB-1 to ITLB-5.
L1I-U3 Ruled session-069 as recommended, walker side in
`mmu_decisions.md`, ITLB side in section 4.
IF-8 The gate condition. IF-23 and IF-24 behind it already
separate fault from miss.
TD#115 Closed by this document.
IT-* The IFU boundary is `itlb_ifu_interfaces.md`.
IL-* The walker boundary is `itlb_l2tlb_interfaces.md`; there
is no L2 TLB now (MMU-1).
IL-5 is deliberately the opposite of ITLB-8: a miss
there holds the transaction open rather than ending it.
TD#118 Bounded ITLB-U1, now closed. The walker has its own
memory port (MMU-2), so TD#118 bounds only the L2 plan.
10. Document History¶
2026-09-17 session-070 audit. ITLB-13 corrected. It read "Global
entries are invalidated only by the all form", which
is short by one form: the ratified privileged
specification attaches the global exclusion to the
two SFENCE.VMA forms with rs2!=x0, so the
address-only form (rs1!=x0, rs2=x0) invalidates
global mappings for that address. All four forms are
now stated explicitly rather than summarised, since
summarising them is what produced the error.
Not a prediction-quality issue. A global mapping
surviving sfence.vma rs1, x0 is a stale translation
the ITLB will hit on.
mmu_decisions.md MMU-17 needed no separate fix: it
says the L2 TLB uses "the same forms as the L1 TLBs",
which is a pointer to this rule. A cross-reference
was added there.
2026-09-19 session-071. ITLB-3 includes the Svnapot 64 KiB case
and points to MMU-U7 for how it is held; section 7
records that Svinval's five instructions are MMU-U8;
section 8 names both. Both extensions are mandatory
and the document stated a complete set without them.
2026-09-19 session-071, rulings. ITLB-3: NAPOT held once with a
masked match and PPN[3:0] substituted. ITLB-3a: the
entry holds the page's PBMT. ITLB-12: the effective
attributes gate the request. ITLB-13b: Svinval as
its fence equivalents.
2026-09-20 session-072. ITLB-11: the Sstvala sentence named
page-fault and access-fault only; all three causes
carry stval.
2026-09-20 session-072. D30: same Sstvala correction. E26: the
header records that the registry numbers are issue
order.
2026-10-07 session-075, rulings (Jeff). ITLB-15: tracker depth a
parameter, default 1, closing ITLB-U1. ITLB-16: the
PTE permission check on every hit, cause 12; G-stage
permissions are the walker's. ITLB-17: the CSR input
group. ITLB-14: the invalidate port list is proposed
by BP-118. ITLB-11: ifu_pd_pkt_t, not predecode_pkt_t.
2026-10-07 session-075, after BP-118. Built at rtl/mmu/itlb.
ITLB-14 records the invalidate port as built.
ITLB-13a: GVMA drops every V=1 entry of the VMID.
ITLB-10a: walk faults are held for the re-request.
2026-10-07 session-075, after BP-119. ITLB-3: a reserved size
code is not installed and is handled as IT-4.
2026-10-09 session-077. No L2 TLB: the scope paragraph and
ITLB-15 name the walker as the ITLB's server
(MMU-1 reversed, MMU-U2 one walk). ITLB-10a: a held
fault keeps its GPA and implicit-access kind.
2026-10-09 session-077, after BP-123, rulings (Jeff). ITLB-16
applies only when a single-stage or VS-stage leaf
exists (D7), and the walker also checks U before
setting A (MMU-8c). ITLB-10b: a held fault records
the privilege and V. ITLB-17: the walk request carries
the access type and the privilege.
2026-10-10 session-077, after BP-124. ITLB-10b and ITLB-17
built, with the drop condition and the recorded
privilege as built (Assumptions 6 and 5).
itlb_ifu_interfaces.md
planning/interfaces/itlb_ifu_interfaces.md on GitHub
IFU to Instruction TLB Interface¶
FILE: itlb_ifu_interfaces.md
SOURCE: session-069
STATUS: DRAFT
UPDATED: 2026-10-09
CONTACT: Jeff Nye
Owns the IT-N registry.
1. Scope¶
Two groups cross this boundary: the IFU asks the ITLB to translate a virtual address, and the ITLB answers.
The requester is the IFU's TRANSLATION pipeline, ifu_decisions.md
IFU-24, which runs ahead of the fetch pipeline and queues its
results. It is not F0 of the fetch pipeline. Nothing in this
document depends on which of the two it is, but a reader placing
these ports in the fetch stages would put them in the wrong
pipeline. The ITLB's own
miss path into the page table walker is not here; it is
itlb_l2tlb_interfaces.md. This read "into the shared L2 TLB";
there is no L2 TLB now (mmu_decisions.md MMU-1), session-077.
2. The groups¶
ifu_itlb_req_val IFU -> ITLB
ifu_itlb_req_rdy ITLB -> IFU
ifu_itlb_vpn [VA_WIDTH-13:0] IFU -> ITLB
ifu_itlb_tag IFU -> ITLB
itlb_ifu_rsp_val ITLB -> IFU
itlb_ifu_tag ITLB -> IFU
itlb_ifu_status [1:0] ITLB -> IFU
itlb_ifu_ppn [PPN_WIDTH-1:0] ITLB -> IFU
itlb_ifu_cause [CAUSE_WIDTH-1:0] ITLB -> IFU
itlb_ifu_gpa [FAULT_GPA_WIDTH-1:0] ITLB -> IFU
itlb_ifu_gpa_imp [1:0] ITLB -> IFU
itlb_ifu_pma [PMA_WIDTH-1:0] ITLB -> IFU
IT-16 `ifu_itlb_vpn` is VA_WIDTH - 12 = 29 bits, the fetch
address above the page offset, not VPN_WIDTH (27). With V=1
and vsatp.MODE=Bare the fetch PC is a 41-bit guest physical
address, and with V=0 and satp.MODE=Bare a fetch address
above bit 35 must reach the PMA check to fault (FE-19). A
27-bit port drops both. Ruled session-074 (Jeff); this read
[VPN_WIDTH-1:0]. The IFU port is built at this width on
both lookups by BP-117, TD#146 closed.
IT-1 One request port. A block that crosses a page needs two
translations and they are issued on successive cycles, not
on a second port.
IT-2 `ifu_itlb_tag` is one bit and names which half of the block
the request covers. 0 is the block's own page, 1 is the
page the straddle reaches into.
IT-3 The response carries the tag back. Responses may return out
of order, so the tag is how the IFU attributes them.
IT-1 is the reason IT-3 exists. Two requests are in flight when a block crosses a page, the first can miss while the second hits, and the hit returns first. A second request port would avoid the tag at the cost of a second set of 64 comparators against the fully associative array of ITLB-2, spent on a case that occurs only at a page boundary.
3. The result¶
IT-4 itlb_ifu_status is three-way, which is ITLB-11.
2'b00 hit ppn valid, cause and the block's PMA valid
2'b01 miss a walk has started. ppn and cause are invalid.
2'b10 fault cause valid. ppn invalid.
2'b11 reserved
A reserved status, or a fault whose cause is not 1, 12 or
20, is treated by the IFU as an instruction access fault.
Session-074, as BP-116 built it.
IT-5 The virtual address the fault applies to is not returned.
The IFU supplied it and holds it. Returning it would give
one fact two producers.
IT-6 `itlb_ifu_cause` distinguishes three causes: instruction
access fault, cause 1, from the PMP or PMA check of MMU-10
and MMU-12; instruction page fault, cause 12, from a
single-stage or VS-stage translation; and instruction
guest-page fault, cause 20, from the G-stage. H is
mandatory in RVA23 through Sha, so the third is not
optional.
IT-6a `itlb_ifu_gpa` carries the faulting GUEST PHYSICAL address
and is valid only when the cause is 20. Shtvala requires
`htval` to be written with it, and unlike the virtual
address of IT-5 the IFU never had it: it is produced inside
the walk. So it returns here and IT-5 does not apply to it.
It is FAULT_GPA_WIDTH = 56 bits (mmu_decisions.md MMU-23).
For kind 00 the ITLB passes the walker's page and the IFU
fills the offset (ifu_decisions.md IFU-2a). This was
[GPA_WIDTH-1:0]. Ruled session-077 (Jeff), after BP-123;
BUILT by BP-124.
IT-6b Nothing about the translation regime is on this port. The
IFU presents a virtual address and no more.
The ITLB reads what it needs directly: the V bit, the ASID
and the VMID for the tag match of ITLB-4 and ITLB-4a, and
the MODE fields to know whether translation is enabled or
Bare.
IT DOES NOT READ THE ROOT POINTERS. The ITLB does not walk,
so `satp.PPN`, `vsatp.PPN` and `hgatp.PPN` are no use to it.
They belong to the walker, `itlb_l2tlb_interfaces.md` IL-3c
and mmu_decisions.md MMU-24a. An earlier revision of this
rule had the ITLB read all three; until session-077 this
placed the walker inside an L2 TLB.
IT-6c `itlb_ifu_gpa_imp` is the implicit-access kind of
`itlb_l2tlb_interfaces.md` IL-11b, valid with IT-6a: 2'b00
the fetch's own guest physical address, 2'b01 an implicit
read of a VS-stage page table, 2'b10 an implicit write of
one, 2'b11 reserved. The ITLB passes it through from the
walker, holding it with a held fault (ITLB-10a). The IFU
carries it into `ifu_pd_pkt_t` beside the GPA (DCD-16); the
backend needs it for htinst (mmu_decisions.md MMU-29). Added
session-077 (Jeff).
IT-5 is a departure from how ITLB-11 is worded. That rule has the
ITLB return the fault cause and the faulting virtual address
together, because the pair is what must reach the backend under
Sstvala. The pair is assembled in the IFU: it already holds the
VA, it receives the cause here, and it carries both into
ifu_pd_pkt_t at IB-9 (DCD-16; this read predecode_pkt_t until
session-074). Nothing is lost and the VA does not
make a round trip.
4. Miss¶
IT-7 A miss response ends the transaction. The ITLB does not
hold the request and does not answer it later.
IT-8 The IFU re-requests. It may re-request in any cycle after
the miss response and the ITLB does not require a minimum
interval.
IT-9 A re-request for a virtual address with a walk already in
flight receives a miss response and starts no second walk.
The ITLB matches against its in-flight walks. This is
ITLB-10 and it is stated here because the IFU's behaviour
depends on it: the IFU may re-request freely and cannot
cause duplicate walk traffic.
5. PMA¶
IT-10 `itlb_ifu_pma` returns the attributes of MMU-13 on a hit,
at the bit positions MMU-13 fixes: [0] cacheable,
[1] coherent, [2] executable, [3] idempotent. They are the
EFFECTIVE attributes: the region table combined with the
entry's PBMT, the most restrictive of the two
(mmu_decisions.md MMU-U6, ITLB-3a). Executable and coherent
come from the region table alone.
IT-11 The IFU reads cacheable and idempotent to decide the path. A
fetch with both set is an ordinary L1I request; otherwise it
is an UNCACHED L1I request (ifu_decisions.md IFU-21,
l1i_ifu_interfaces.md IF-44), presented only under the commit
gate of IFU-22, and never allocates in the L1I (MMU-14). So a
page marked NC or IO never allocates in the L1I. This read
"otherwise it takes the uncached path of IFU-21 and does not
reach the L1I"; IFU-21 reversed session-076. Before that it
read "The IFU reads idempotent" against the region alone.
Session-071.
IT-12 A PMP or PMA failure arrives ON THIS RESPONSE as status
fault, cause 1. The checker instance beside the ITLB
(mmu_decisions.md MMU-10a, MMU-10b) evaluates the translated
address, and the IFU consumes the result before it issues an
L1I request; it does not check. On a hit `itlb_ifu_pma` is
the effective attributes of IT-10, which decide the cached
or uncached path (IT-11). ITLB-12 and ITLB-12a.
This read that the checks do not gate this response and that
the IFU consumes "the PMP and PMA results" from it, which
left where a denial appears unstated; BP-118 built it as
cause 1, as MMU-10b already said. Ruled session-075 (Jeff).
IT-12a No L1I request is issued for a block that fails PMP or
PMA. `l1i_ifu_interfaces.md` IF-22: a faulting request
never reaches the L1I and that interface has no fault port
in either direction. The translation pipeline of IFU-23a
is what makes this free; there is no cycle to save by
letting the request go and killing the response.
6. Flow control¶
IT-13 `ifu_itlb_req_rdy` deasserts when the ITLB cannot accept a
lookup. The IFU holds the request stable until it is taken.
IT-14 The response has no ready. The IFU accepts every response
in the cycle it is presented. It has a slot for each of the
two outstanding requests IT-1 permits and cannot run out.
7. Maintenance¶
IT-15 SFENCE.VMA does not cross this boundary. ITLB-14 gives the
ITLB a distinct invalidate port and the IFU is not on that
path.
8. Open¶
None here. Two items elsewhere bear on this port without changing it: the in-flight walk tracker depth, ITLB-U1, closed by ITLB-15 at a parameter of 1 with the walker performing one walk at a time (MMU-U2), and IT-9 holds at any depth. This read "bounded by TD#118"; session-077. IFU-U5, the translation queue depth that sets how far ahead of the fetch pipeline these requests are issued, was closed session-074 at a parameter of 4; a page-crossing block issues its two lookups on successive cycles (IFU-25, IT-1).
9. Bindings¶
ITLB-2 The fully associative array IT-1 avoids duplicating. ITLB-5 One cycle hit, preserved by IT-12. ITLB-8 Non-blocking, IT-7. ITLB-9 The requester re-requests, IT-8. ITLB-10 In-flight walk match, IT-9. ITLB-11 Three-way result, IT-4. The VA half is IT-5. ITLB-12 Check placement, IT-12. ITLB-14 Invalidate port, IT-15. IFU-7 Two lookups per block, IT-1 and IT-2. IFU-21 The uncached path IT-11 selects. MMU-13 The attributes of IT-10. IB-9 Where the cause and VA are paired. MMU-29 The implicit-access kind of IT-6c.
10. Document History¶
2026-10-09 session-077, rulings (Jeff). IT-6c and
itlb_ifu_gpa_imp, the implicit-access kind. Section 1
and IT-6b: the walker is the ITLB's server, with no
L2 TLB (MMU-1 reversed). This document had no history
section; its earlier changes are in PROJECT_STATUS.
2026-10-09 session-077, after BP-123, ruling (Jeff). IT-6a:
itlb_ifu_gpa is FAULT_GPA_WIDTH = 56.
2026-10-10 session-077, after BP-124. IT-6a built.
itlb_l2tlb_interfaces.md
planning/interfaces/itlb_l2tlb_interfaces.md on GitHub
Instruction TLB to L2 TLB Interface¶
FILE: itlb_l2tlb_interfaces.md
SOURCE: session-069
STATUS: DRAFT
UPDATED: 2026-10-15
CONTACT: Jeff Nye
Owns the IL-N registry.
1. Scope¶
Two groups cross this boundary: the ITLB presents a miss, and the server answers with a translation or a fault.
THE SERVER IS THE PAGE TABLE WALKER. There is no L2 TLB now
(mmu_decisions.md MMU-1, reversed session-077); an ITLB miss goes
to the walker directly. The port was written for an L2 TLB and its
shape is unchanged: a walker also holds the transaction open until
the walk completes (IL-5). An L2 TLB added later sits behind this
same port. THE PORT NAMES KEEP l2t, ruled session-077 (Jeff): they
are built, and renaming them buys nothing a reader of this
paragraph needs. Where the rules below say L2 TLB, read the walker
until an L2 TLB exists.
The walk itself, the walker's memory port, and the A and D bit
handling are mmu_decisions.md and ptw_mem_interfaces.md.
The L1 data TLB will be a second client of this same port shape. Nothing here is I-side specific and the port is written to be instantiated twice.
2. The groups¶
itlb_l2t_req_val ITLB -> walker
itlb_l2t_req_rdy walker -> ITLB
itlb_l2t_vpn [VA_WIDTH-13:0] ITLB -> walker
itlb_l2t_asid [ASID_WIDTH-1:0] ITLB -> walker
itlb_l2t_vmid [VMID_WIDTH-1:0] ITLB -> walker
itlb_l2t_v ITLB -> walker
itlb_l2t_tag [1:0] ITLB -> walker
itlb_l2t_acc [1:0] ITLB -> walker
itlb_l2t_priv [1:0] ITLB -> walker
l2t_itlb_rsp_val walker -> ITLB
l2t_itlb_tag [1:0] walker -> ITLB
l2t_itlb_status [1:0] walker -> ITLB
l2t_itlb_ppn [PPN_WIDTH-1:0] walker -> ITLB
l2t_itlb_size [2:0] walker -> ITLB
l2t_itlb_perm [PERM_WIDTH-1:0] walker -> ITLB
l2t_itlb_pbmt [1:0] walker -> ITLB
l2t_itlb_cause [CAUSE_WIDTH-1:0] walker -> ITLB
l2t_itlb_gpa [FAULT_GPA_WIDTH-1:0] walker -> ITLB
l2t_itlb_gpa_imp [1:0] walker -> ITLB
The far end is the page table walker (section 1). This list read L2TLB at the far end (DOC-002, D9). Session-080.
IL-1a `itlb_l2t_vpn` is VA_WIDTH - 12 = 29 bits, for the reason
itlb_ifu_interfaces.md IT-16 gives for the IFU side: with V=1
and vsatp.MODE=Bare the address is a 41-bit guest physical
address, and a 27-bit field drops bits 40:39. BP-118 built
it at 29. This read [VPN_WIDTH-1:0]. Session-075.
IL-1 `itlb_l2t_tag` is two bits. Up to four requests may be
outstanding from one client. The walker accepts one at a
time (MMU-U2, closed session-077) and answers others retry,
IL-6; the tag width is unchanged.
IL-2 The response carries the tag back. Responses may return out
of order.
Two bits covers the two translations IT-1 allows in flight on the I side and leaves headroom. The tracker depth is a separate decision, ITLB-U1, and can change without touching this port. Sizing the tag to the tracker would couple them.
IL-3 The translation context IDENTITY travels with the request:
the V bit, the ASID and the VMID. The L2 TLB does not hold a
current ASID or VMID; the client already holds both for its
own tag match, so sending them keeps one producer.
IL-3c THE MMU DOES READ CSRs. IL-3 is about identity, not about
the whole CSR file. What the WALK needs is regime state and
is read directly, not carried per request:
satp.PPN single-stage root
vsatp.PPN, hgatp.PPN VS-stage and G-stage roots, MMU-19
the MODE fields whether translation is on, and Bare
menvcfg.ADUE Svade against Svadu, MMU-7
henvcfg.ADUE the same for the VS-stage, MMU-7a
menvcfg/henvcfg.PBMTE the PBMT walker checks, MMU-U6
These reach the walker on its own CSR input group, not through the front-end top (mmu_decisions.md MMU-24a). The root pointers are narrower than the architectural fields (MMU-24b).
The division is that identity is a property of the REQUEST and the regime is not. A root pointer is not something one request has and another does not, and putting it on the port would make every client a producer of it.
AN EARLIER REVISION OF IL-3 said the L2 TLB does not read a CSR, full stop. That contradicted MMU-7 and MMU-7a, which already have the MMU read the ADUE bits, and it left the walker with no source for the root it walks from. Session-069.
IL-3a The VMID and the V bit travel with it for the same reason.
H is mandatory in RVA23 through Sha, so a request is either
a `V=0` single-stage translation or a `V=1` two-stage one,
and a two-stage request names its guest. ITLB-4a.
IL-3d THE ACCESS TYPE AND THE PRIVILEGE travel with the request,
as identity does, because they are properties of one
request (mmu_decisions.md MMU-24c). `itlb_l2t_acc` is 0
read, 1 write, 2 execute, 3 reserved; the ITLB always
presents execute. BP-123 built it on the walker only (D2),
tied to execute in tb_fe_top, accepted session-077; BP-124
has the ITLB drive it and fe_top carry it.
`itlb_l2t_priv` is 2'b00 U or 2'b01 S, with `itlb_l2t_v`
the effective privilege the walker checks a leaf's U bit
against before setting A (MMU-8c). Ruled session-077 (Jeff);
BUILT by BP-124. 2'b10 (reserved) and 2'b11 (M) are never
presented. SUM and MXR join the request with the DTLB.
IL-3b A `V=1` request commits the walker to a NESTED walk,
MMU-21, which is several times the work of a single-stage
one. The port does not distinguish them beyond the V bit;
the cost difference is the walker's to absorb and is why
IL-6 exists. This read "the L2 TLB"; session-077.
3. The result¶
IL-4 l2t_itlb_status is three-way.
2'b00 hit ppn, size and perm valid
2'b01 fault cause valid, ppn invalid
2'b10 retry no walk was started, re-request
2'b11 reserved
IL-5 There is no miss status. An accepted request starts a walk
and the response is deferred until the walk completes. The
transaction stays open. This is the opposite of ITLB-8,
where a miss ends the transaction and the requester
re-requests. This read "An L2 TLB miss starts a walk";
session-077.
IL-6 `retry` is not a miss. It means the walker could not accept
the request, because it is performing another walk
(MMU-U2), so nothing is in flight and the client must ask
again. It exists because IL-5 makes the transaction
long-lived. This read "into its tracker" of an L2 TLB;
session-077.
IL-5 is why this port differs from the one above it. The ITLB answers the IFU immediately because the IFU has other work and a prediction block to abandon. The ITLB has nothing else to do with a missed translation, so holding the transaction open costs it nothing and saves a re-request path.
This read "a fetch block to abandon"; the fetch block is the 64-byte L1I line (fe_decisions.md Conventions). Session-071.
4. Page size and permissions¶
IL-7 `l2t_itlb_size` names which page size the translation
covers: 4 KiB, 64 KiB (Svnapot), 2 MiB or 1 GiB. THREE bits,
RULED session-075 (Jeff): 3'b000 4 KiB, 3'b001 64 KiB,
3'b010 2 MiB, 3'b011 1 GiB, 3'b1xx reserved for a future
size. Ascending, so a larger code always masks more VPN
bits. BP-118 built two bits; BP-119 widened to three. A
response that hits with a reserved size code is handled as a
reserved status (IT-4, IL-4), built by BP-119. The ITLB
installs the entry at that size, ITLB-3; a 64 KiB entry is
held once with a masked match (mmu_decisions.md MMU-U7).
The PPN returned for a 64 KiB page is the PTE's, with
PPN[3:0] the size marker; the ITLB substitutes on its
output. This read "which of the three Sv39 page sizes".
Session-071.
IL-7a For a `V=1` translation the size is the SMALLER of the two
stages' leaf sizes, and the PPN is the final supervisor
physical page at that size (mmu_decisions.md MMU-27).
Session-077. Built by BP-123: the PPN is the final page for
the request's address (D7, accepted session-077).
IL-8 `l2t_itlb_perm` carries the PTE permission and attribute
bits the ITLB must hold to answer later hits without asking
again. Included are the executable, user and global bits.
The global bit sets the ITLB entry's global flag of
ITLB-4. For a G-stage-only translation (V=1, vsatp.MODE
Bare) it is the G-stage leaf's byte with G cleared, and the
ITLB does not apply ITLB-16 to it (mmu_decisions.md MMU-31).
Built by BP-123 (D7), accepted session-077.
IL-9 The PMA attributes of MMU-13 are not returned here. They
come from the static region table and are a function of the
physical address, so the ITLB derives them from the PPN it
was given rather than being told.
IL-9 is a placement choice and it follows MMU-15 for the attributes the region table decides. Svpbmt is mandatory in RVA23S64, so the PTE's PBMT field is a second memory type source, per translation, that the region table cannot supply (mmu_decisions.md MMU-U5). This paragraph said a PMA "is a property of an address range, not of a translation" and that returning one would make the L2 TLB "a second source for something the region table already decides", which MMU-U5 contradicts. Session-071.
IL-9a `l2t_itlb_pbmt` returns the page's memory type on a hit: the
more restrictive of the G-stage and VS-stage PBMT, ordered
PMA < NC < IO, and PMA (2'b00) when neither stage sets one.
The ITLB stores it (ITLB-3a) and combines it with the region
attributes into the effective type, the most restrictive of
the three (mmu_decisions.md MMU-U6, ruled session-071). A
reserved PBMT, or a non-zero one with PBMTE clear, never
reaches this port: the walker faults it.
5. Faults¶
IL-10 A fault response ends the transaction. The cause
distinguishes three: a page fault from a single-stage or
VS-stage walk, a GUEST page fault from the G-stage, and an
access fault. MMU-16. The access fault has five sources: the
PMP check the walker makes on every access (MMU-10, MMU-10d),
the PMA check on every access (MMU-12), a page table outside
cacheable coherent memory (MMU-12a), a PPN naming an address
this implementation cannot form (MMU-28), and an error from
the walker's memory port (ptw_mem_interfaces.md WM-7). This
named the PMP check only; session-077.
IL-11 The faulting virtual address is not returned. The client
supplied it and holds it against the tag.
IL-11a The faulting GUEST PHYSICAL address IS returned on
`l2t_itlb_gpa`, valid on a guest page fault only. The
client never had it; it is
produced inside the nested walk. Shtvala requires `htval`
to carry it. This is the one address that travels back on
this port, and it continues to the IFU as
`itlb_ifu_gpa`, IT-6a. It is FAULT_GPA_WIDTH = 56 bits and
carries every faulting GPA whole (mmu_decisions.md MMU-23).
For kind 00 (IL-11b) the walker returns the page and the
IFU fills the offset. Ruled session-077 (Jeff), after
BP-123; BUILT by BP-124. This read "It is 0 when the
faulting guest physical address does not fit GPA_WIDTH
(MMU-30)"; MMU-30 is withdrawn.
IL-11b `l2t_itlb_gpa_imp` says what the GPA is, valid on a guest
page fault only: 2'b00 the fetch's own guest physical
address, 2'b01 an implicit read of a VS-stage page table,
2'b10 an implicit write of one (the Svadu update), 2'b11
reserved. The backend needs it to write htinst, which must
be a pseudoinstruction for an implicit-access fault with a
non-zero htval (mmu_decisions.md MMU-29). It continues to
the IFU as `itlb_ifu_gpa_imp`, IT-6c. Added session-077
(Jeff).
6. Maintenance¶
IL-12 SFENCE.VMA does not cross this boundary, and neither do
HFENCE.VVMA and HFENCE.GVMA, nor the Svinval instructions,
which act as those three (mmu_decisions.md MMU-U8). The ITLB
has its own invalidate port, ITLB-14. The walker has none,
because it holds no translation (MMU-17); an L2 TLB, when
added, has its own (MMU-18). Neither forwards to the other.
MMU-17a.
IL-13 A walk in flight when an invalidate arrives completes. The
walker installs nothing in any case; an L2 TLB, when added,
does not install the result. MMU-17. Whether the response is
still returned to the client, or suppressed so the client's
tracker entry must time out, is the one thing this port must
state and IL-14 states it.
IL-14 The response is returned normally. The client installs
nothing, because a client that received an invalidate in
the same window discards its own tracker entry. A
suppressed response would leave the client's tag allocated
with nothing to release it.
7. Open¶
None. MMU-U6, MMU-U7 and MMU-U8, which reached IL-7, IL-9 and IL-12, were ruled session-071; IL-9a adds l2t_itlb_pbmt. MMU-U9 was ruled session-077; IL-10, IL-11a and IL-11b carry it.
8. Bindings¶
ITLB-3 Page sizes, IL-7.
ITLB-4 ASID and global, IL-3 and IL-8.
ITLB-8 Contrasted by IL-5.
ITLB-10 The in-flight match that keeps duplicate requests off
this port.
ITLB-14 The ITLB invalidate port, IL-12.
ITLB-U1 Tracker depth, decoupled from IL-1 by design.
IT-1 Two outstanding I-side translations, the sizing input
to IL-1.
MMU-3 The L1 TLBs are clients of this port.
MMU-10 The walker's PMP check, the access-fault cause of IL-10.
This read "the second cause"; IL-10 lists it third.
Session-071.
MMU-13 PMA attributes, deliberately absent by IL-9.
MMU-15 The static region table IL-9 defers to.
MMU-17 Invalidate during a walk, IL-13 and IL-14.
MMU-18 The L2 TLB invalidate port, when there is one, IL-12.
MMU-1 No L2 TLB now; the walker is the server, section 1.
MMU-27 The two-stage size, IL-7a.
MMU-29 The implicit-access kind, IL-11b.
MMU-23 FAULT_GPA_WIDTH, IL-11a.
MMU-24c The access type and privilege, IL-3d.
MMU-31 The G-stage-only permission byte, IL-8.
9. Document History¶
2026-10-09 session-077, rulings (Jeff). The server is the walker,
not an L2 TLB (MMU-1 reversed); the port names keep
l2t. l2t_itlb_gpa_imp and IL-11b added. IL-7a, the
two-stage size. IL-10 names every access-fault
source. IL-1, IL-3b, IL-5, IL-6, IL-12 and IL-13
restated for a walker. This document had no history
section; its earlier changes are in PROJECT_STATUS.
2026-10-09 session-077, after BP-123, rulings (Jeff). IL-3d:
itlb_l2t_acc as BP-123 built it (on the walker only;
BP-124 has the ITLB drive it), and itlb_l2t_priv.
IL-11a: l2t_itlb_gpa is FAULT_GPA_WIDTH = 56, the
zero sentinel withdrawn. IL-8: the G-stage-only
permission byte.
2026-10-10 session-077, after BP-124. IL-3d and IL-11a built.
2026-10-15 session-080, after DOC-002. Section 2: the far end is
the walker.
ptw_mem_interfaces.md
planning/interfaces/ptw_mem_interfaces.md on GitHub
Page Table Walker to Memory Interface¶
FILE: ptw_mem_interfaces.md
SOURCE: session-077 rulings; mmu_decisions.md MMU-2, MMU-8
STATUS: DRAFT
UPDATED: 2026-10-09
CONTACT: Jeff Nye
Owns the WM-N registry.
1. Scope¶
The page table walker's port to memory (mmu_decisions.md MMU-2).
The walker reads PTEs on it and performs the Svadu update of MMU-8
on it. Nothing else uses it.
TODAY A TESTBENCH ANSWERS IT. There is no L2 (Jeff, session-076),
so tb_fe_top's memory model answers this port, from the same memory
image as the model that answers the L1I's memory port
(fe_decisions.md FE-21). The port is still real RTL on the
walker, specified as the permanent boundary: when an L2 exists the
walker's traffic goes on a master edge into it (MMU-2), and how the
compare-and-swap of WM-5 is carried there is mmu_decisions.md
MMU-U3.
The client side of the walker is itlb_l2tlb_interfaces.md. The
walk itself is mmu_decisions.md.
2. Naming¶
ptw_mem_<signal> walker -> memory
mem_ptw_<signal> memory -> walker
No stage suffixes, as for l1i_ifu_interfaces.md 2.
3. Ports¶
ptw_mem_req_val walker -> memory
ptw_mem_req_rdy memory -> walker
ptw_mem_req_op walker -> memory
ptw_mem_req_paddr [PA_WIDTH-1:0] walker -> memory
ptw_mem_req_cmp [63:0] walker -> memory
ptw_mem_req_swap [63:0] walker -> memory
mem_ptw_rsp_val memory -> walker
mem_ptw_rsp_data [63:0] memory -> walker
mem_ptw_rsp_err memory -> walker
ptw_mem_req_op 0 READ read the 8 bytes at paddr
1 CAS compare and swap the 8 bytes at paddr
There is no response ready, no identifier and no byte enable.
4. Rules¶
WM-1 EVERY ACCESS IS ONE PTE: 8 bytes, naturally aligned, and
atomic. ptw_mem_req_paddr[2:0] is zero. The privileged
specification performs every implicit access to the
translation structures at PTESIZE, which is 8 for Sv39 and
Sv39x4, and an A/D update rewrites the whole PTE, not one
bit of it. The memory side asserts the alignment.
WM-2 A request is accepted in a cycle where ptw_mem_req_val and
ptw_mem_req_rdy are both high. The walker holds every
request field stable from the cycle val rises until
acceptance. ptw_mem_req_rdy does not depend combinationally
on ptw_mem_req_val.
WM-3 AT MOST ONE REQUEST IS OUTSTANDING, from acceptance until
its response. The walker performs one walk at a time
(mmu_decisions.md MMU-U2) and each step of a walk needs the
previous PTE, so a second request would have nothing to
carry.
WM-4 The response is presented when mem_ptw_rsp_val is high, no
earlier than the cycle after acceptance. The walker accepts
it unconditionally in that cycle. WM-3 makes an identifier
unnecessary.
WM-5 CAS COMPARES AND STORES AS ONE ATOMIC OPERATION. The memory
compares the 8 bytes at paddr with ptw_mem_req_cmp; if they
are equal it stores ptw_mem_req_swap there. In either case
mem_ptw_rsp_data returns the value the memory held BEFORE
the operation, so the walker knows the store happened
exactly when mem_ptw_rsp_data equals ptw_mem_req_cmp. No
other access to those bytes may fall between the compare
and the store. This is the privileged translation
algorithm's step 9 (mmu_decisions.md MMU-8): on a mismatch
the walker restarts the walk.
WM-6 A CAS RESPONSE IS NOT PRESENTED BEFORE THE STORE IS VISIBLE
to every later access by any agent. The walker returns the
translation only after this response (MMU-8), so the update
precedes the fetch that needed it in the global order, as
the specification requires.
WM-7 mem_ptw_rsp_err high with mem_ptw_rsp_val means the memory
side returned an error. mem_ptw_rsp_data is then undefined,
and for a CAS nothing was stored. The walker reports an
access fault, cause 1, for the translation it was
performing. The memory side's error has the same standing
as l1i_ifu_interfaces.md IF-15.
WM-8 A REQUEST THAT FAILS A CHECK IS NEVER PRESENTED. The walker
makes the PMP and PMA checks of mmu_decisions.md MMU-10d,
MMU-12 and MMU-12a, and refuses an address it cannot form
(MMU-28), before it presents the request, so no checked
failure reaches this port. The same division as
l1i_ifu_interfaces.md IF-22.
WM-9 While rstn is low the walker holds ptw_mem_req_val low and
the memory side holds mem_ptw_rsp_val and ptw_mem_req_rdy
low. Nothing is outstanding across reset.
5. The testbench memory model¶
What tb_fe_top's model must do on this port, because the programs BP-123 writes depend on it:
WM-10 ONE MEMORY IMAGE. The model answering this port and the
model answering the L1I's memory port read and write one
store, so a page table written by the program's set-up and
a later instruction fetch see the same bytes, and an A bit
set by the walker is visible to a later walk.
WM-11 IT CAN CHANGE A PTE BETWEEN A WALK'S READ AND ITS CAS, on
the stimulus's instruction, so the mismatch path of WM-5
and the restart of MMU-8 are exercised. An agent writing
memory between the two is exactly the case the compare
exists for.
WM-12 IT CAN RETURN mem_ptw_rsp_err on a chosen access, read or
CAS, so WM-7 is exercised.
WM-13 IT CAN HOLD ptw_mem_req_rdy LOW and vary the response
latency, so the walker is not tested against one fixed
timing.
6. Open¶
None. The L2 half of the compare-and-swap is mmu_decisions.md MMU-U3, moved to the L2 work.
7. Bindings¶
MMU-2 The port this document specifies.
MMU-8 The CAS of WM-5 and the ordering of WM-6.
MMU-10d The checks of WM-8, at privilege S.
MMU-12a Page tables only in cacheable coherent memory, WM-8.
MMU-28 Addresses the walker cannot form, WM-8.
MMU-U2 One walk at a time, the basis of WM-3.
MMU-U3 The L2 realisation of WM-5.
FE-21 The L1I memory port whose model shares WM-10's image.
IL-* The walker's client side, itlb_l2tlb_interfaces.md.
8. Document History¶
2026-10-09 Created, session-077, from the rulings that reversed
MMU-1 and confirmed full Svadu (Jeff). The walker has
its own memory port, answered by a testbench model
until an L2 exists. One request outstanding, 8-byte
READ and CAS, a CAS response only once the store is
visible, checks made before the request.
L1 TLB¶
Status: RTL complete, interim documentation
The first-level TLBs; the ITLB is built, the DTLB is planned.
Specification: itlb_decisions.md, itlb_ifu_interfaces.md, itlb_l2tlb_interfaces.md (in the Overview above)
Related: IA tasks: BP-118, BP-124; Frontend demo: fd14_translation: Sv39 Walk, Sv39x4 Nested Walk and Svadu CAS
L2 TLB¶
Page Cache¶
Status: RTL planned, interim documentation
Caching of non-leaf page table entries in the L2 TLB; there is no L2 TLB now (MMU-1).
Specification: mmu_decisions.md (in the Overview above)
Page Table Walker¶
Status: RTL complete, interim documentation
The page table walker, Sv39 and nested Sv39x4 walks, hardware A/D updates (Svadu), and one walk at a time.
Specification: mmu_decisions.md, ptw_mem_interfaces.md, itlb_l2tlb_interfaces.md (in the Overview above)
Related: IA tasks: BP-123, BP-124; Frontend demo: fd14_translation: Sv39 Walk, Sv39x4 Nested Walk and Svadu CAS; Frontend demo: fd15_faults: Page, Access and Guest-Page Fetch Faults
Last Level Page Table Walker¶
Status: RTL planned, interim documentation
A separate last-level page table walker; the current design has one walker that serves the ITLB directly.
Specification: mmu_decisions.md (in the Overview above)
Hypervisor Page Table Walker¶
Status: RTL complete, interim documentation
Two-stage translation for the hypervisor extension, Sv39 over Sv39x4; the nested walk is done by the one page table walker.
Specification: mmu_decisions.md (in the Overview above)
Related: IA task: BP-124; Frontend demo: fd14_translation: Sv39 Walk, Sv39x4 Nested Walk and Svadu CAS
Miss Queue¶
Status: RTL planned, interim documentation
The L2 TLB miss queue; there is no L2 TLB now, and one is a later performance step (MMU-1).
Specification: mmu_decisions.md (in the Overview above)
Prefetcher¶
Status: RTL planned, interim documentation
L2 TLB prefetch; there is no L2 TLB now (MMU-1).
Specification: mmu_decisions.md (in the Overview above)
PMP¶
Status: RTL complete, interim documentation
Physical memory protection checks and the access faults they raise.
Specification: mmu_decisions.md (in the Overview above)
Related: IA tasks: BP-118, SYS-002; Frontend demo: fd15_faults: Page, Access and Guest-Page Fetch Faults
PMA¶
Status: RTL complete, interim documentation
Physical memory attribute checks on fetch, including uncached and non-idempotent regions.
Specification: mmu_decisions.md (in the Overview above)
Related: IA task: BP-118; Frontend demo: fd15_faults: Page, Access and Guest-Page Fetch Faults; Frontend demo: fd18_uncached: Uncached Fetch