Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
execution_trace.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <span>
5#include <vector>
6
16
17namespace bb::avm2::tracegen {
18
20 public:
23
24 // Public for testing.
26 void process_execution_spec(const simulation::ExecutionEvent& ex_event, TraceContainer& trace, uint32_t row);
28 ExecutionOpCode exec_opcode,
30 uint32_t row);
34 uint32_t row);
36 // Sets global register information and reads.
37 void process_registers(ExecutionOpCode exec_opcode,
39 const MemoryValue& output,
41 bool register_processing_failed,
43 uint32_t row);
44 // Sets the writes.
45 void process_registers_write(ExecutionOpCode exec_opcode, TraceContainer& trace, uint32_t row);
47 MemoryValue output,
49 uint32_t row);
50
52};
53
54} // namespace bb::avm2::tracegen
void process_execution_spec(const simulation::ExecutionEvent &ex_event, TraceContainer &trace, uint32_t row)
Process the execution specification lookup columns (gas costs, register info, subtrace dispatch).
void process_instr_fetching(const simulation::Instruction &instruction, TraceContainer &trace, uint32_t row)
Process instruction fetching in execution and populate the relevant columns in the trace.
void invert_columns(TraceContainer &trace)
Batch-invert all columns that were populated with pre-inversion values during trace generation.
static const InteractionDefinition interactions
void process_registers(ExecutionOpCode exec_opcode, const std::vector< MemoryValue > &inputs, const MemoryValue &output, std::span< MemoryValue > registers, bool register_processing_failed, TraceContainer &trace, uint32_t row)
Process register reads: populate register value/tag columns and detect tag check failures.
void process_get_env_var_opcode(simulation::Operand envvar_enum, MemoryValue output, TraceContainer &trace, uint32_t row)
Process the GETENVVAR opcode: populate environment variable lookup and selector columns.
void process_registers_write(ExecutionOpCode exec_opcode, TraceContainer &trace, uint32_t row)
Process register writes: activate the write selector and effective write columns for the opcode.
void process_gas(const simulation::GasEvent &gas_event, ExecutionOpCode exec_opcode, TraceContainer &trace, uint32_t row)
Process gas consumption and populate gas-related columns (OOG flags, addressing gas,...
void process(const simulation::EventEmitterInterface< simulation::ExecutionEvent >::Container &ex_events, TraceContainer &trace)
Process the execution events and populate the relevant columns in the trace. ExecutionError enum is u...
void process_addressing(const simulation::AddressingEvent &addr_event, const simulation::Instruction &instruction, TraceContainer &trace, uint32_t row)
Process addressing resolution and populate operand columns (relative, indirect, resolved values,...
TestTraceContainer trace
GasEvent gas_event
Instruction instruction
AvmProvingInputs inputs
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13