Skip to content

Raven v1.30.0 — nothing lost in translation

Latest

Choose a tag to compare

@github-actions github-actions released this 09 Nov 21:59
· 3 commits to main since this release

🐦‍⬛ Raven v1.30.0: nothing lost in translation

🧭 TL;DR. The Virtual Memory tab was rebuilt from scratch. Every translation is replayed step by step 🔍, the TLB is drawn as sets × ways 🧱, the page table can be walked level by level 🗺️, and the stats say why each miss happened 📊. Underneath that, the MMU got simpler (Sv32 only, three modes) 🧹, each core got its own TLB 🧠, page-table walks now pay for their PTE reads through the caches 💸, three translation bugs are fixed 🐞, and the tab comes with a guide in English and Portuguese 📖.


🔍 Watch a translation happen

The old tab showed state at rest: a satp dump, a text tree, a flat list of TLB entries. Now every translation leaves a record, and the tab replays it:

╭─ Access #8 · core 0 ─────────────────────────────────────────────── following data ─╮
│ lbu  t0, 0(a2)    load · priv M · pc 0x00000010 · hart 0 · ASID 0                    │
│ VA 0x00001000   VPN[1] 0x000    VPN[0] 0x001    offset 0x000                         │
│                 0000000000      0000000001      000000000000                         │
│  1  TLB      set 1 (0x00001 mod 8) · set 0 for 4 MiB pages · none of its 4 ways…  MISS │
│  2  root     satp → table at 0x00fbf000                                              │
│  3  VPN[1]   PTE[0x000] @ 0x00fbf000 = 0x003ef801   pointer → table 0x00fbe000   RAM │
│  4  VPN[0]   PTE[0x001] @ 0x00fbe004 = 0x0000041f   leaf · 4 KiB page · RWXU     RAM │
│  5  PA       0x00001000 = frame 0x00001000 + offset 0x000                 +20 cycles │
│  6  TLB ←    set 1 · way 0 · the way was free · A set in the PTE                     │
╰──────────────────────────────────────────────────────────────────────────────────────╯

Each field of the address keeps its colour on every line that uses it, so you can follow VPN[1] from the address into the root table and the offset all the way into the physical address.

subtab what it shows
🔍 walk one translation step by step, over a history of the last 64 (filter by misses or faults)
🧱 tlb the TLB as sets × ways, with page size, VPN→PPN, permissions and recency in every cell. ● installed now, ✓ hit now, ▸ probed
🗺️ map the page table as columns, one per level: follow a pointer into the next table, see each PTE decoded field by field, or press / and type an address to see its path
📊 stats hit rate over time, cost (cycles spent walking and their share of the run), reach, and why it missed: first touch, held before and lost, store to a clean page, or no mapping
⚙️ config every option on screen with the chosen one lit. Every change applies at once; there is no apply button
  • 👣 s steps to the next translation and b steps back. ← → pin an older or newer translation, and every subtab follows the pin; g goes back to the newest.
  • 🌱 With virtual memory off, the tab opens on a short introduction and a turn on button.

🎛️ Three modes instead of four

vm_mode= Who builds the page table Translates in M-mode?
⚪ off nobody: every address is physical —
🟢 auto Raven: an identity map, 4 KiB pages over your program, 4 MiB megapages elsewhere ✅ yes, so any program shows the TLB at work
🔵 program your program: it writes satp and its own tables, as on real hardware ❌ no
  • 🧹 The MMU is Sv32 only. The parametric Custom scheme and the old offset map, which never actually worked, are gone.
  • 🛡️ Choosing auto installs the map the moment you choose it, and the page map's permissions (R W X U), global bit and ASID are yours to break: clear W and the next store page-faults, with the walk showing exactly where.

🧠 A TLB per core

As in hardware, each core now keeps its own TLB, swapped in with its L1.

  • 🔀 [ and ] pick whose TLB, statistics and translations the tab shows, and the panel titles name the core.
  • 🧽 A program's sfence.vma flushes only the core that ran it. The tab's flush tlb, and a new TLB shape, apply to every core.

💸 Walks pay for what they read

A TLB miss used to cost a fixed number of cycles. Now each PTE read is a load through the D-cache: a PTE already in L1 costs an L1 hit, and one that must come from memory costs a full miss and fills a line on the way.

 first walk, cold tables
 3  VPN[1]   PTE[0x000] @ 0x00fbf000 = 0x003ef801   pointer → table 0x00fbe000   RAM +54
 4  VPN[0]   PTE[0x000] @ 0x00fbe000 = 0x0000001f   leaf · 4 KiB page · RWXU     RAM +54
 5  PA       0x00000000 = frame 0x00000000 + offset 0x000                   +128 cycles

 a few instructions later, same tables, now in L1
 3  VPN[1]   PTE[0x000] @ 0x00fbf000 = 0x003ef801   pointer → table 0x00fbe000    L1 +2
 4  VPN[0]   PTE[0x001] @ 0x00fbe004 = 0x0000041f   leaf · 4 KiB page · RWXU      L1 +2
 5  PA       0x00001000 = frame 0x00001000 + offset 0x000                    +24 cycles

That is 20 + 54 + 54 against 20 + 2 + 2: the same walk, five times cheaper once its tables are cached.

  • ⏱️ The walk cycles in config are now the walker's own work, and the cache cost comes on top of them.
  • 🔌 The caches are off by default. Turn them on in Settings to see this; with them off, a walk costs the walker's cycles and the lines just say RAM.

🐞 Translation bugs fixed

  • 🥞 The auto map's page tables sat on the stack. The root was placed at the top of memory, right where sp starts, so a deep enough stack overwrote the tables that mapped your code. The tables now sit below the harts' stacks, and config shows where.
  • 🫥 The walker read raw RAM. A PTE your program had just stored could still be dirty in a write-back D-cache, so the walk saw the old value and faulted on a mapping that existed, and the A/D bits it wrote were lost when the line was written back. The walker now reads a PTE as a load would see it and updates every cached copy.
  • 🔕 Switching to auto after assembling did nothing. The flags changed, but no map was installed, satp stayed Bare, and the tab advised writing satp and mret. Now the map is written at once.

📖 A guide on the tab

Press ? on the Virtual Memory tab for a scrollable guide, with its sections listed down the left:

  • 🧩 how an address is translated, with the Sv32 address split drawn out;
  • 🔍 what every subtab and every symbol means;
  • ⌨️ every key;
  • 📚 a glossary.

🌐 It is in English and Portuguese (l switches between them and keeps your place). Every acronym is spelled out the first time it appears: MMU (Memory Management Unit), TLB (Translation Lookaside Buffer), PTE (page-table entry)… The guided tour is still there, one t away, and its text was reviewed with the same rule.


📝 Editor: open a program, or add a file

All editor tabs build into one program, and the first tab's code runs first. Ctrl+O used to drop an opened file into a new tab, so the editor showed your new file while the old program kept running. 🙃

key button what it does
Ctrl+P open code 📂 opens a program: the file replaces every tab
Ctrl+O + add file ➕ adds a file to the program as one more tab, and says which tab runs first

🏷️ With several tabs, the Run tab's instruction list marks where each tab's code begins (── soma.s ──), and its title names the tab the PC is in.

📌 Next up: saving and opening a multi-file project (#90).


⚠️ Upgrade notes

  • 📄 Old configs load. vm_mode=sv32 and vm_mode=custom load as auto, manual loads as program, and vm_offset_bits / vm_level_bits are ignored. raven export-config writes the new names.
  • ⌨️ ? on the Virtual Memory tab now opens the guide; the tour moved to t inside it. Other tabs are unchanged.
  • 🔌 For raven-engine users, the AddressTranslation capability changed:
    • probe returns a TranslationRecordView, and TranslationResult is gone.
    • TlbEntryView gained way and recency.
    • TlbStatistics gained walk_cycles, first_touches, first_touch_bytes, dirty_rewalks and walk_faults.
    • TranslationScheme gained entry_bits and entry_fields.
    • The new methods (idle_reason, tlb_policy, tlb_enabled, recent, read_table, tlb_count, core_tlb_stats, core_tlb_entry, core_hit_rate_history, core_probe) all have defaults.
    • PagingScheme, MapKind and MapGran are gone from falcon::mmu.

📦 Downloads

Platform File
🪟 Windows x86-64 raven-x86_64-pc-windows-msvc.zip
🐧 Linux x86-64 (glibc) raven-x86_64-unknown-linux-gnu.tar.gz
🐧 Linux x86-64 (static, musl) raven-x86_64-unknown-linux-musl.tar.gz
🍎 macOS Intel raven-x86_64-apple-darwin.tar.gz
🍏 macOS Apple Silicon raven-aarch64-apple-darwin.tar.gz

🔐 Checksums are in SHA256SUMS.txt.

📖 Docs: docs/en/virtual-memory.md · 🇧🇷 docs/pt-BR/virtual-memory.md

Full changelog: v1.29.0...v1.30.0