Skip to content

Nambers/0dMIPS

Repository files navigation

0dMIPS

Codecov

MIPS64r6 SoC implementation with a 5-stage in-order pipeline (2-cycle MEM stage) and peripheral components, simulated and tested with Verilator.

Dependenices

How to run

  1. cmake -B build .
  2. cmake --build build -j ${$(nproc)-1} to build all. All binaries are placed under build/bin.
  3. cmake --build build --target allTests to build all tests.
  4. ./runAllTests.sh to run all generated tests under build/bin(by cmake), and use DUMP_COV=1 ./runAllTests.sh to dump coverage data.
  5. cmake --build build --target <script_name> to compile script into memory.dat, e.g. hello_world_c.

Features

  • 5-stage in-order pipeline with forwarding and hazard detection
  • L1 instruction & data cache with arbiter
  • CP0 coprocessor: timer interrupt, syscall, break, overflow exception
  • Peripherals via MMIO: VGA (640×480 @ 72Hz, deprecated), Timer, LED, mock stdout (simulation only)
  • TUI GDB-style debugger with pipeline state, registers, memory, and peripheral views

Roadmap

See open milestones for planned features.

Demo

Hello world with debugger (asciinema)

Hello world with debugger

Simulation file structure

  • debugger_tui GDB-style TUI debugger with information about pipeline(disassembly by capstone), registers, memory, peripherals.
  • SOC_debug enable debug print and press any key to step.
  • SOC_sim run simulation under info log.
  • SOC_run_sim run simulation without info log.
  • SOC_VGA_sim run simulation with VGA output(provided by SDL3).
  • VGA_sim run demo VGA simulation.

Schematic diagram

Schematic diagrams, synthesized and generated by Vivado

more in here schematic

About

[WIP] in-order 5(+1)-stages pipeline MIPS64r6el SoC implementation with peripheral components, simulated with verilator

Topics

Resources

License

Stars

Watchers

Forks

Contributors