{"id":18446948,"url":"https://github.com/nmeum/riscv-utils","last_synced_at":"2026-01-23T00:28:11.600Z","repository":{"id":74907373,"uuid":"287743055","full_name":"nmeum/riscv-utils","owner":"nmeum","description":"Scheme utility procedures for the RISC-V instruction set architecture","archived":false,"fork":false,"pushed_at":"2020-08-29T22:00:45.000Z","size":59,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T09:55:10.809Z","etag":null,"topics":["r7rs","risc-v","riscv"],"latest_commit_sha":null,"homepage":"","language":"Scheme","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nmeum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2020-08-15T12:33:01.000Z","updated_at":"2024-06-03T22:24:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"b102c401-57cd-4626-a695-9fefd73ceea4","html_url":"https://github.com/nmeum/riscv-utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nmeum/riscv-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmeum%2Friscv-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmeum%2Friscv-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmeum%2Friscv-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmeum%2Friscv-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmeum","download_url":"https://codeload.github.com/nmeum/riscv-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmeum%2Friscv-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28676143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T20:48:19.482Z","status":"ssl_error","status_checked_at":"2026-01-22T20:48:14.968Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["r7rs","risc-v","riscv"],"created_at":"2024-11-06T07:11:25.775Z","updated_at":"2026-01-23T00:28:11.580Z","avatar_url":"https://github.com/nmeum.png","language":"Scheme","readme":"# riscv-utils\n\nScheme utility procedures for the [RISC-V][riscv website] instruction set architecture.\n\n## Features\n\nThe feature set of provided procedures is centered around easing the\ndevelopment of utilities for RISC-V (especially instruction set\nsimulators). Currently the following features are provided:\n\n* `decode.scm`: Decoding of RISC-V instructions.\n* `encode.scm`: Encoding of RISC-V instructions.\n* `convert.scm`: Conversion from/to different representations.\n* `opcodes.scm`: Constants for instruction opcodes (currently rv32i only).\n\n## Usage\n\nThe code is supposed to be used from a Scheme REPL, no binaries are\nprovided. The Scheme files in the `riscv/` directory are mostly(?)\n[R7RS][r7rs small] compatible. It should be possible to use them with any\nstandard compliant Scheme implementation which provides an\n[SRFI-151][srfi-151] module. Just load the files you want to use\nusing `(load \"riscv/\u003cfile\u003e.scm\")` from your Scheme REPL.\n\nIf your favorite Scheme implementation is [CHICKEN][call-cc], read on.\n\n### Example\n\nThe API is intentionally very low-level. Nonetheless, many fun things\ncan be done with it. The following example takes an existing `JAL`\ninstruction (e.g. as extracted from a `riscv32-unknown-elf-objdump -d`\noutput) and modifies it to jump somewhere else.\n\n\t$ csi\n\t\u003e (import riscv)\n\t\u003e (set! jal #x0100056f)\n\t\u003e (instr-j-imm jal)\n\t16\n\t\u003e (j-type (instr-opcode jal) (instr-rd jal) 32)\n\t33555823\n\nThe value `33555823` (`0x200056f`) is RISC-V machine code for a JAL\ninstruction holing the value `32` (instead of `16`) as a J-immediate.\nThis can be easily verified using:\n\n\t\u003e (set! jal-new 33555823)\n\t\u003e (instr-\u003ehex jal-new)\n\t\"#x200056f\"\n\t\u003e (instr-j-imm jal-new)\n\t32\n\n## Installation\n\nIn addition to standard compliant(?) Scheme source code, this repository\nalso contains the required files for using the code as a CHICKEN Scheme\n[egg][call-cc eggs]. However, since the code is still in very early\nstages of development I haven't published it as an egg yet. Nonetheless,\nan egg can be built locally using:\n\n\t$ chicken-install -test\n\n### Building without installing\n\nIf installation is not desired, build as follows:\n\n\t$ export CHICKEN_REPOSITORY_PATH=\"$(pwd):${CHICKEN_REPOSITORY_PATH}\"\n\t$ chicken-install -n -test\n\nAfterwards simply run `(import riscv)` in `csi(1)` as usual.\n\n## License\n\nThis program is free software: you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the\nFree Software Foundation, either version 3 of the License, or (at your\noption) any later version.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General\nPublic License for more details.\n\nYou should have received a copy of the GNU General Public License along\nwith this program. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n[riscv website]: https://riscv.org/\n[srfi-151]: https://srfi.schemers.org/srfi-151/srfi-151.html\n[r7rs small]: https://small.r7rs.org/\n[call-cc]: https://call-cc.org\n[call-cc eggs]: https://eggs.call-cc.org/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmeum%2Friscv-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmeum%2Friscv-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmeum%2Friscv-utils/lists"}