{"id":15060942,"url":"https://github.com/mrlsd/riscv-fs","last_synced_at":"2025-04-04T17:09:21.273Z","repository":{"id":77178880,"uuid":"205041674","full_name":"mrLSD/riscv-fs","owner":"mrLSD","description":"F# RISC-V Instruction Set formal specification","archived":false,"fork":false,"pushed_at":"2024-09-11T07:43:01.000Z","size":152,"stargazers_count":283,"open_issues_count":0,"forks_count":14,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-04T17:09:17.190Z","etag":null,"topics":["cpu","fs","fsharp","isa","library","risc-processor","risc-v","riscv","riscv-emulator","riscv-simulator","riscv32","riscv64"],"latest_commit_sha":null,"homepage":"","language":"F#","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/mrLSD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-08-28T23:36:00.000Z","updated_at":"2025-01-27T14:52:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc6b0e95-71a1-4178-b8af-58281e7c4904","html_url":"https://github.com/mrLSD/riscv-fs","commit_stats":{"total_commits":164,"total_committers":2,"mean_commits":82.0,"dds":"0.018292682926829285","last_synced_commit":"3f61a6e3c8447f3c491cd05840f6f4585fcf282a"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrLSD%2Friscv-fs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrLSD%2Friscv-fs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrLSD%2Friscv-fs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrLSD%2Friscv-fs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrLSD","download_url":"https://codeload.github.com/mrLSD/riscv-fs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217221,"owners_count":20903009,"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":["cpu","fs","fsharp","isa","library","risc-processor","risc-v","riscv","riscv-emulator","riscv-simulator","riscv32","riscv64"],"created_at":"2024-09-24T23:07:08.202Z","updated_at":"2025-04-04T17:09:21.258Z","avatar_url":"https://github.com/mrLSD.png","language":"F#","readme":"# RISC-V formal ISA Specification\n[![Build Status](https://travis-ci.org/mrLSD/riscv-fs.svg?branch=master)](https://travis-ci.org/mrLSD/riscv-fs)\n\n**Copyright \u0026copy; Evgeny Ukhanov**\n\nThis is a formal (and executable) specification for the \nRISC-V ISA (Instruction Set Architecture), written in \n**F# purely functional style**. We deliberately choose \nan \"_extremely elementary_\" implementation of F# to make it \nreadable and usable by wide audience who do not know F# and who \ndo not plan to learn F#.\n\n![F# RISC-V ISA Formal Specification](https://miro.medium.com/max/2474/1*88Zj-QJq48IZTiCGUo5mSQ.png)\n\nThis is a work-in-progress, one of several similar concurrent \nefforts within the **ISA Formal Specification** \nTechnical Group constituted by The RISC-V Foundation \n(https://riscv.org). We welcome your feedback, comments and suggestions. \n\n## Content\n* [Features \u0026 Current status](#features--current-status) \n* [Reading the code](#reading-the-code)\n* [How to build and run it on RISC-V binaries](#how-to-build-and-run-it-on-risc-v-binaries)\n  * [Install .NET SDK](#install-.net-sdk)\n  * [Make the application executable](#make-the-application-executable)\n  * [Run the application executable](#run-the-application-executable)\n* [How to Contribute](#how-to-contribute)\n* [References](#references)  \n* [Licence](#licence)\n \n## Features \u0026 Current status\n* Supports the following features (or _in active development state_)\n  - [x] Base instruction set: RV32I\n  - [x] Tests RV32I\n  - [x] Base instruction set: RV64I\n  - [x] Tests RV64I\n  - [x] Standard extension M (integer multiply/divide)\n  - [x] Tests for Standard extension M RV32/RV64\n  - [x] Standard extension A (atomic memory ops)\n  - [ ] Tests for Standard extension A RV32/RV64\n* Features under development\n  * Standard extension C (Compressed 16-bit instructions)\n  * Standard extension F (Single-precision floating point)\n  * Standard extension D (Double-precision floating point)\n  * Privilege Level M (Machine)\n  * Privilege Level U (User)\n  * Privilege Level S (Supervisor)\n    * Virtual Memory schemes SV32, SV39 and SV48\n* Application can be executed as a F# program flexible with \nCLI (_command line interface_) support, which in \nturn executes RISC-V ELF binaries. This is a sequential \ninterpretation: one-instruction-at-a-time, sequential \nmemory model.\n* Tests passing for RISC-V **under development**:\n  * Basic instruction flow\n  * `rv32ui-p-*, rv64ui-p-*` (Base instruction set)\n  * `rv32um-p-*, rv64um-p-*` (M extension)\n  * `rv32ua-p-*, rv64ua-p-*` (A extension)\n  * `rv32uc-p-*, rv64uc-p-*` (C extension)\n\n## Reading the code\nWe expect that many people might use this as a reading \nreference (whether or not they build and execute it) to \nclarify their understanding of RISC-V ISA semantics.\n\nMain part for reading Specification:\n* **Decode\\*.fs**\n  \n  Decodes contain decoders for specific instructions set\n  and notified with instruction/extension set symbol. For example `DecodeI.fs`\n* **Execute\\*.fs**\n\n  Executes contain executions for specific instructions set\n  and notified with instruction/extension set symbol. For example `ExecuteI.fs`\n  \n* Utilities:\n  * `CLI.fs`\n    \n    Contain helper function and types for\n    building effective CLI commands and options.\n  \n  * `Bits.fs`\n    \n    Basic type specific functions for \n    manipulations with `bits`.\n  \n  * `Run.fs`\n  \n    Basic Run flow - fetch, decode, execute,\n    logging execution flow.  \n\n* Architecture\n  * `Arch.fs`\n\n    Basic architecture types for RISC-V specification.\n  \n  * `MachineState.fs`\n  \n    Basic type and functions described\n    RISC-V machine state.  \n\n* Main app\n  * `Program.fs`\n  \n  Main application to execute **RISC-V simulator/emulator**.\n  \n* Test\n  * `Test/*.fs`\n  \n    Contain unit-tests for instructions set\n    and extensions\n    \n  * Test/asm/\n  \n    Contain Assembler test programs for\n    manual testing RISC-V CPI implementation.\n    It depend on **risc-v toolchain** and \n    it has special auto-build `Makefile`.      \n\n## How to build and run it on RISC-V binaries\nApplication can be executed as a _sequential RISC-V simulator_ \n(sequential, one-instruction-at-a-time semantics), by \nbuilding and executing it as a standard F# program.\n\nSupported OS:\n* Linux\n* Windows\n* MacOS\n\nSupported **.NET SDK**:\n* .NET SDK 2.2\n* .NET SDK 3.0\n\n### Install .NET SDK\n\nFor Windows preferred way to use Visual Studio.\n\nOther examples will be for Linux.\nPlease follow to instruction https://dotnet.microsoft.com/download\n\nFor Ubuntu:\n```\n$ wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb\n$ sudo dpkg -i packages-microsoft-prod.deb\n$ sudo apt-get update\n$ sudo apt-get install apt-transport-https\n$ sudo apt-get update\n$ sudo apt-get install dotnet-sdk-3.0\n```\nTo check installation:\n\n`$ dotnet --version`\n\nwill tell you what version of `dotnet` you have.\n\n### Make the application executable\nYou can build the application executable with:\n\n`$ dotnet build`\n\n### Run the application executable\n\nMost simple way to run immediately `run` (without \nadditional `build` command) to see command-line \noptions on the executable:\n\n`$ dotnet run -- --help`\n\nIf you run the application without option:\n\n`$ dotnet run`\n\nyou'll receive error message:\n\n\u003e Wrong parameters put --help to get more information\n\n**Example** to run specific ISA with extensions, verbosity\noutput and ELF file for execution in RISC-V CPI simulator:\n\n`$ dotnet run -- -A rv32i -v myapp.elf`\n\n## How to Contribute\n\nPlease read file [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## References\n\n* github ISA manual: https://github.com/riscv/riscv-isa-manual\n* RISC-V specification: https://riscv.org/specifications/\n* RISC-V Formal Verification Framework: https://github.com/SymbioticEDA/riscv-formal\n\n## Licence\n**MIT License**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrlsd%2Friscv-fs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrlsd%2Friscv-fs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrlsd%2Friscv-fs/lists"}