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.





