Expand description
Composable and generic RISC-V interpreter.
This interpreter is designed to work with abstractions from ab-riscv-primitives crate and is
similarly composable with a powerful macro system and trait abstractions over handling of
memory, syscalls, etc.
The immediate needs dictate the current set of available instructions and extensions. Consider contributing if you need something not yet available.
ab-riscv-act4-runner crate in the repository contains a complementary RISC-V Architectural
Certification Tests runner for https://github.com/riscv-non-isa/riscv-arch-test that ensures
correct implementation.
Does not require a standard library (no_std) or an allocator.
§Supported ISA variants and extensions
ISA variants:
- RV32I (version 2.1)
- RV32E (version 2.0)
- RV64I (version 2.1)
- RV64E (version 2.0)
Extensions:
- M (version 2.0)
- B (version 1.0.0)
- Zba (version 1.0.0)
- Zbb (version 1.0.0)
- Zbc (version 1.0.0)
- Zbkc (version 1.0.0)
- Zbs (version 1.0.0)
- Zknh (version 1.0.0)
- Zicsr (version 2.0)
- (experimental) Zve32x (version 1.0.0)
- (experimental) Zve64x (version 1.0.0)
- (experimental) Zvl*b (version 1.0.0), where
*is anything allowed by the specification
All extensions except experimental pass all relevant RISC-V Architectural Certification Tests (ACTs) using the ACT4 framework.
Any permutation of compatible extensions is supported.
Experimental extensions are known to have bugs and need more work. They are not tested against ACTs yet.
Modules§
- rv32
- Part of the interpreter responsible for RISC-V RV32 base instruction set
- rv64
- Part of the interpreter responsible for RISC-V RV64 base instruction set
- v
- V extension
- zicsr
- Zicsr extension
Structs§
- Basic
Instruction Fetcher - Basic instruction fetcher implementation
- Custom
Error Placeholder - Placeholder for custom errors in
ExecutionError - Interpreter
State - Base interpreter state
Enums§
- CsrError
- CSR error
- Execution
Error - Execution errors
- Fetch
Instruction Result - Result of
InstructionFetcher::fetch_instruction()call - Program
Counter Error - Program counter errors
- Virtual
Memory Error - Errors for
VirtualMemory
Traits§
- Basic
Int - Basic integer types that can be read and written to/from memory freely
- Csrs
- CSRs (Control and Status Registers)
- Executable
Instruction - Trait for executable instructions.
- Instruction
Fetcher - Generic instruction fetcher
- Program
Counter - Generic program counter
- System
Instruction Handler - Custom handler for system instructions
ecallandebreak - Virtual
Memory - Virtual memory interface