https://github.com/thunder04/mips-simulator
A minimal implementation of a Multi-cycle MIPS Simulator, written in C
https://github.com/thunder04/mips-simulator
mips-assembly mips-simulator
Last synced: 12 months ago
JSON representation
A minimal implementation of a Multi-cycle MIPS Simulator, written in C
- Host: GitHub
- URL: https://github.com/thunder04/mips-simulator
- Owner: thunder04
- License: apache-2.0
- Created: 2024-02-08T08:51:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-13T09:57:05.000Z (over 1 year ago)
- Last Synced: 2025-03-13T10:36:22.426Z (over 1 year ago)
- Topics: mips-assembly, mips-simulator
- Language: C
- Homepage:
- Size: 191 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mips-simulator
A minimal implementation of a Multi-cycle MIPS Simulator. It is not intended to be used for production use.
It accepts a pseudo-object file, which is a file consisting of multiple 32-bit words, separated by a newline.
The program assumes the file is valid. Any line starting with `#` are treated as comments, and are ignored.
## Building The Simulator
Run `make clean; make all`
> [!IMPORTANT]
> It has been tested only on Linux.
### Running The Simulator
Run `./mips_simulator pseudo-object-file stats-file`.
For example: `./mips_simulator tests/1_math_test.o ./math_test.stats`
## Interesting Places
More like keypoints for the university assignment
- The `clock` of the CPU is stored at [`src/units/control/control.c`](src/units/control/control.c#L19)
- The `μPC` of the CPU is stored at [`src/units/control/control.c`](src/units/control/control.c#L19)
- The microcode for the instructions is stored at [`src/units/control/microcode.c`](src/units/control/microcode.c#L11)
- Registers, memory and Special Function Registers are stored at:
- For registers, [`src/units/register_file.c`](src/units/register_file.c)
- For memory, [`src/units/memory.c`](src/units/memory.c)
- For SFRs, [`src/special_function_registers.c`](src/special_function_registers.c)
- The ALSU is stored at [`src/units/arithmetic_and_logic_shift_unit.c`](src/units/arithmetic_and_logic_shift_unit.c)