FPGA 6800 Uses Python Toolbox

Usually, when you think of designing — or recreating — a CPU on an FPGA, you assume you’ll have to use Verilog or VHDL. There are other options, as well, but those are the biggest two players in FPGA configuration. [Robert Baruch] has a multipart series where he uses nMigen — a Python toolbox — to recreate a 6800 CPU like the one used in many vintage video games and pinball machines.

Unlike some tools that try to convert software written in some language to an FPGA configuration, nMigen uses Python as a scripting language to create code in FHDL. This is similar in concept to VHDL or Verilog, but gives up the event-driven paradigm, opting instead to allow designers to explicitly call out synchronous and combinatorial logic.

Interestingly the tool hinges on Yosys, so it can target several Lattice parts as well as FPGAs from Intel/Altera and Xilinx.  It turns out that the n in nMigen is for new, and you might find some of the documentation for regular old Migen to be useful.

As for the 6800, it is one of the older CPUs used in hobby computers. The 8 bit CPU had about 72 instructions, depending on how you counted them. This was before reduced instruction sets were the rage, so it is a little extra work to implement a rich instruction set.

There are other Python options, such as MyHDL and PyCPU, for example. You can even try using .NET.

7 thoughts on “FPGA 6800 Uses Python Toolbox

    1. I think his dev board is 12 MHz, so maybe 6 MHz? Just guessing. Chances are though, that it will never be finished. I mean he hasn’t finished any of his projects. I think he like to discover and learn, but then gets bored.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.