/MIPS-CPU

A Simulative CPU Running on MIPS Instruction System Based on Logisim.

Primary LanguageAssemblyMIT LicenseMIT

MIPS-CPU

A Simulative CPU Running on MIPS Instruction System Based on Logisim.

MIPS-CPU-GIF

ALU Circuit

Description

This ALU is implememted to do 13 operations determined by operator S, with two input X/Y, it can produce result according to the operator S and emit signed and unsigned overflow/Equal signals. The specific circuit diagram is as below:

Overview

alu_1

Adder Circuit with Overflow Detection

alu_2

Register File

Description

This regfile is implemented to simulate the 32 registers running in the MIPS CPU, with the signals passed to it, it can store data into register according to the given register number, and it can directly load up to two register's data to the port.

Overview

regfile

Single Cycle CPU

Description

Fully organized according to the circuit given by Mars' MIPS X-Ray function to be consistent.

Overview

singlecyclecpu

Pipeline CPU with Bubble Insertion Method

Used Bubble Insertion method to prevent data and control hazard.

Overview

pipeline_bubble

Pipeline CPU with Data Redirection Method

Used Data Redirection method to prevent data hazard, optimized so that it runs less cycles compared to Bubble Insertion method.

This pipeline CPU is equipped with a CP0 which handles exception(interruption), with 3 intteruption source buttons named ExpSrc0 ExpSrc1 ExpSrc2

The CPU runs into exception mode on clicking one of the buttons, running an exception service program which displays 2 or 4 or 8 determined by the source number of the clicked button.

The exception service program handles environment protecting, EPC protecting so that CPU surpports multi-level interruption.

Overview

pipeline

Benchmarks

There are various programs for testing the CPU in the Benchmarks folder, with a combined final benchmark named Benchmark.hex.

All the benchmarks are assembled by Mars, a powerful MIPS assembling and debugging tool.

License

MIT.