All Projects → mrLSD → Riscv Fs

mrLSD / Riscv Fs

Licence: mit
F# RISC-V Instruction Set formal specification

Programming Languages

fsharp
127 projects

Projects that are alternatives of or similar to Riscv Fs

Neorv32
A small and customizable full-scale 32-bit RISC-V soft-core CPU and SoC written in platform-independent VHDL.
Stars: ✭ 106 (-38.73%)
Mutual labels:  cpu, risc-v, riscv
Darkriscv
opensouce RISC-V cpu core implemented in Verilog from scratch in one night!
Stars: ✭ 1,062 (+513.87%)
Mutual labels:  cpu, risc-v, riscv
yatcpu
Yet another toy CPU.
Stars: ✭ 42 (-75.72%)
Mutual labels:  cpu, riscv, risc-v
Ustc Rvsoc
FPGA-based RISC-V CPU+SoC.
Stars: ✭ 77 (-55.49%)
Mutual labels:  cpu, risc-v, riscv
Riscv Rust
RISC-V processor emulator written in Rust+WASM
Stars: ✭ 253 (+46.24%)
Mutual labels:  cpu, risc-v, riscv
Vexriscv
A FPGA friendly 32 bit RISC-V CPU implementation
Stars: ✭ 1,041 (+501.73%)
Mutual labels:  cpu, riscv
Cva6
The CORE-V CVA6 is an Application class 6-stage RISC-V CPU capable of booting Linux
Stars: ✭ 1,144 (+561.27%)
Mutual labels:  cpu, riscv
Cores Swerv El2
SweRV EL2 Core
Stars: ✭ 79 (-54.34%)
Mutual labels:  risc-v, riscv
Sod
An Embedded Computer Vision & Machine Learning Library (CPU Optimized & IoT Capable)
Stars: ✭ 1,460 (+743.93%)
Mutual labels:  cpu, library
Rars
RARS -- RISC-V Assembler and Runtime Simulator
Stars: ✭ 413 (+138.73%)
Mutual labels:  risc-v, riscv
Riscboy
Portable games console, designed from scratch: CPU, graphics, PCB, and the kitchen sink
Stars: ✭ 103 (-40.46%)
Mutual labels:  cpu, risc-v
Meta Riscv
OpenEmbedded/Yocto layer for RISC-V Architecture
Stars: ✭ 114 (-34.1%)
Mutual labels:  risc-v, riscv
Unicorn
Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, X86)
Stars: ✭ 4,934 (+2752.02%)
Mutual labels:  cpu, riscv
Libriscv
C++17 RISC-V RV32GC / RV64GC userspace emulator library
Stars: ✭ 124 (-28.32%)
Mutual labels:  risc-v, library
Chipyard
An Agile RISC-V SoC Design Framework with in-order cores, out-of-order cores, accelerators, and more
Stars: ✭ 436 (+152.02%)
Mutual labels:  risc-v, riscv
Awesome Cpus
All CPU and MCU documentation in one place
Stars: ✭ 1,602 (+826.01%)
Mutual labels:  cpu, risc-v
Easydeviceinfo
📱 [Android Library] Get device information in a super easy way.
Stars: ✭ 1,698 (+881.5%)
Mutual labels:  cpu, library
Rv12
RISC-V CPU Core
Stars: ✭ 162 (-6.36%)
Mutual labels:  cpu, risc-v
Scr1
SCR1 is a high-quality open-source RISC-V MCU core in Verilog
Stars: ✭ 393 (+127.17%)
Mutual labels:  risc-v, riscv
Cores Swerv
SweRV EH1 core
Stars: ✭ 406 (+134.68%)
Mutual labels:  risc-v, riscv

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

  • Supports the following features (or in active development state)
    • [x] Base instruction set: RV32I
    • [x] Tests RV32I
    • [x] Base instruction set: RV64I
    • [x] Tests RV64I
    • [x] Standard extension M (integer multiply/divide)
    • [x] Tests for Standard extension M RV32/RV64
    • [x] Standard extension A (atomic memory ops)
    • [ ] Tests for Standard extension A RV32/RV64
  • Features under development
    • Standard extension C (Compressed 16-bit instructions)
    • Standard extension F (Single-precision floating point)
    • Standard extension D (Double-precision floating point)
    • Privilege Level M (Machine)
    • Privilege Level U (User)
    • Privilege Level S (Supervisor)
      • Virtual Memory schemes SV32, SV39 and SV48
  • Application can be executed as a F# program flexible with CLI (command line interface) support, which in turn executes RISC-V ELF binaries. This is a sequential interpretation: one-instruction-at-a-time, sequential memory model.
  • Tests passing for RISC-V under development:
    • Basic instruction flow
    • rv32ui-p-*, rv64ui-p-* (Base instruction set)
    • rv32um-p-*, rv64um-p-* (M extension)
    • rv32ua-p-*, rv64ua-p-* (A extension)
    • rv32uc-p-*, rv64uc-p-* (C extension)

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:

  • Decode*.fs

    Decodes contain decoders for specific instructions set and notified with instruction/extension set symbol. For example DecodeI.fs

  • Execute*.fs

    Executes contain executions for specific instructions set and notified with instruction/extension set symbol. For example ExecuteI.fs

  • Utilities:

    • CLI.fs

      Contain helper function and types for building effective CLI commands and options.

    • Bits.fs

      Basic type specific functions for manipulations with bits.

    • Run.fs

      Basic Run flow - fetch, decode, execute, logging execution flow.

  • Architecture

    • Arch.fs

      Basic architecture types for RISC-V specification.

    • MachineState.fs

      Basic type and functions described RISC-V machine state.

  • Main app

    • Program.fs

    Main application to execute RISC-V simulator/emulator.

  • Test

    • Test/*.fs

      Contain unit-tests for instructions set and extensions

    • Test/asm/

      Contain Assembler test programs for manual testing RISC-V CPI implementation. It depend on risc-v toolchain and it has special auto-build Makefile.

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:

  • Linux
  • Windows
  • MacOS

Supported .NET SDK:

  • .NET SDK 2.2
  • .NET SDK 3.0

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].