Show HN: m6502, a 6502 CPU for FPGAs and Tiny Tapeout
3 points
2 hours ago
| 1 comment
| github.com
| HN
Hey HN,

Recently built an Apple II emulator and at the same time was getting into Tiny Tapeout and decided it would be cool to build a cycle-accurate 6502 CPU and an MCU for it. It's cycle accurate and the core itself should be 100% compatible with a stock MOS 6502 (would need to still test this though!).

Tested on some FPGAs (fomu, ulx3s) and works great, hoping to get it taped out in the upcoming IHP26a shuttle.

Also as part of the project I built a bus multiplexer to allow memory/bus access from an RP2040 to work around the limited pin count on Tiny Tapeout. This let's you load up programs on RP2040 and the CPU can read/write from it.

umairnadeem123
1 hour ago
[-]
very cool. tiny cpu cores are such a good way to learn real tradeoffs. are you planning formal verification passes or sticking with simulation test benches for now?
reply
chrismoos
1 hour ago
[-]
Yeah maybe at some point -- I'd need to learn about all the formal stuff though first, it's new to me. For now it's cocotb test benches and also I run it through the Klaus test (https://github.com/Klaus2m5/6502_65C02_functional_tests) which is pretty comprehensive. There are definitely edge cases though that I found when actually running it on physical hardware that my tests didn't find (i.e ran into some IRQ servicing issues), so not easy to be 100%.
reply