Skip to content

rawcache/riscvsim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StudyRISC-V Simulator

StudyRISC-V Simulator is a browser-based RV32IM simulator focused on understanding execution, not just producing final outputs. It assembles source code locally, runs the Rust core in WebAssembly, and exposes step-by-step inspection for registers, memory, control flow, and the call stack.

This public repository intentionally contains only the simulator. Product-only surfaces such as marketing pages, auth flows, coursework content, backend infrastructure, analytics, billing, and account logic were removed.

What is included

  • RV32IM execution core in Rust compiled to WebAssembly
  • Two-pass assembler and encoder
  • Simulator UI for editing, assembling, stepping, running, and resetting
  • Register, memory, disassembly, effect log, pseudo-C, and call stack views
  • Permalink sharing via URL hash
  • Regression tests that exercise simulator behavior

What was intentionally removed

  • Landing and marketing pages
  • SEO pages and promotional copy
  • Auth, account, billing, notifications, leaderboards, groups, and referrals
  • Lessons, checkpoints, quizzes, labs, and course content
  • AWS/CDK infrastructure and Lambda handlers
  • Internal notes, agent configs, and operational metadata

Requirements

  • Node.js 20+ recommended
  • npm

Rust is not required for normal development because the prebuilt WebAssembly package is committed in frontend/src/pkg/.

Local development

cd frontend
npm install
npm run dev

Open the local Vite URL and use the simulator at the site root.

Build

cd frontend
npm run build

Test

cd frontend
npm test

Optional: rebuild the WebAssembly package

Only do this if you change rust-core/src/lib.rs.

cd rust-core
wasm-pack build --target web --out-dir ../frontend/src/pkg

Repository layout

riscvsim/
├── frontend/
│   ├── index.html
│   ├── favicon-chip.svg
│   ├── favicon.png
│   ├── package.json
│   ├── src/
│   │   ├── main.ts
│   │   ├── asm.ts
│   │   ├── wasm-runtime.ts
│   │   ├── disasm.ts
│   │   ├── memory.ts
│   │   ├── registers-ui.ts
│   │   ├── stack-tracker.ts
│   │   ├── stack-ui.ts
│   │   ├── linter.ts
│   │   └── pkg/
│   └── tests/regression/
├── rust-core/
│   ├── Cargo.toml
│   └── src/lib.rs
└── README.md

Security note

This repo is intended to stay public-safe.

  • Do not commit .env files or secrets.
  • Use frontend/.env.example as the baseline.
  • Run npm run public:check from frontend/ before pushing changes.
  • If any secret was ever committed to a public remote, rotate it even after removal.

License

This repository is released under the MIT License. See LICENSE.

About

Learning RISC-V for students -> studyriscv.com.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors