Skip to content

ilaydaucar/mipt-mips

 
 

Repository files navigation

Build StatusBuild status

MIPT-MIPS

MIPT-MIPS is a pre-silicon simulator of MIPS CPU. It measures performance of program running on CPU, thus taking best features of RTL and common functional simulation:

  • Precision. We provide cycle-accurate models of branch prediction unit and pipeline behavior.
  • Customization. Cache size, branch prediction algorithms, and other parameters can be easily changed.
  • Simplicity. Our source files are much more readable than RTL.
  • Speed. Simulation frequency gets up to 0.9 MHz on i5-7300U.

MIPT-MIPS can be used for different purposes:

  • Performance control of software optimizations: you may check IPC boosts of your programs
  • Pathfinding of hardware optimizations: you may easily integrate some nice feature to CPU model
  • Education: simulator is a nice experimental frog to study CPU internals

Getting started

  1. Clone repository with submodules: git clone --recursive https://github.com/MIPT-ILab/mipt-mips.git
  2. Install LibELF and Boost (instruction)
  3. Build MIPS binutils if you need to build MIPS ELF binaries.
  4. In POSIX environment (Linux, OSX, Windows-Ubuntu, and Msys) you can build MIPT-MIPS just by make mipt-mips command.
  5. WIP on MS Visual Studio support. Currently you can build MIPT-MIPS in command line using build.cmd batch file.

Basic command line options

  • -b <filename> — provide path to ELF binary file to execute
  • -n <number> — number of instructions to run
  • -f — enables functional simulation only
  • -d — enables detailed output of each cycle

C++ requirements

MIPT-MIPS uses C++17 and Boost 1.55. Thus, you have to use compilers of these versions or newer:

  • GCC 7
  • Clang 5.0
  • Apple LLVM 7.3.0 (uses -std=c++1z flag)
  • MS Visual Studio 2017 (Boost 1.65.1 is required)

Testing

  1. Get sure GoogleTest is fetched with other submodules.
  2. To run all unit tests in POSIX environment, use make test command.
  3. To run all unit tests in MS Visual Studio command line, run build.cmd batch file.

Known issues

  • Reduced subset of MIPS instructions is supported at the moment. Check this page for the detailed status.
  • Self-modifying code is not supported at the moment in performance mode.

More details about internals are available on Wiki


About MIPT-MIPS

This project is a part of ILab activity at Moscow Institute of Physics and Technology (MIPT).

The main goal of the project is to teach the students the computer architecture through development of a microprocessor implementing the MIPS instruction set in both functional and performance simulators.

May I contribute?

Yes, if you attend MIPT-MIPS lectures. See our CONTRIBUTING.md file for details.

About

Cycle-accurate pre-silicon simulator of MIPS CPU

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 96.6%
  • Makefile 2.3%
  • Other 1.1%