Skip to content

VHDL implementation of the Nintendo Entertainment System for use on FPGAs and ASICs

License

Notifications You must be signed in to change notification settings

quigleyj97/nesgate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NESgate

VHDL-based emulator for the NES, targetted at the ULX3S development board.

CI status: Github Actions CI badge

Documentation: quigleyj97.github.io/nesgate

Bitstreams are compiled on each change via GitHub Actions and stored for 90 days. Download the latest here: ulx3s bitstream

See the programming section for instructions on how to upload the bitstream to your board.

Current status

MOS 6502

The 6502 core has substantial portions of the datapath implemented, with a working ALU and register file.

Diagram of currently implemented components

Building from source

Prerequisites

The easiest way to build this project is with Docker. The makefiles are already configured to do this, but you'll need Docker installed for them to work. I highly recommend sticking with Docker here, as building HDL tools from source (especially for macOS) is a painful adventure through the Dungeon Dimensions. You might even become unbearably knurd.

$ pipenv shell
$ ./synth

Programming

To load the resulting bitstream onto an FPGA board, use your favorite programmer. For instance, this is the command for openFPGALoader:

openFPGALoader -b ulx3s -f ./build/toplevel.ulx3s.bit --unprotect-flash

Organization

The project is broken down into individual, testable sub-modules in the /cores folder, using some scripts to help with independent testing.

Cores

Each core has an analyze script that imports each VHDL file into GHDL. It recieves an argument to the build folder, which is necessary to ensure we can CD into it and perform the analysis there. GHDL uses a work-obj<STD>.cf file that records the input paths for each file, not their absolute paths, and it needs to be populated for elaboration to work because VHDL is a nightmare.

There is also a test script that is invoked to test the module independently, this script receives the base directory to make invoking the python helpers possible without having to actually install them as a full on module, but this is not required.

Targets

Right now, there's only one target supported- the ULX3S with the ECP5-85k. I plan to extend the synthesis script to allow compilation for other targets as well, but we'll cross that bridge when we get there.

@subpage cores

About

VHDL implementation of the Nintendo Entertainment System for use on FPGAs and ASICs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published