Skip to content

cs233/JsSpim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b735e06 · Apr 24, 2023
Feb 15, 2023
Feb 13, 2022
May 30, 2019
Apr 22, 2023
Apr 24, 2023
May 14, 2019
Jan 16, 2023
Apr 21, 2023
Sep 12, 2022
Sep 13, 2022
Jan 16, 2023
Feb 10, 2023
Feb 8, 2022
Mar 25, 2023
Sep 12, 2022
Mar 7, 2023
May 30, 2019
May 30, 2019
Feb 3, 2023
Sep 12, 2022
Mar 22, 2022
Feb 23, 2023

Repository files navigation

JsSpim

JsSpim is an online MIPS32 simulator based on Prof. James Larus's Spim.

Spim is a self-contained simulator that runs MIPS32 programs. It reads and executes assembly language programs written for this processor. Spim also provides a simple debugger and minimal set of operating system services. Spim does not execute binary (compiled) programs.

Spim implements almost the entire MIPS32 assembler-extended instruction set. (It omits most floating point comparisons and rounding modes and the memory system page tables.) The MIPS architecture has several variants that differ in various ways (e.g., the MIPS64 architecture supports 64-bit integers and addresses), which means that Spim will not run programs for all MIPS processors.

The source code is published at GitHub

Screenshot

image-20190530030929768

Screen Record

Features

  • Click on an instruction to toggle breakpoint
  • Use the range slider to control the execution speed
  • Highlight on changed registers, data segment, and stack
  • Radix support for all values

How to build

Dependencies

  • cmake >= 3.21.1
  • emsdk == 3.1.14
  • bison
  • flex

How to build

emcmake cmake . -B build/
make -C build/

You can append -j<num_of_threads_on_your_machine> to make parallelize the build process.

You can view any extra cmake configuration variables with cmake -B build/ -LH.

Here are some of the variables you can change on configuration:

-- Cache values
// Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ...
CMAKE_BUILD_TYPE:STRING=

// You can add additional debug linker flags here
EXTRA_DEBUG_LINKER_FLAGS:STRING=

You can change these by adding them like -D<variable>=<value> similar to compiler defines.

If you have to remake the CMake configuration (e.g. switching to a different target host), run:

rm -r build/CMakeFiles/ build/CMakeCache.txt

Built With

  • Spim - The original simulator written in C++
  • Emscripten - Toolchain to compile C++ source code to WebAssembly using the LLVM IR.
  • Bootstrap - Using the CSS library to build the UI
  • highlight.js - For highlighting the source code