Skip to content
code0100funPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

66 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game Boy DMG on Tang Nano 20K

A Game Boy (DMG) implemented in SystemVerilog on the Sipeed Tang Nano 20K (Gowin GW2AR-18 FPGA). Built from first principles using the Pan Docs as the primary reference.

Status

Work in progress — following a tutorial-driven development approach.

Component Status
CPU (LR35902) Registers, ALU, decoder, full instruction execution
Memory bus Address decoder with ROM, WRAM, HRAM, I/O, IE
Memory primitives Single-port RAM, dual-port RAM, ROM
PPU Not started
APU Not started
Timer Not started
Joypad Not started
LCD (ST7789) Not started
Cartridge / MBC Not started

Toolchain

Fully open-source:

Quick Start

# Install dependencies (Arch/CachyOS)
mise run deps

# Run all testbenches
mise run sim

# Build and flash to Tang Nano 20K
mise run flash

Project Structure

rtl/
  core/cpu/     CPU — regfile, ALU, decoder, execution engine
  core/bus.sv   Address decoder / memory bus
  memory/       RAM and ROM primitives (BSRAM-inferred)
  platform/     Board-specific (constraints, blinky)
sim/
  tb/           Verilator C++ testbenches
  common/       Testbench helper class
  data/         Test ROM hex files
docs/
  tutorials/    Step-by-step build tutorials (00–23)

Tutorials

The project is developed through a series of tutorials in docs/tutorials/:

  1. Toolchain Setup
  2. FPGA Fundamentals
  3. Blinky
  4. Simulation and Testbenches
  5. Memory Primitives
  6. CPU: Registers and ALU
  7. CPU: Instruction Decoder
  8. CPU: Instruction Execution
  9. Memory Bus

See docs/tutorials/TODO.md for the full roadmap.

Hardware

  • Board: Tang Nano 20K
  • FPGA: Gowin GW2AR-18 (20,736 LUT4s, 828K BSRAM, 64Mbit SDRAM)
  • Display: ST7789 SPI LCD (240×240, on-board)
  • Input: Pushbuttons on breadboard (8 GPIO)
  • Audio: PWM on GPIO pin

License

Apache 2.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages