Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
instruction_info.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <memory>
5
8
9namespace bb::avm2::simulation {
10
12 public:
13 virtual ~InstructionInfoDBInterface() = default;
14
15 virtual const ExecInstructionSpec& get(ExecutionOpCode opcode) const = 0;
16 virtual const WireInstructionSpec& get(WireOpCode opcode) const = 0;
17};
18
20 public:
21 const ExecInstructionSpec& get(ExecutionOpCode opcode) const override
22 {
23 auto it = EXEC_INSTRUCTION_SPEC.find(opcode);
24 if (it == EXEC_INSTRUCTION_SPEC.end()) {
25 throw std::runtime_error("Cannot find instruction spec for opcode: " +
26 std::to_string(static_cast<int>(opcode)));
27 }
28 return it->second;
29 }
30 const WireInstructionSpec& get(WireOpCode opcode) const override
31 {
32 auto it = WIRE_INSTRUCTION_SPEC.find(opcode);
33 if (it == WIRE_INSTRUCTION_SPEC.end()) {
34 throw std::runtime_error("Cannot find wire instruction spec for opcode: " +
35 std::to_string(static_cast<int>(opcode)));
36 }
37 return it->second;
38 }
39};
40
41} // namespace bb::avm2::simulation
const WireInstructionSpec & get(WireOpCode opcode) const override
const ExecInstructionSpec & get(ExecutionOpCode opcode) const override
virtual const WireInstructionSpec & get(WireOpCode opcode) const =0
virtual const ExecInstructionSpec & get(ExecutionOpCode opcode) const =0
const std::unordered_map< WireOpCode, WireInstructionSpec > WIRE_INSTRUCTION_SPEC
const std::unordered_map< ExecutionOpCode, ExecInstructionSpec > EXEC_INSTRUCTION_SPEC
std::string to_string(bb::avm2::ValueTag tag)