Overview

You will implement a multi-cycle MIPS processor in CircuitVerse. You will receive a CircuitVerse group invitation for the project, and must use this group for your project submission to count.

Multi-stage MIPS datapath

MIPS ISA changes

You only need to support add, addi, lw, sw, j, jr, and blez (the instructions from your homework 1 assembler, or mine), though you can add more if you choose.

Control

Use a horizontal table-based/microprogram control using a CircuitVerse ROM. You will need some external logic for instruction dispatch in the ID-stage microprogram, and to control the PC mux on branch instructions.

In the first and second cycle of an instruction, all instructions should use the same instruction fetch control table entry. For instruction decode, you should dispatch to a different location in the control table for each instruction. JR instructions should take just two cycles IF ID. Branch(es) should take three IF ID EX. ALU instructions should use four IF ID EX WB. Store instructions should also take four, but those cycles should be IF ID EX DM. Finally load instructions should take five cycles IF ID EX DM WB.

The built-in ROM unit is quite limited in the bit width of data, and number of entries. However, if you drop a ROM unit into your circuit, select and copy it, then paste into a text editor, you get JSON-format data describing the ROM and its contents. You can edit this directly, then copy the entire JSON block and paste back into CircuitVerse. Change the "bitWidth" of the "Address" section to allow more entries. Change the "bitWidth" of the "DataOut" section (up to 32) to allow wider data. If you need more than 32 control bits, you will need two parallel control table ROM units. Initialize the ROM data with a comma-separated list of integers in the "constructorParameters" section.

Memory

You'll use a single EEPROM unit for both data and instruction memory. We will not be using the CircuitVerse RAM element because its data cannot be pre-initialized. The EEPROM unit has the same interface, but can be set with initial data by editing the JSON in the same way that the ROM can. You can modify your homework 1 assembler (or mine) to output decimal instead of hex numbers, then paste the resulting programs directly into the EEPROM JSON.

You can examine the values after your program runs, either by pasting the JSON definition into a text editor, or by clicking the "Core Dump" button in the element properties. With the Core Dump button, the data contained in the EEPROM will be displayed in your browser's JavaScript developer console.

CircuitVerse elements

You are free to use any of the standard CircuitVerse elements. Here are some that you'll need to use to complete the project

Circuit cleanliness

A clean and organized circuit will help to avoid bugs, and when trying to find/debug them. Plus it will help for grading, which could get you more partial credit if things are not working as they should.

Some tips: