This project implements a 32-bit Memory Management Unit (MMU) in Verilog HDL capable of translating virtual addresses into physical addresses using a Translation Lookaside Buffer (TLB) and a Page Table Walker (PTW).
The MMU supports:
- Virtual-to-Physical Address Translation
- TLB-Based Address Lookup
- Page Table Walking (PTW)
- Permission Checking
- Execute Fault Detection
- Bypass Mode Operation
- Verification using Icarus Verilog and GTKWave
This project demonstrates key concepts in Computer Architecture, Memory Management, RTL Design, and Digital System Verification.
- โ 32-bit Virtual Memory Translation
- โ Translation Lookaside Buffer (TLB)
- โ Page Table Walker (PTW)
- โ Permission Checking
- โ Execute Fault Detection
- โ TLB Refill Mechanism
- โ Physical Address Generation
- โ Bypass Translation Mode
- โ Self-Checking Testbenches
- โ GTKWave Verification
- Stores recent address translations
- Performs VPN + ASID matching
- Provides fast translation lookup
- Handles TLB misses
- Reads page table entries from memory
- Extracts PPN and permission bits
- Read Permission Validation
- Write Permission Validation
- Execute Permission Validation
- User/Supervisor Access Checking
Generates:
Physical Address = {PPN, Offset}
MMU-Design-Verilog-HDL
โ
โโโ docs
โ โโโ MMU_Project_Documentation.md
โ
โโโ images
โ โโโ bypass_mode.png
โ โโโ execute_fault.png
โ โโโ mmu_architecture.png
โ โโโ mmu_waveform.png
โ โโโ tlb_hit.png
โ โโโ tlb_miss_refill.png
โ
โโโ reports
โ โโโ Verification_Report.md
โ
โโโ rtl
โ โโโ mmu.v
โ โโโ perm_check.v
โ โโโ ptw.v
โ โโโ tlb.v
โ
โโโ tb
โ โโโ mem_bram.v
โ โโโ mem_bram_tb.v
โ โโโ mmu_tb.v
โ โโโ perm_check_tb.v
โ โโโ ptw_tb.v
โ โโโ tlb_tb.v
โ
โโโ .gitignore
โโโ LICENSE
โโโ README.md
31 12 11 0
+-----------------------+-------------+
| Virtual Page Number | Offset |
+-----------------------+-------------+
20 bits 12 bits
31 12 11 0
+-----------------------+-------------+
| Physical Page Number | Offset |
+-----------------------+-------------+
20 bits 12 bits
iverilog -g2012 -o mmu_test \
tb/mmu_tb.v \
tb/mem_bram.v \
rtl/mmu.v \
rtl/tlb.v \
rtl/ptw.v \
rtl/perm_check.vvvp mmu_testgtkwave mmu.vcdResult:
PA = 00ABC100
โ PASS
Result:
PA = 00ABC200
โ PASS
Result:
exec_fault = 1
โ PASS
Result:
PA = CAFEBABE
โ PASS
TEST1 : TLB MISS + REFILL
PA=00abc100
TEST2 : TLB HIT
PA=00abc200
TEST3 : EXECUTE FAULT
exec_fault=1
TEST4 : BYPASS
PA=cafebabe
MMU TEST COMPLETE
| Tool | Purpose |
|---|---|
| Verilog HDL | RTL Design |
| Icarus Verilog | Simulation |
| GTKWave | Waveform Analysis |
| Git | Version Control |
| GitHub | Repository Hosting |
| VS Code | Development Environment |
- Memory Management Concepts
- Virtual Memory Translation
- Translation Lookaside Buffers (TLB)
- Page Table Walking (PTW)
- Permission Checking Logic
- RTL Design Methodology
- Functional Verification
- Waveform Debugging
- Digital System Design
- 4-Way Set Associative TLB
- Multi-Level Page Tables
- TLB Replacement Policies
- RISC-V Sv32 Integration
- Performance Counters
- FPGA Deployment
- AXI Memory Interface
Detailed documentation:
docs/MMU_Project_Documentation.md
Verification report:
reports/Verification_Report.md
Vaishnava Devi
B.Sc. Digital and Cyber Forensic Science
This project is licensed under the MIT License.





