MIPT-ILab / mipt-mips

Cycle-accurate pre-silicon simulator of RISC-V and MIPS CPUs
http://mipt-ilab.github.io/mipt-mips/
MIT License
338 stars 138 forks source link
branch-prediction branch-predictor clock-precise computer-architecture computer-architecture-lesson cpu cpu-cache cpu-model mips mips-binutils mipt optimizations pipeline pre-silicon prediction-algorithms risc risc-v simulation simulator

Contributors Total alerts Language grade: C/C++

MIPT-V / MIPT-MIPS

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

Simulator can be used for different purposes:

Key system-level features:

Key microarchitecture features:

Topology visualization:

Topology

Pipeline diagrams:

Pipeline

More details about internals are available on Wiki.

For questions, use our Discussions page.

Requirements

We use C++20 features and Boost 1.71. Thus, you have to use compilers of these versions or newer:

Install Boost before building the project.

To work with RISC-V traces, you need to install RISC-V toolchain. Please follow the official instruction.

To work with MIPS traces, you need to install MIPS binutils. Please follow our manual if you are using Linux, OS X, or Windows.

Our build system is CMake. You should install CMake 3.13.5 or higher. Check our Wiki page to get more details about CMake. Users of IDE (Visual Studio, Eclipse, CodeBlocks etc.) may generate project files with CMake as well.

To generate RISC-V opcodes, CMake uses Python. python3 interpreter should be available in your environment.

Command line options

Standalone run options

ISA and system-level options:

Outputs

Performance mode options

Branch prediction

Instruction cache

Execution pipeline

Workflow example

Clone

  1. Check that your environment meets all the requirements above.
  2. Clone repository with submodules: git clone --recursive https://github.com/MIPT-ILab/mipt-mips.git

    Build

    To build simulator faster, we recommend to install Ninja.

  3. Create a new build directory somewhere, then cd into it: mkdir /path/to/your/build/directory
  4. Go to the build directory: cd /path/to/your/build/directory
  5. Run cmake /path/to/mipt-mips/simulator -G "Ninja" to configure CMake
  6. Run ninja to get the mipt-mips binary file
  7. If you changed some source code files, just type ninja to rebuild project

    Run

  8. Now you can run simulation: ./mipt-mips -b /path/to/binary
  9. See more command line options in the paragraph below
  10. To run all unit tests, call ninja unit-tests && ctest --verbose -C Release from your build directory.

Test Coverage Chart!

Code Coverage

About MIPT-V / MIPT-MIPS

Logo

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 RISC-V and MIPS instruction set in both functional and performance simulators.

May I contribute?

Yes, if you attend lectures on Computer Architecture. See our contributing.md file for details.