Home

Awesome

RISC-V formal ISA Specification

Build Status

Copyright © Evgeny Ukhanov

This is a formal (and executable) specification for the RISC-V ISA (Instruction Set Architecture), written in F# purely functional style. We deliberately choose an "extremely elementary" implementation of F# to make it readable and usable by wide audience who do not know F# and who do not plan to learn F#.

F# RISC-V ISA Formal Specification

This is a work-in-progress, one of several similar concurrent efforts within the ISA Formal Specification Technical Group constituted by The RISC-V Foundation (https://riscv.org). We welcome your feedback, comments and suggestions.

Content

Features & Current status

Reading the code

We expect that many people might use this as a reading reference (whether or not they build and execute it) to clarify their understanding of RISC-V ISA semantics.

Main part for reading Specification:

How to build and run it on RISC-V binaries

Application can be executed as a sequential RISC-V simulator (sequential, one-instruction-at-a-time semantics), by building and executing it as a standard F# program.

Supported OS:

Supported .NET SDK:

Install .NET SDK

For Windows preferred way to use Visual Studio.

Other examples will be for Linux. Please follow to instruction https://dotnet.microsoft.com/download

For Ubuntu:

$ wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
$ sudo dpkg -i packages-microsoft-prod.deb
$ sudo apt-get update
$ sudo apt-get install apt-transport-https
$ sudo apt-get update
$ sudo apt-get install dotnet-sdk-3.0

To check installation:

$ dotnet --version

will tell you what version of dotnet you have.

Make the application executable

You can build the application executable with:

$ dotnet build

Run the application executable

Most simple way to run immediately run (without additional build command) to see command-line options on the executable:

$ dotnet run -- --help

If you run the application without option:

$ dotnet run

you'll receive error message:

Wrong parameters put --help to get more information

Example to run specific ISA with extensions, verbosity output and ELF file for execution in RISC-V CPI simulator:

$ dotnet run -- -A rv32i -v myapp.elf

How to Contribute

Please read file CONTRIBUTING.md

References

Licence

MIT License