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/common/bb_bench.hpp
"
7
#include "
barretenberg/relations/relation_parameters.hpp
"
8
#include "
barretenberg/relations/relation_types.hpp
"
9
#include "
barretenberg/vm2/generated/columns.hpp
"
10
11
namespace
bb::avm2
{
12
13
template
<
typename
FF_>
class
memoryImpl
{
14
public
:
15
using
FF
= FF_;
16
17
static
constexpr
std::array<size_t, 60>
SUBRELATION_PARTIAL_LENGTHS
= {
18
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
19
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 4, 3, 2, 2, 5, 5, 2, 4, 4, 4, 4, 5, 3
20
};
21
22
template
<
typename
AllEntities>
inline
static
bool
skip
(
const
AllEntities& in)
23
{
24
using
C
=
ColumnAndShifts
;
25
26
return
(in.get(C::memory_sel)).is_zero();
27
}
28
29
template
<
typename
ContainerOverSubrelations,
typename
AllEntities>
30
void
static
accumulate
(ContainerOverSubrelations& evals,
31
const
AllEntities& in,
32
[[maybe_unused]]
const
RelationParameters<FF>
&,
33
[[maybe_unused]]
const
FF
& scaling_factor);
34
};
35
36
template
<
typename
FF>
class
memory
:
public
Relation
<memoryImpl<FF>> {
37
public
:
38
static
constexpr
const
std::string_view
NAME
=
"memory"
;
39
40
// Subrelation indices constants, to be used in tests.
41
static
constexpr
size_t
SR_ACTIVE_ROW_NEEDS_PERM_SELECTOR
= 42;
42
static
constexpr
size_t
SR_MEM_CONTIGUOUS
= 47;
43
static
constexpr
size_t
SR_SEL_RNG_CHK
= 48;
44
static
constexpr
size_t
SR_GLOBAL_ADDR
= 49;
45
static
constexpr
size_t
SR_TIMESTAMP
= 50;
46
static
constexpr
size_t
SR_LAST_ACCESS
= 51;
47
static
constexpr
size_t
SR_DIFF
= 52;
48
static
constexpr
size_t
SR_DIFF_DECOMP
= 53;
49
static
constexpr
size_t
SR_MEMORY_INIT_VALUE
= 54;
50
static
constexpr
size_t
SR_MEMORY_INIT_TAG
= 55;
51
static
constexpr
size_t
SR_READ_WRITE_CONSISTENCY_VALUE
= 56;
52
static
constexpr
size_t
SR_READ_WRITE_CONSISTENCY_TAG
= 57;
53
static
constexpr
size_t
SR_TAG_IS_FF
= 58;
54
static
constexpr
size_t
SR_SEL_RNG_WRITE
= 59;
55
56
static
std::string
get_subrelation_label
(
size_t
index)
57
{
58
switch
(index) {
59
case
SR_ACTIVE_ROW_NEEDS_PERM_SELECTOR
:
60
return
"ACTIVE_ROW_NEEDS_PERM_SELECTOR"
;
61
case
SR_MEM_CONTIGUOUS
:
62
return
"MEM_CONTIGUOUS"
;
63
case
SR_SEL_RNG_CHK
:
64
return
"SEL_RNG_CHK"
;
65
case
SR_GLOBAL_ADDR
:
66
return
"GLOBAL_ADDR"
;
67
case
SR_TIMESTAMP
:
68
return
"TIMESTAMP"
;
69
case
SR_LAST_ACCESS
:
70
return
"LAST_ACCESS"
;
71
case
SR_DIFF
:
72
return
"DIFF"
;
73
case
SR_DIFF_DECOMP
:
74
return
"DIFF_DECOMP"
;
75
case
SR_MEMORY_INIT_VALUE
:
76
return
"MEMORY_INIT_VALUE"
;
77
case
SR_MEMORY_INIT_TAG
:
78
return
"MEMORY_INIT_TAG"
;
79
case
SR_READ_WRITE_CONSISTENCY_VALUE
:
80
return
"READ_WRITE_CONSISTENCY_VALUE"
;
81
case
SR_READ_WRITE_CONSISTENCY_TAG
:
82
return
"READ_WRITE_CONSISTENCY_TAG"
;
83
case
SR_TAG_IS_FF
:
84
return
"TAG_IS_FF"
;
85
case
SR_SEL_RNG_WRITE
:
86
return
"SEL_RNG_WRITE"
;
87
}
88
return
std::to_string
(index);
89
}
90
};
91
92
}
// namespace bb::avm2
bb_bench.hpp
bb::Relation
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
Definition
relation_types.hpp:153
bb::avm2::memory
Definition
memory.hpp:36
bb::avm2::memory::NAME
static constexpr const std::string_view NAME
Definition
memory.hpp:38
bb::avm2::memory::SR_TAG_IS_FF
static constexpr size_t SR_TAG_IS_FF
Definition
memory.hpp:53
bb::avm2::memory::SR_READ_WRITE_CONSISTENCY_TAG
static constexpr size_t SR_READ_WRITE_CONSISTENCY_TAG
Definition
memory.hpp:52
bb::avm2::memory::SR_DIFF
static constexpr size_t SR_DIFF
Definition
memory.hpp:47
bb::avm2::memory::SR_LAST_ACCESS
static constexpr size_t SR_LAST_ACCESS
Definition
memory.hpp:46
bb::avm2::memory::SR_READ_WRITE_CONSISTENCY_VALUE
static constexpr size_t SR_READ_WRITE_CONSISTENCY_VALUE
Definition
memory.hpp:51
bb::avm2::memory::SR_MEMORY_INIT_TAG
static constexpr size_t SR_MEMORY_INIT_TAG
Definition
memory.hpp:50
bb::avm2::memory::get_subrelation_label
static std::string get_subrelation_label(size_t index)
Definition
memory.hpp:56
bb::avm2::memory::SR_MEMORY_INIT_VALUE
static constexpr size_t SR_MEMORY_INIT_VALUE
Definition
memory.hpp:49
bb::avm2::memory::SR_MEM_CONTIGUOUS
static constexpr size_t SR_MEM_CONTIGUOUS
Definition
memory.hpp:42
bb::avm2::memory::SR_TIMESTAMP
static constexpr size_t SR_TIMESTAMP
Definition
memory.hpp:45
bb::avm2::memory::SR_GLOBAL_ADDR
static constexpr size_t SR_GLOBAL_ADDR
Definition
memory.hpp:44
bb::avm2::memory::SR_SEL_RNG_WRITE
static constexpr size_t SR_SEL_RNG_WRITE
Definition
memory.hpp:54
bb::avm2::memory::SR_DIFF_DECOMP
static constexpr size_t SR_DIFF_DECOMP
Definition
memory.hpp:48
bb::avm2::memory::SR_ACTIVE_ROW_NEEDS_PERM_SELECTOR
static constexpr size_t SR_ACTIVE_ROW_NEEDS_PERM_SELECTOR
Definition
memory.hpp:41
bb::avm2::memory::SR_SEL_RNG_CHK
static constexpr size_t SR_SEL_RNG_CHK
Definition
memory.hpp:43
bb::avm2::memoryImpl
Definition
memory.hpp:13
bb::avm2::memoryImpl::skip
static bool skip(const AllEntities &in)
Definition
memory.hpp:22
bb::avm2::memoryImpl::FF
FF_ FF
Definition
memory.hpp:15
bb::avm2::memoryImpl::accumulate
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
Definition
memory_impl.hpp:11
bb::avm2::memoryImpl::SUBRELATION_PARTIAL_LENGTHS
static constexpr std::array< size_t, 60 > SUBRELATION_PARTIAL_LENGTHS
Definition
memory.hpp:17
columns.hpp
bb::avm2
Definition
flavor.hpp:581
bb::avm2::Column
Column
Definition
columns.hpp:31
bb::avm2::ColumnAndShifts
ColumnAndShifts
Definition
columns.hpp:34
bb::avm2::FF
AvmFlavorSettings::FF FF
Definition
field.hpp:10
std::to_string
std::string to_string(bb::avm2::ValueTag tag)
Definition
tagged_value.cpp:400
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