Crate lib_rv32[−][src]
Modules
Decoding macros.
Reference implementation of an MCU.
Traits to be implementation by other implementations of an MCU.
Macros
Decode the B-type immediate from a u32
formatted instruction.
Concatenate the bits of integers.
Extend a bit (useful for sign extension).
Macro to help with bit level access to integers. Example attempts to mimic Verilog syntax.
Decode the FUNC3 field from a u32
formatted instruction.
Decode the FUNC7 field from a u32
formatted instruction.
Decode the I-type immediate from a u32
formatted instruction.
Decode the J-type immediate from a u32
formatted instruction.
Decode the opcode field from a u32
formatted instruction.
Decode the destination register field from a u32
formatted instruction.
Decode the first operand register field from a u32
formatted instruction.
Decode the second operand register field from a u32
formatted instruction.
Decode the S-type immediate from a u32
formatted instruction.
Like bit_extend
, but outputs the result and its
size in a tuple.
Like bit_slice
, but outputs the result and its
size in a tuple.
Decode the U-type immediate from a u32
formatted instruction.
Structs
Used to contain a set of assertions about the state of an MCU.
Enums
Enum that encapsulates the various different ways execution can fail. Some errors are caused by other errors and reference them.
Statics
Array to match register numbers to their common names.
Functions
Decode and execute instruction. This will use the program counter to
fetch an instruction from memory, decode/evaluate it, and commit the
results to pc
, mem
, and rf
.