This is a single-cycle, functional MIPS processor simulator according to the reduced MIPS R300A ISA
mips_singlecycle's Introduction
MIPS Single Cycle
A single-cycle, functional processor simulator according to the reduced MIPS R3000 ISA. This project is developed for 2014 Spring CS410001-Computer Architecture course offerd by Prof. Ren-Song Tsay @ National Tsing Hua University
Characteristic
To meet the needs in course, both the instruction memory and data memory are changed into little-endian format.
Register 0 is a hard-wired constant 0; any attempt to write to register 0 takes no effect.
Assume that both the instruction memory and data memory are of 1K bytes size.
An error handler is implemented to deal with erroneous instruction executions.
The execution of the single cycle processor simulator would terminate after executing the halt instruction.
Input format
For each test case, all registers, except PC and $sp, are initialized to 0’s; other initial conditions are specified in the following two files.
iimage.bin: The instruction image (little-endian format, encoded in binary). The first four bytes indicate the initial value of PC, i.e. the starting address to load the instruction image. The next four bytes specify the number of words to be loaded into instruction memory (I memory). The remaining are the program text to be loaded into I memory. All other addresses not covered by the image are assumed to have been initialized to 0’s.
dimage.bin: The data image (little-endian format, encoded in binary). The first four bytes show the initial value of $sp. The next four bytes indicate how many words to be loaded into data memory (D memory). The remaining are the data to be loaded into D memory, starting from address 0. The contents of all other addresses not covered by the image are assumed to have been initialized to 0’s.
Output format
For each test case, the simulator wiil generate the following two files respectively:
snapshot.rpt: contain all register values at each cycle.
error_dump.rpt: contain error messages.
Usage
Put the iimage.bin and dimage.bin in the working directory
make: compile single_cycle
make clean: clean cache and log files generated in compiling