Module adapters

Module adapters 

Source

Structs§

LoadStoreInstruction
LoadStore Adapter handles all memory and register operations, so it must be aware of the instruction type, specifically whether it is a load or store LoadStore Adapter handles 4 byte aligned lw, sw instructions, 2 byte aligned lh, lhu, sh instructions and 1 byte aligned lb, lbu, sb instructions This adapter always batch reads/writes 4 bytes, thus it needs to shift left the memory pointer by some amount in case of not 4 byte aligned intermediate pointers
Rv32BaseAluAdapterAir
Reads instructions of the form OP a, b, c, d, e where [a:4]_d = [b:4]_d op [c:4]_e. Operand d can only be 1, and e can be either 1 (for register reads) or 0 (when c is an immediate).
Rv32BaseAluAdapterCols
Rv32BaseAluAdapterExecutor
Rv32BaseAluAdapterFiller
Rv32BaseAluAdapterRecord
Rv32BranchAdapterAir
Rv32BranchAdapterCols
Rv32BranchAdapterExecutor
Reads instructions of the form OP a, b, c, d, e where if([a:4]_d op [b:4]_e) pc += c. Operands d and e can only be 1.
Rv32BranchAdapterFiller
Rv32BranchAdapterRecord
Rv32CondRdWriteAdapterAir
This adapter doesn’t read anything, and maybe writes to [a:4]_d, where d == 1
Rv32CondRdWriteAdapterCols
Rv32CondRdWriteAdapterExecutor
This adapter doesn’t read anything, and maybe writes to [a:4]_d, where d == 1
Rv32CondRdWriteAdapterFiller
Rv32JalrAdapterAir
Rv32JalrAdapterCols
Rv32JalrAdapterExecutor
Rv32JalrAdapterFiller
Rv32JalrAdapterRecord
Rv32LoadStoreAdapterAir
Rv32LoadStoreAdapterAirInterface
Rv32LoadStoreAdapterCols
Rv32LoadStoreAdapterExecutor
This chip reads rs1 and gets a intermediate memory pointer address with rs1 + imm. In case of Loads, reads from the shifted intermediate pointer and writes to rd. In case of Stores, reads from rs2 and writes to the shifted intermediate pointer.
Rv32LoadStoreAdapterFiller
Rv32LoadStoreAdapterRecord
Rv32MultAdapterAir
Reads instructions of the form OP a, b, c, d where [a:4]_d = [b:4]_d op [c:4]_d. Operand d can only be 1, and there is no immediate support.
Rv32MultAdapterCols
Rv32MultAdapterExecutor
Rv32MultAdapterFiller
Rv32MultAdapterRecord
Rv32RdWriteAdapterAir
This adapter doesn’t read anything, and writes to [a:4]_d, where d == 1
Rv32RdWriteAdapterCols
Rv32RdWriteAdapterExecutor
Rv32RdWriteAdapterFiller
Rv32RdWriteAdapterRecord
This adapter doesn’t read anything, and writes to [a:4]_d, where d == 1

Constants§

INT256_NUM_LIMBS
256-bit heap integer stored as 32 bytes (32 limbs of 8-bits)
RV32_CELL_BITS
RV32_REGISTER_NUM_LIMBS
32-bit register stored as 4 bytes (4 limbs of 8-bits) in OpenVM memory.
RV_B_TYPE_IMM_BITS
RV_IS_TYPE_IMM_BITS
RV_J_TYPE_IMM_BITS

Functions§

abstract_compose
compose
Convert the RISC-V register data (32 bits represented as 4 bytes, where each byte is represented as a field element) back into its value as u32.
decompose
inverse of compose
imm_to_bytes
memory_read
memory_read_from_state
memory_write
memory_write_from_state
read_rv32_register
read_rv32_register_from_state
timed_read
Atomic read operation which increments the timestamp by 1. Returns (t_prev, [ptr:4]_{address_space}) where t_prev is the timestamp of the last memory access.
timed_write
tmp_convert_to_u8s
tracing_read
Reads register value at reg_ptr from memory and records the memory access in mutable buffer. Trace generation relevant to this memory access can be done fully from the recorded buffer.
tracing_read_imm
tracing_write
Writes reg_ptr, reg_val into memory and records the memory access in mutable buffer. Trace generation relevant to this memory access can be done fully from the recorded buffer.