{"id":15663373,"url":"https://github.com/9oelm/risc-v-web-simulator","last_synced_at":"2025-05-05T21:09:24.315Z","repository":{"id":40357248,"uuid":"490903107","full_name":"9oelM/risc-v-web-simulator","owner":"9oelM","description":"Yet another RISC-V Simulator on the web, running on Webassembly! https://riscv.vercel.app/","archived":false,"fork":false,"pushed_at":"2024-05-02T02:55:56.000Z","size":2824,"stargazers_count":33,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-30T23:41:12.515Z","etag":null,"topics":["cpp","javascript","risc-v","risc-v-emulator","risc-v-simulator","riscv-emulator","riscv-simulator","simulator","webassembly"],"latest_commit_sha":null,"homepage":"https://riscv.vercel.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/9oelM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-11T00:28:22.000Z","updated_at":"2025-02-25T13:10:04.000Z","dependencies_parsed_at":"2024-05-02T04:02:03.617Z","dependency_job_id":"c476a7a0-c17d-46b3-a42f-fffdd85e19a5","html_url":"https://github.com/9oelM/risc-v-web-simulator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"9oelM/emscripten-cplusplus-webpack-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9oelM%2Frisc-v-web-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9oelM%2Frisc-v-web-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9oelM%2Frisc-v-web-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9oelM%2Frisc-v-web-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/9oelM","download_url":"https://codeload.github.com/9oelM/risc-v-web-simulator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577003,"owners_count":21770721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","javascript","risc-v","risc-v-emulator","risc-v-simulator","riscv-emulator","riscv-simulator","simulator","webassembly"],"created_at":"2024-10-03T13:36:58.821Z","updated_at":"2025-05-05T21:09:24.259Z","avatar_url":"https://github.com/9oelM.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# risc-v-web-simulator\n\nYet another RISC-V Simulator on the web, for fun. Based on [Kite](https://github.com/yonsei-icsl/kite), RISC-V architecture simulator I used for my computer architecture class ([EEE3530](https://icsl.yonsei.ac.kr/eee3530/)) at Yonsei University. Turned it into Webassembly to use it on web. Again, it's just for fun.... and probably education. Lol.\n\n## Use it!\n\nhttps://riscv.vercel.app/\n\n## Instructions\n\nDetailed instruction on how to use it is found at [the repository of Kite](https://github.com/yonsei-icsl/kite).\n\n## Developing\n\n### Modification of Kite's code\nTo enable communication with javascript from Webassembly binary, a few things have been changed in Kite's code:\n\n- 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.\n- No more build flags (`-DDEBUG`, `-DDATA_FWD`, `-DBR_PRED`); They are also directly supplied from javascript as well.\n- Kite throws error instead of `cerr` and `exit(1);`. For example: \n    ```cpp\n    if(val != 1) {\n        throw std::logic_error(\"Cache Error: number of sets must be a power of two\");\n    }\n    ```\n  This allows javascript to catch an error and display the error message.\n- [Emscripten](https://github.com/emscripten-core/emscripten) is used to compile C++ into Webassembly. More details in compile.sh.\n\n## Todo\n- cleanup duplicate css styles (now just copied and pasted cuz im lazy)\n\n## References\n- https://github.com/9oelM/emscripten-cplusplus-webpack-example\n- https://stackoverflow.com/questions/21816960/how-to-pass-strings-between-c-and-javascript-via-emscripten\n- https://stackoverflow.com/questions/46815205/how-to-pass-a-string-to-c-code-compiled-with-emscripten-for-webassembly\n- https://stackoverflow.com/questions/59532379/how-to-call-javascript-method-from-c-with-parameters-using-em-js\n- https://marcoselvatici.github.io/WASM_tutorial/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9oelm%2Frisc-v-web-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F9oelm%2Frisc-v-web-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9oelm%2Frisc-v-web-simulator/lists"}