barretenberg
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Attributes | List of all members
proof_system::AvmMiniTraceBuilder Class Reference

Public Member Functions

 AvmMiniTraceBuilder ()
 Constructor of a trace builder of AVM. Only serves to set the capacity of the underlying traces.
 
void setFFMem (size_t idx, FF el)
 Helper to initialize ffMemory. (Testing purpose mostly.)
 
std::vector< Rowfinalize ()
 Finalisation of the memory trace and incorporating it to the main trace. In particular, sorting the memory trace, setting .m_lastAccess and adding shifted values (first row). The main trace is moved at the end of this call.
 
void reset ()
 Resetting the internal state so that a new trace can be rebuilt using the same object.
 
void add (uint32_t s0, uint32_t s1, uint32_t d0)
 Addition over finite field with direct memory access.
 
void callDataCopy (uint32_t s0, uint32_t s1, uint32_t d0, std::vector< FF > const &callDataMem)
 CALLDATACOPY opcode with direct memory access, i.e., M_F[d0:d0+s1] = M_calldata[s0:s0+s1] Simplified version with exclusively memory store operations and values from M_calldata passed by an array and loaded into intermediate registers. Assume that caller passes callDataMem which is large enough so that no out-of-bound memory issues occur. TODO: Implement the indirect memory version (maybe not required) TODO: taking care of intermediate register values consistency and propagating their values to the next row when not overwritten.
 
std::vector< FF > returnOP (uint32_t s0, uint32_t s1)
 RETURN opcode with direct memory access, i.e., return M_F[s0:s0+s1] Simplified version with exclusively memory load operations into intermediate registers and then values are copied to the returned vector. TODO: Implement the indirect memory version (maybe not required) TODO: taking care of flagging this row as the last one? Special STOP flag?
 

Static Public Attributes

static const size_t N = 256
 
static const size_t MemSize = 1024
 
static const uint32_t SubClkLoadA = 0
 
static const uint32_t SubClkLoadB = 1
 
static const uint32_t SubClkLoadC = 2
 
static const uint32_t SubClkStoreA = 3
 
static const uint32_t SubClkStoreB = 4
 
static const uint32_t SubClkStoreC = 5
 

Member Function Documentation

◆ add()

void proof_system::AvmMiniTraceBuilder::add ( uint32_t  s0,
uint32_t  s1,
uint32_t  d0 
)

Addition over finite field with direct memory access.

Parameters
s0An index in ffMemory pointing to the first operand of the addition.
s1An index in ffMemory pointing to the second operand of the addition.
d0An index in ffMemory pointing to the output of the addition.

◆ callDataCopy()

void proof_system::AvmMiniTraceBuilder::callDataCopy ( uint32_t  s0,
uint32_t  s1,
uint32_t  d0,
std::vector< FF > const &  callDataMem 
)

CALLDATACOPY opcode with direct memory access, i.e., M_F[d0:d0+s1] = M_calldata[s0:s0+s1] Simplified version with exclusively memory store operations and values from M_calldata passed by an array and loaded into intermediate registers. Assume that caller passes callDataMem which is large enough so that no out-of-bound memory issues occur. TODO: Implement the indirect memory version (maybe not required) TODO: taking care of intermediate register values consistency and propagating their values to the next row when not overwritten.

Parameters
s0The starting index of the region in calldata to be copied.
s1The number of finite field elements to be copied into memory.
d0The starting index of memory where calldata will be copied to.
callDataMemThe vector containing calldata.

◆ finalize()

std::vector< Row > proof_system::AvmMiniTraceBuilder::finalize ( )

Finalisation of the memory trace and incorporating it to the main trace. In particular, sorting the memory trace, setting .m_lastAccess and adding shifted values (first row). The main trace is moved at the end of this call.

Returns
The main trace

◆ reset()

void proof_system::AvmMiniTraceBuilder::reset ( )

Resetting the internal state so that a new trace can be rebuilt using the same object.

◆ returnOP()

std::vector< FF > proof_system::AvmMiniTraceBuilder::returnOP ( uint32_t  s0,
uint32_t  s1 
)

RETURN opcode with direct memory access, i.e., return M_F[s0:s0+s1] Simplified version with exclusively memory load operations into intermediate registers and then values are copied to the returned vector. TODO: Implement the indirect memory version (maybe not required) TODO: taking care of flagging this row as the last one? Special STOP flag?

Parameters
s0The starting index of the memory region to be returned.
s1The number of elements to be returned.
Returns
The returned memory region as a std::vector.

◆ setFFMem()

void proof_system::AvmMiniTraceBuilder::setFFMem ( size_t  idx,
FF  el 
)

Helper to initialize ffMemory. (Testing purpose mostly.)


The documentation for this class was generated from the following files: