Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
memory.hpp
Go to the documentation of this file.
1
// AUTOGENERATED FILE
2
#pragma once
3
4
#include <string_view>
5
6
#include "
barretenberg/relations/relation_parameters.hpp
"
7
#include "
barretenberg/relations/relation_types.hpp
"
8
#include "
barretenberg/vm2/generated/columns.hpp
"
9
10
namespace
bb::avm2
{
11
12
template
<
typename
FF_>
class
memoryImpl
{
13
public
:
14
using
FF
= FF_;
15
16
static
constexpr
std::array<size_t, 52>
SUBRELATION_PARTIAL_LENGTHS
= { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
17
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
18
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3,
19
3, 3, 3, 3, 5, 5, 2, 4, 4, 4, 4, 5, 3 };
20
21
template
<
typename
AllEntities>
inline
static
bool
skip
(
const
AllEntities
& in)
22
{
23
using
C
=
ColumnAndShifts
;
24
25
return
(in.get(C::memory_sel)).is_zero();
26
}
27
28
template
<
typename
ContainerOverSubrelations,
typename
AllEntities>
29
void
static
accumulate
(ContainerOverSubrelations& evals,
30
const
AllEntities
& in,
31
[[maybe_unused]]
const
RelationParameters<FF>
&,
32
[[maybe_unused]]
const
FF
& scaling_factor);
33
};
34
35
template
<
typename
FF>
class
memory
:
public
Relation
<memoryImpl<FF>> {
36
public
:
37
static
constexpr
const
std::string_view
NAME
=
"memory"
;
38
39
// Subrelation indices constants, to be used in tests.
40
static
constexpr
size_t
SR_ACTIVE_ROW_NEEDS_PERM_SELECTOR
= 36;
41
static
constexpr
size_t
SR_MEM_CONTINUITY
= 41;
42
static
constexpr
size_t
SR_SEL_RNG_CHK
= 42;
43
static
constexpr
size_t
SR_LAST_ACCESS
= 43;
44
static
constexpr
size_t
SR_DIFF
= 44;
45
static
constexpr
size_t
SR_DIFF_DECOMP
= 45;
46
static
constexpr
size_t
SR_MEMORY_INIT_VALUE
= 46;
47
static
constexpr
size_t
SR_MEMORY_INIT_TAG
= 47;
48
static
constexpr
size_t
SR_READ_WRITE_CONSISTENCY_VALUE
= 48;
49
static
constexpr
size_t
SR_READ_WRITE_CONSISTENCY_TAG
= 49;
50
static
constexpr
size_t
SR_TAG_IS_FF
= 50;
51
static
constexpr
size_t
SR_SEL_RNG_WRITE
= 51;
52
53
static
std::string
get_subrelation_label
(
size_t
index
)
54
{
55
#ifdef AVM_INCLUDE_COLUMN_INFORMATION
56
switch
(
index
) {
57
case
SR_ACTIVE_ROW_NEEDS_PERM_SELECTOR
:
58
return
"ACTIVE_ROW_NEEDS_PERM_SELECTOR"
;
59
case
SR_MEM_CONTINUITY
:
60
return
"MEM_CONTINUITY"
;
61
case
SR_SEL_RNG_CHK
:
62
return
"SEL_RNG_CHK"
;
63
case
SR_LAST_ACCESS
:
64
return
"LAST_ACCESS"
;
65
case
SR_DIFF
:
66
return
"DIFF"
;
67
case
SR_DIFF_DECOMP
:
68
return
"DIFF_DECOMP"
;
69
case
SR_MEMORY_INIT_VALUE
:
70
return
"MEMORY_INIT_VALUE"
;
71
case
SR_MEMORY_INIT_TAG
:
72
return
"MEMORY_INIT_TAG"
;
73
case
SR_READ_WRITE_CONSISTENCY_VALUE
:
74
return
"READ_WRITE_CONSISTENCY_VALUE"
;
75
case
SR_READ_WRITE_CONSISTENCY_TAG
:
76
return
"READ_WRITE_CONSISTENCY_TAG"
;
77
case
SR_TAG_IS_FF
:
78
return
"TAG_IS_FF"
;
79
case
SR_SEL_RNG_WRITE
:
80
return
"SEL_RNG_WRITE"
;
81
}
82
#endif
83
return
std::to_string
(
index
);
84
}
85
};
86
87
}
// namespace bb::avm2
bb::MegaFlavor_Generated::AllEntities
Definition
mega_flavor_generated.hpp:277
bb::Relation
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
Definition
relation_types.hpp:129
bb::avm2::memory
Definition
memory.hpp:35
bb::avm2::memory::NAME
static constexpr const std::string_view NAME
Definition
memory.hpp:37
bb::avm2::memory::SR_TAG_IS_FF
static constexpr size_t SR_TAG_IS_FF
Definition
memory.hpp:50
bb::avm2::memory::SR_READ_WRITE_CONSISTENCY_TAG
static constexpr size_t SR_READ_WRITE_CONSISTENCY_TAG
Definition
memory.hpp:49
bb::avm2::memory::SR_DIFF
static constexpr size_t SR_DIFF
Definition
memory.hpp:44
bb::avm2::memory::SR_LAST_ACCESS
static constexpr size_t SR_LAST_ACCESS
Definition
memory.hpp:43
bb::avm2::memory::SR_READ_WRITE_CONSISTENCY_VALUE
static constexpr size_t SR_READ_WRITE_CONSISTENCY_VALUE
Definition
memory.hpp:48
bb::avm2::memory::SR_MEMORY_INIT_TAG
static constexpr size_t SR_MEMORY_INIT_TAG
Definition
memory.hpp:47
bb::avm2::memory::get_subrelation_label
static std::string get_subrelation_label(size_t index)
Definition
memory.hpp:53
bb::avm2::memory::SR_MEMORY_INIT_VALUE
static constexpr size_t SR_MEMORY_INIT_VALUE
Definition
memory.hpp:46
bb::avm2::memory::SR_SEL_RNG_WRITE
static constexpr size_t SR_SEL_RNG_WRITE
Definition
memory.hpp:51
bb::avm2::memory::SR_DIFF_DECOMP
static constexpr size_t SR_DIFF_DECOMP
Definition
memory.hpp:45
bb::avm2::memory::SR_MEM_CONTINUITY
static constexpr size_t SR_MEM_CONTINUITY
Definition
memory.hpp:41
bb::avm2::memory::SR_ACTIVE_ROW_NEEDS_PERM_SELECTOR
static constexpr size_t SR_ACTIVE_ROW_NEEDS_PERM_SELECTOR
Definition
memory.hpp:40
bb::avm2::memory::SR_SEL_RNG_CHK
static constexpr size_t SR_SEL_RNG_CHK
Definition
memory.hpp:42
bb::avm2::memoryImpl
Definition
memory.hpp:12
bb::avm2::memoryImpl::skip
static bool skip(const AllEntities &in)
Definition
memory.hpp:21
bb::avm2::memoryImpl::FF
FF_ FF
Definition
memory.hpp:14
bb::avm2::memoryImpl::SUBRELATION_PARTIAL_LENGTHS
static constexpr std::array< size_t, 52 > SUBRELATION_PARTIAL_LENGTHS
Definition
memory.hpp:16
bb::avm2::memoryImpl::accumulate
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
Definition
memory_impl.hpp:11
columns.hpp
VariableRefMutationOptions::index
@ index
bb::avm2
Definition
dbs.cpp:19
bb::avm2::FF
AvmFlavorSettings::FF FF
Definition
field.hpp:10
bb::avm2::ColumnAndShifts
ColumnAndShifts
Definition
columns.hpp:35
bb::avm2::Column
Column
Definition
columns.hpp:32
std::to_string
std::string to_string(bb::avm2::ValueTag tag)
Definition
tagged_value.cpp:402
relation_parameters.hpp
relation_types.hpp
bb::RelationParameters
Container for parameters used by the grand product (permutation, lookup) Honk relations.
Definition
relation_parameters.hpp:19
src
barretenberg
vm2
generated
relations
memory.hpp
Generated by
1.9.8