Motorola 68000 support complete in Retro-uC

Posted on zo 17 juni 2018 in Retro-uC

I'm happy to announce that now support for the Motorola 68000 in the Retro-uC is complete. It uses the ao68000 core to implement the Motorola 68000 instruction set.

As usual, it has taken more effort than originally planned. As the ao68000 already had a Wishbone interface used as the internal bus for the Retro-uC the first steps went fluently. I needed to fix a bug in my block read support but that was quickly done.

The most time consuming was to get the endianness right. In the Retro-uC I currently have a memory map to access to I/O pins. This can be either accessed in 8 bit mode or in 32 bit mode. The Z80 and MOS6502 will access the memory map in 8 bit mode; the Motorola 68000 and the JTAG interface in 32 bit. As I want to have the I/O mapped to the same address in all three cores the endianness support has to be done right and all should agree on it. It seems my assumption on endianness when implementing Z80 and MOS6502 support did not agree with how the Motorola 68000 saw things. Several iterations had to be done to get all the cores agree on the same address for the I/O pins.

Another problem that has taken some time to get right was the fact that the ao68000 uses a ROM for storing microcode. A ROM is implemented on the MAX10 FPGA by using block RAM that is initialized and never written to. The memory initialization is not compatible with the dual image feature of the MAX10 used on the XLR8. This means programming a bitstream with the ao68000 included will overwrite the backup image on the MAX10; this also means this bitstream can't be programmed through the OpenXLR8 support in the Arduino IDE. After some fiddling I could program the FPGA also with my Bus Pirate.

To download the files please look at the release announcement and the gitlab release tag which include the download file and the release notes.

The code is quite generic and should be easily portable to other FPGA boards. If anybody feels like taken up such a challenge don't hesitate to contact me.