Coder Social home page Coder Social logo

9oelm / risc-v-web-simulator Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 2.0 2.76 MB

Yet another RISC-V Simulator on the web, running on Webassembly! https://riscv.vercel.app/

Home Page: https://riscv.vercel.app/

License: MIT License

JavaScript 2.00% C++ 43.45% Shell 0.56% TypeScript 51.60% HTML 1.23% CSS 1.16%
cpp javascript risc-v webassembly simulator risc-v-emulator risc-v-simulator riscv-simulator riscv-emulator

risc-v-web-simulator's Introduction

risc-v-web-simulator

Yet another RISC-V Simulator on the web, for fun. Based on Kite, RISC-V architecture simulator I used for my computer architecture class (EEE3530) at Yonsei University. Turned it into Webassembly to use it on web. Again, it's just for fun.... and probably education. Lol.

Use it!

https://riscv.vercel.app/

Instructions

Detailed instruction on how to use it is found at the repository of Kite.

Developing

Modification of Kite's code

To enable communication with javascript from Webassembly binary, a few things have been changed in Kite's code:

  • Kite does not receive files as an input anymore. It receives const char* program_code, const char* memory_state, const char* reg_state as parameters and runs it. const char* is directly supplied from javascript.
  • No more build flags (-DDEBUG, -DDATA_FWD, -DBR_PRED); They are also directly supplied from javascript as well.
  • Kite throws error instead of cerr and exit(1);. For example:
    if(val != 1) {
        throw std::logic_error("Cache Error: number of sets must be a power of two");
    }
    This allows javascript to catch an error and display the error message.
  • Emscripten is used to compile C++ into Webassembly. More details in compile.sh.

Todo

  • cleanup duplicate css styles (now just copied and pasted cuz im lazy)

References

risc-v-web-simulator's People

Contributors

9oelm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.