Modular CPU Platform - MIPS processor card

Overview

I'm not certain why, but I've seen very few hobbyist projects based around the early MIPS processors.

MIPS-1 is a very interesting architecture, for a few reasons:

For this project, I've selected IDT's "RISController" series, the IDT79R3041 / IDT79R3051 / IDT79R3071 / IDT79R3081, based around the MIPS R3000 core. The documentation for these devices is very good, and covers the startup process in detail.

All of my work so far has been with the 3051, but the board should also work for the 3041, 3051E, 3071, 3071E, 3081 and 3081E.

The completed board (with a couple of bodge wires) looks like this:

Image of a PCB, with a PLCC-84 socket containing a MIPS R3051

Hardware

This project is built as a processor card for the Modular CPU platform. It's mostly just level shifters and buffering, but a few notes to highlight:

FPGA Gateware

Not too much to write here - there's a very simple (and quite inefficient) bus bridge to go between the R30x1 processor bus and an on-chip wishbone bus.

For the moment, I'm instantiating a 32 bit by 1024 word RAM and the same size ROM, although it would be possible to connect this to the QSPI RAM on the board at some point.

I used my On-FPGA Logic Analyser extensively throughout the bringup process on this project.

Here's an example of a boot, printing "Hello, World" on the debug interface:

Image of the GTKwave waveform viewer, showing the text

(Note - to save space in the capture buffer, I've gated off sample capturing at any point where the wishbone cycle signal is low, so these screen captures don't show the complete bus cycle).

The first few instructions read after reset look like this:

Image of the GTKwave waveform viewer, showing the first few instruction reads

Software Environment

For this project, I built GCC for MIPS using crosstool (configuration included in the ZIP at the end of this page).

It seemed (subjectively) much easier to get the software environment up and running to the point of being able to call C code compared to other processors I've tried in the past, although I've not quite got variadic arguments for printf working yet (UPDATE 2024-10-06, printf works now - see update at the end of the page).

A simple "Hello World" project is included in the ZIP file. The startup script isn't the most efficient (the BSS zeroing and DATA copying is done byte-by-byte), but it seems to work.

Challenges

Although it's mentioned in the software bringup guide, I didn't quite realise the importance of clearing the Cache isolation bit immediately during startup.

If this bit is 1, any data memory access (including those to non-cachable regions) will not go out onto the system bus.

This bit is not set to a defined value on hardware reset, so I found that a working MIPS startup program failed when I returned to the project a short time later.

MIPS-1 is a pipelined architecture, and this needs to be taken into consideration when looking at Waveforms for debug.

Status

Overall, this project is probably "Complete, for now".

I've only tested it with a R3051, but in the future, I might look at adding some more features:

UPDATE 2024-10-06

Some possibly useful resources: