nessy

During the 4th semester, me and a couple of my friends designed and implemented a computer system on a FPGA board for extra credit in our Computer Architecture course. Our project, named nessy, is a computer system inspired by the NES console. It includes:

  • A CPU compatible with the MOS 6502 instruction set
  • A GPU that can draw a pixel, line and rectangle. It uses the board’s SDRAM to store the framebuffer. The GPU outputs an 800x600 video to the screen over VGA.
  • Two keyboard controllers that can be used to emulate up to 4 NES gamepads.

Link: https://github.com/BogdanW3/nessy

nessy-cpu-sim

While we were working on nessy, we needed a way to simulate running code on the CPU to test for compatibilty. To do this we implemented a way run the CPU in Verilator, and wrote a C++ wrapper that simulates the memory and memory mapped registers. The tests can be written in C, C++ and assembly, and are compiled using llvm-mos using our custom platform support. After the code runs, registers and memory are checked against expected values, to check if the instruction is correctly implemented.

Link: https://github.com/strajabot/nessy-cpu-sim

llvm-mos-nessy

Since optimzed assembly for the MOS 6502 instruction set is really difficult to write by hand, we wanted to use an existing compiler to write our tests and the game. We settled on using llvm-mos since it seemed the easiest to work with. However since we didn’t implement the NES PPU and APU, we coudn’t use the preexisting platform support, which led me to port the code to our platform. This includes changes to the linker script and common runtime.

Link: https://github.com/strajabot/llvm-mos-nessy