All Projects → MIPT-ILab → Mipt Mips

MIPT-ILab / Mipt Mips

Licence: mit
Cycle-accurate pre-silicon simulator of RISC-V and MIPS CPUs

Projects that are alternatives of or similar to Mipt Mips

Computer-Architecture-Task-2
Riscv32 CPU Project
Stars: ✭ 43 (-82.8%)
Mutual labels:  cpu, pipeline, risc-v
WebRISC-V
WebRISC-V: A Web-Based Education-Oriented RISC-V Pipeline Simulation Environment [PHP]
Stars: ✭ 74 (-70.4%)
Mutual labels:  simulator, pipeline, risc-v
Riscboy
Portable games console, designed from scratch: CPU, graphics, PCB, and the kitchen sink
Stars: ✭ 103 (-58.8%)
Mutual labels:  cpu, risc-v
Neorv32
A small and customizable full-scale 32-bit RISC-V soft-core CPU and SoC written in platform-independent VHDL.
Stars: ✭ 106 (-57.6%)
Mutual labels:  cpu, risc-v
Dls Schematics
Schematics for DLS - The Digital Logic Simulator game http://makingartstudios.itch.io/dls
Stars: ✭ 124 (-50.4%)
Mutual labels:  cpu, simulation
Vulcan
RISC-V Instruction Set Simulator (Built for education).
Stars: ✭ 80 (-68%)
Mutual labels:  risc-v, simulator
Webots
Webots Robot Simulator
Stars: ✭ 1,324 (+429.6%)
Mutual labels:  simulator, simulation
Ataraxia
Simple and lightweight source-based multi-platform Linux distribution with musl libc.
Stars: ✭ 226 (-9.6%)
Mutual labels:  risc-v, mips
Plankton
Open source simulator for maritime robotics researchers
Stars: ✭ 51 (-79.6%)
Mutual labels:  simulator, simulation
Rv12
RISC-V CPU Core
Stars: ✭ 162 (-35.2%)
Mutual labels:  cpu, risc-v
Cpu60
Example of CPU simulation in software
Stars: ✭ 152 (-39.2%)
Mutual labels:  cpu, simulator
Riscv Fs
F# RISC-V Instruction Set formal specification
Stars: ✭ 173 (-30.8%)
Mutual labels:  cpu, risc-v
Ustc Rvsoc
FPGA-based RISC-V CPU+SoC.
Stars: ✭ 77 (-69.2%)
Mutual labels:  cpu, risc-v
Pgdrive
PGDrive: an open-ended driving simulator with infinite scenes from procedural generation
Stars: ✭ 60 (-76%)
Mutual labels:  simulator, simulation
Awesome Emulators Simulators
A curated list of software emulators and simulators of PCs, home computers, mainframes, consoles, robots and much more...
Stars: ✭ 94 (-62.4%)
Mutual labels:  simulator, simulation
Darkriscv
opensouce RISC-V cpu core implemented in Verilog from scratch in one night!
Stars: ✭ 1,062 (+324.8%)
Mutual labels:  cpu, risc-v
Awesome Cpus
All CPU and MCU documentation in one place
Stars: ✭ 1,602 (+540.8%)
Mutual labels:  cpu, risc-v
Biriscv
32-bit Superscalar RISC-V CPU
Stars: ✭ 208 (-16.8%)
Mutual labels:  cpu, risc-v
Mips Cpu
A MIPS CPU implemented in Verilog
Stars: ✭ 38 (-84.8%)
Mutual labels:  cpu, mips
Bullet3
Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
Stars: ✭ 8,714 (+3385.6%)
Mutual labels:  simulator, simulation

Contributors Total alerts Language grade: C/C++ Language grade: JavaScript

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:

  • Precision. We provide cycle-accurate models of branch prediction unit, pipeline, and other hardware internals.
  • Customization. Cache size, branch prediction algorithms, and other parameters can be easily changed even to unfeasible modes.
  • Simplicity. Our source files are much more readable than RTL and independent on SDK and synthesis flow.
  • Speed. 2 MHz simulation frequency on Cascade Lake.
  • Scalability. Modularized structure allows integration of more microarchitecture configurations.

Simulator can be used for different purposes:

  • Performance control of software optimizations: you may check what and why happened to IPC.
  • Pathfinding of hardware optimizations: you may easily integrate some nice feature to CPU model.
  • Comparison of hardware solutions from different vendors.
  • Performance control of developed or produced hardware.
  • Education: simulator is a nice experimental frog to study CPU internals and software development process.

Key system-level features:

  • Compatibility with interactive MARS system calls.
  • Interactive simulation with GDB

Key microarchitecture features:

  • Configurable branch prediction unit with several prediction algorithms
  • Configurable instruction cache
  • Interstage data bypassing

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:

  • GCC 10
  • Clang 10.0.0
  • Apple LLVM Version 12.0.0
  • MS Visual Studio 2019 16.8

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

  • -b <filename> — provide path to ELF binary file to execute.
  • -n <number> — number of instructions to run. If omitted, simulation continues until halting system call or jump to null is executed.

ISA and system-level options:

  • -I — modeled ISA. Default version is mars.
    • mips32, mips64 — state-of-the-art MIPS
    • riscv32, riscv64, riscv128 — RISC-V with all instructions
    • spim, spim64 — simplified MIPS without delayed branches
    • mipsI, mipsII, mipsIII, mipsIV — legacy MIPS versions
  • -f — enables functional simulation only
  • --mars — enables MARS-compatible mode of system calls

Outputs

  • -l — enables per-module output, for instance:
    • -l fetch,decode — prints only fetch and decode stages
    • -l cpu — prints all stages
    • -l cpu,!mem — print all except mem stage
  • -d — enables output of functional simulator
  • --tdump — enables module topology dump into topology.json

Performance mode options

Branch prediction

  • --bp-mode — prediction mode. Check supported modes in manual
  • --bp-lru — prediction replacement policy: LRU, pseudo-LRU, or infinite
  • --bp-size — branch prediction cache size (amount of tracked branch instructions)
  • --bp-ways — # of ways in branch prediction cache

Instruction cache

  • --icache-type — instruction cache type: LRU, pseudo-LRU, always-hit, or infinite
  • --icache-size — instruction cache size in bytes
  • --icache-ways — # of ways in instruction cache
  • --icache-line-size — line size of instruction cache

Execution pipeline

  • --long-alu-latency - number of execution stages required for long arithmetic instructions to be complete

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.

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

Run

  1. Now you can run simulation: ./mipt-mips -b /path/to/binary
  2. See more command line options in the paragraph below
  3. 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].