Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
lookups_instr_fetching.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
4#include <cstddef>
5#include <string_view>
6#include <tuple>
7
8#include "../columns.hpp"
11
12namespace bb::avm2 {
13
15
17 static constexpr std::string_view NAME = "LOOKUP_INSTR_FETCHING_PC_ABS_DIFF_POSITIVE";
18 static constexpr std::string_view RELATION_NAME = "instr_fetching";
19 static constexpr size_t LOOKUP_TUPLE_SIZE = 2;
20 static constexpr Column SRC_SELECTOR = Column::instr_fetching_sel;
21 static constexpr Column DST_SELECTOR = Column::range_check_sel;
22 static constexpr Column COUNTS = Column::lookup_instr_fetching_pc_abs_diff_positive_counts;
23 static constexpr Column INVERSES = Column::lookup_instr_fetching_pc_abs_diff_positive_inv;
24 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
25 ColumnAndShifts::instr_fetching_pc_abs_diff, ColumnAndShifts::instr_fetching_pc_size_in_bits
26 };
27 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
28 ColumnAndShifts::range_check_value, ColumnAndShifts::range_check_rng_chk_bits
29 };
30};
31
34template <typename FF_>
37
39
41 static constexpr std::string_view NAME = "LOOKUP_INSTR_FETCHING_INSTR_ABS_DIFF_POSITIVE";
42 static constexpr std::string_view RELATION_NAME = "instr_fetching";
43 static constexpr size_t LOOKUP_TUPLE_SIZE = 1;
44 static constexpr Column SRC_SELECTOR = Column::instr_fetching_sel;
45 static constexpr Column DST_SELECTOR = Column::precomputed_sel_range_8;
46 static constexpr Column COUNTS = Column::lookup_instr_fetching_instr_abs_diff_positive_counts;
47 static constexpr Column INVERSES = Column::lookup_instr_fetching_instr_abs_diff_positive_inv;
48 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
49 ColumnAndShifts::instr_fetching_instr_abs_diff
50 };
51 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { ColumnAndShifts::precomputed_clk };
52};
53
56template <typename FF_>
59
61
63 static constexpr std::string_view NAME = "LOOKUP_INSTR_FETCHING_TAG_VALUE_VALIDATION";
64 static constexpr std::string_view RELATION_NAME = "instr_fetching";
65 static constexpr size_t LOOKUP_TUPLE_SIZE = 2;
66 static constexpr Column SRC_SELECTOR = Column::instr_fetching_sel_has_tag;
67 static constexpr Column DST_SELECTOR = Column::precomputed_sel_range_8;
68 static constexpr Column COUNTS = Column::lookup_instr_fetching_tag_value_validation_counts;
69 static constexpr Column INVERSES = Column::lookup_instr_fetching_tag_value_validation_inv;
70 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
71 ColumnAndShifts::instr_fetching_tag_value, ColumnAndShifts::instr_fetching_tag_out_of_range
72 };
73 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
74 ColumnAndShifts::precomputed_clk, ColumnAndShifts::precomputed_sel_mem_tag_out_of_range
75 };
76};
77
80template <typename FF_>
83
85
87 static constexpr std::string_view NAME = "LOOKUP_INSTR_FETCHING_BYTECODE_SIZE_FROM_BC_DEC";
88 static constexpr std::string_view RELATION_NAME = "instr_fetching";
89 static constexpr size_t LOOKUP_TUPLE_SIZE = 3;
90 static constexpr Column SRC_SELECTOR = Column::instr_fetching_sel;
91 static constexpr Column DST_SELECTOR = Column::bc_decomposition_sel;
92 static constexpr Column COUNTS = Column::lookup_instr_fetching_bytecode_size_from_bc_dec_counts;
93 static constexpr Column INVERSES = Column::lookup_instr_fetching_bytecode_size_from_bc_dec_inv;
94 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
95 ColumnAndShifts::instr_fetching_bytecode_id,
96 ColumnAndShifts::precomputed_zero,
97 ColumnAndShifts::instr_fetching_bytecode_size
98 };
99 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
100 ColumnAndShifts::bc_decomposition_id,
101 ColumnAndShifts::bc_decomposition_pc,
102 ColumnAndShifts::bc_decomposition_bytes_remaining
103 };
104};
105
108template <typename FF_>
111
113
115 static constexpr std::string_view NAME = "LOOKUP_INSTR_FETCHING_BYTES_FROM_BC_DEC";
116 static constexpr std::string_view RELATION_NAME = "instr_fetching";
117 static constexpr size_t LOOKUP_TUPLE_SIZE = 40;
118 static constexpr Column SRC_SELECTOR = Column::instr_fetching_sel_pc_in_range;
119 static constexpr Column DST_SELECTOR = Column::bc_decomposition_sel;
120 static constexpr Column COUNTS = Column::lookup_instr_fetching_bytes_from_bc_dec_counts;
121 static constexpr Column INVERSES = Column::lookup_instr_fetching_bytes_from_bc_dec_inv;
122 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
123 ColumnAndShifts::instr_fetching_bytecode_id, ColumnAndShifts::instr_fetching_pc,
124 ColumnAndShifts::instr_fetching_bytes_to_read, ColumnAndShifts::instr_fetching_bd0,
125 ColumnAndShifts::instr_fetching_bd1, ColumnAndShifts::instr_fetching_bd2,
126 ColumnAndShifts::instr_fetching_bd3, ColumnAndShifts::instr_fetching_bd4,
127 ColumnAndShifts::instr_fetching_bd5, ColumnAndShifts::instr_fetching_bd6,
128 ColumnAndShifts::instr_fetching_bd7, ColumnAndShifts::instr_fetching_bd8,
129 ColumnAndShifts::instr_fetching_bd9, ColumnAndShifts::instr_fetching_bd10,
130 ColumnAndShifts::instr_fetching_bd11, ColumnAndShifts::instr_fetching_bd12,
131 ColumnAndShifts::instr_fetching_bd13, ColumnAndShifts::instr_fetching_bd14,
132 ColumnAndShifts::instr_fetching_bd15, ColumnAndShifts::instr_fetching_bd16,
133 ColumnAndShifts::instr_fetching_bd17, ColumnAndShifts::instr_fetching_bd18,
134 ColumnAndShifts::instr_fetching_bd19, ColumnAndShifts::instr_fetching_bd20,
135 ColumnAndShifts::instr_fetching_bd21, ColumnAndShifts::instr_fetching_bd22,
136 ColumnAndShifts::instr_fetching_bd23, ColumnAndShifts::instr_fetching_bd24,
137 ColumnAndShifts::instr_fetching_bd25, ColumnAndShifts::instr_fetching_bd26,
138 ColumnAndShifts::instr_fetching_bd27, ColumnAndShifts::instr_fetching_bd28,
139 ColumnAndShifts::instr_fetching_bd29, ColumnAndShifts::instr_fetching_bd30,
140 ColumnAndShifts::instr_fetching_bd31, ColumnAndShifts::instr_fetching_bd32,
141 ColumnAndShifts::instr_fetching_bd33, ColumnAndShifts::instr_fetching_bd34,
142 ColumnAndShifts::instr_fetching_bd35, ColumnAndShifts::instr_fetching_bd36
143 };
144 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
145 ColumnAndShifts::bc_decomposition_id,
146 ColumnAndShifts::bc_decomposition_pc,
147 ColumnAndShifts::bc_decomposition_bytes_to_read,
148 ColumnAndShifts::bc_decomposition_bytes,
149 ColumnAndShifts::bc_decomposition_bytes_pc_plus_1,
150 ColumnAndShifts::bc_decomposition_bytes_pc_plus_2,
151 ColumnAndShifts::bc_decomposition_bytes_pc_plus_3,
152 ColumnAndShifts::bc_decomposition_bytes_pc_plus_4,
153 ColumnAndShifts::bc_decomposition_bytes_pc_plus_5,
154 ColumnAndShifts::bc_decomposition_bytes_pc_plus_6,
155 ColumnAndShifts::bc_decomposition_bytes_pc_plus_7,
156 ColumnAndShifts::bc_decomposition_bytes_pc_plus_8,
157 ColumnAndShifts::bc_decomposition_bytes_pc_plus_9,
158 ColumnAndShifts::bc_decomposition_bytes_pc_plus_10,
159 ColumnAndShifts::bc_decomposition_bytes_pc_plus_11,
160 ColumnAndShifts::bc_decomposition_bytes_pc_plus_12,
161 ColumnAndShifts::bc_decomposition_bytes_pc_plus_13,
162 ColumnAndShifts::bc_decomposition_bytes_pc_plus_14,
163 ColumnAndShifts::bc_decomposition_bytes_pc_plus_15,
164 ColumnAndShifts::bc_decomposition_bytes_pc_plus_16,
165 ColumnAndShifts::bc_decomposition_bytes_pc_plus_17,
166 ColumnAndShifts::bc_decomposition_bytes_pc_plus_18,
167 ColumnAndShifts::bc_decomposition_bytes_pc_plus_19,
168 ColumnAndShifts::bc_decomposition_bytes_pc_plus_20,
169 ColumnAndShifts::bc_decomposition_bytes_pc_plus_21,
170 ColumnAndShifts::bc_decomposition_bytes_pc_plus_22,
171 ColumnAndShifts::bc_decomposition_bytes_pc_plus_23,
172 ColumnAndShifts::bc_decomposition_bytes_pc_plus_24,
173 ColumnAndShifts::bc_decomposition_bytes_pc_plus_25,
174 ColumnAndShifts::bc_decomposition_bytes_pc_plus_26,
175 ColumnAndShifts::bc_decomposition_bytes_pc_plus_27,
176 ColumnAndShifts::bc_decomposition_bytes_pc_plus_28,
177 ColumnAndShifts::bc_decomposition_bytes_pc_plus_29,
178 ColumnAndShifts::bc_decomposition_bytes_pc_plus_30,
179 ColumnAndShifts::bc_decomposition_bytes_pc_plus_31,
180 ColumnAndShifts::bc_decomposition_bytes_pc_plus_32,
181 ColumnAndShifts::bc_decomposition_bytes_pc_plus_33,
182 ColumnAndShifts::bc_decomposition_bytes_pc_plus_34,
183 ColumnAndShifts::bc_decomposition_bytes_pc_plus_35,
184 ColumnAndShifts::bc_decomposition_bytes_pc_plus_36
185 };
186};
187
190template <typename FF_>
193
195
197 static constexpr std::string_view NAME = "LOOKUP_INSTR_FETCHING_WIRE_INSTRUCTION_INFO";
198 static constexpr std::string_view RELATION_NAME = "instr_fetching";
199 static constexpr size_t LOOKUP_TUPLE_SIZE = 23;
200 static constexpr Column SRC_SELECTOR = Column::instr_fetching_sel_pc_in_range;
201 static constexpr Column DST_SELECTOR = Column::precomputed_sel_range_8;
202 static constexpr Column COUNTS = Column::lookup_instr_fetching_wire_instruction_info_counts;
203 static constexpr Column INVERSES = Column::lookup_instr_fetching_wire_instruction_info_inv;
204 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
205 ColumnAndShifts::instr_fetching_bd0, ColumnAndShifts::instr_fetching_opcode_out_of_range,
206 ColumnAndShifts::instr_fetching_exec_opcode, ColumnAndShifts::instr_fetching_instr_size,
207 ColumnAndShifts::instr_fetching_sel_has_tag, ColumnAndShifts::instr_fetching_sel_tag_is_op2,
208 ColumnAndShifts::instr_fetching_sel_op_dc_0, ColumnAndShifts::instr_fetching_sel_op_dc_1,
209 ColumnAndShifts::instr_fetching_sel_op_dc_2, ColumnAndShifts::instr_fetching_sel_op_dc_3,
210 ColumnAndShifts::instr_fetching_sel_op_dc_4, ColumnAndShifts::instr_fetching_sel_op_dc_5,
211 ColumnAndShifts::instr_fetching_sel_op_dc_6, ColumnAndShifts::instr_fetching_sel_op_dc_7,
212 ColumnAndShifts::instr_fetching_sel_op_dc_8, ColumnAndShifts::instr_fetching_sel_op_dc_9,
213 ColumnAndShifts::instr_fetching_sel_op_dc_10, ColumnAndShifts::instr_fetching_sel_op_dc_11,
214 ColumnAndShifts::instr_fetching_sel_op_dc_12, ColumnAndShifts::instr_fetching_sel_op_dc_13,
215 ColumnAndShifts::instr_fetching_sel_op_dc_14, ColumnAndShifts::instr_fetching_sel_op_dc_15,
216 ColumnAndShifts::instr_fetching_sel_op_dc_16
217 };
218 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
219 ColumnAndShifts::precomputed_clk, ColumnAndShifts::precomputed_opcode_out_of_range,
220 ColumnAndShifts::precomputed_exec_opcode, ColumnAndShifts::precomputed_instr_size,
221 ColumnAndShifts::precomputed_sel_has_tag, ColumnAndShifts::precomputed_sel_tag_is_op2,
222 ColumnAndShifts::precomputed_sel_op_dc_0, ColumnAndShifts::precomputed_sel_op_dc_1,
223 ColumnAndShifts::precomputed_sel_op_dc_2, ColumnAndShifts::precomputed_sel_op_dc_3,
224 ColumnAndShifts::precomputed_sel_op_dc_4, ColumnAndShifts::precomputed_sel_op_dc_5,
225 ColumnAndShifts::precomputed_sel_op_dc_6, ColumnAndShifts::precomputed_sel_op_dc_7,
226 ColumnAndShifts::precomputed_sel_op_dc_8, ColumnAndShifts::precomputed_sel_op_dc_9,
227 ColumnAndShifts::precomputed_sel_op_dc_10, ColumnAndShifts::precomputed_sel_op_dc_11,
228 ColumnAndShifts::precomputed_sel_op_dc_12, ColumnAndShifts::precomputed_sel_op_dc_13,
229 ColumnAndShifts::precomputed_sel_op_dc_14, ColumnAndShifts::precomputed_sel_op_dc_15,
230 ColumnAndShifts::precomputed_sel_op_dc_16
231 };
232};
233
236template <typename FF_>
239
240} // namespace bb::avm2
This file contains the template for the generic lookup that can be specialized to enforce various loo...
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS