Skip to content

Commit

Permalink
refactor(avm): avm memory trace building (AztecProtocol#3835)
Browse files Browse the repository at this point in the history
Resolves AztecProtocol#3834 

Moving all AVM memory related trace building functions into a dedicated
class.
Furthermore, all AVM related trace files were moved into a dedicated
folder in vm.
The following files:

- AvmMini_common.hpp
- AvmMini_helper.cpp
- AvmMini_helper.hpp
- AvmMini_mem_trace.cpp
- AvmMini_mem_trace.hpp
- AvmMini_trace.cpp
- AvmMini_trace.hpp
were moved from 

barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/

to

barretenberg/cpp/src/barretenberg/vm/avm_trace/

Finally, the namespace for these files were migrating from proof_system
to avm_trace.
  • Loading branch information
jeanmon authored Jan 5, 2024
1 parent 66d3111 commit 56c34ca
Show file tree
Hide file tree
Showing 14 changed files with 1,100 additions and 992 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#pragma once

#include "barretenberg/ecc/curves/bn254/fr.hpp"
#include "barretenberg/proof_system/circuit_builder/circuit_builder_base.hpp"

#include "barretenberg/flavor/generated/AvmMini_flavor.hpp"
#include "barretenberg/proof_system/circuit_builder/generated/AvmMini_circuit_builder.hpp"

namespace proof_system {

using Flavor = proof_system::honk::flavor::AvmMiniFlavor;
using FF = Flavor::FF;
using Row = proof_system::AvmMiniFullRow<barretenberg::fr>;

void log_avmMini_trace(std::vector<Row> const& trace, size_t beg, size_t end);
namespace avm_trace {

// Number of rows
static const size_t AVM_TRACE_SIZE = 256;
enum class IntermRegister : uint32_t { ia = 0, ib = 1, ic = 2 };
enum class AvmMemoryTag : uint32_t { u0 = 0, u8 = 1, u16 = 2, u32 = 3, u64 = 4, u128 = 5, ff = 6 };

} // namespace proof_system
} // namespace avm_trace
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#include "barretenberg/ecc/curves/bn254/fr.hpp"
#include "barretenberg/proof_system/circuit_builder/circuit_builder_base.hpp"
#include "AvmMini_helper.hpp"

#include "./AvmMini_helper.hpp"
#include "barretenberg/flavor/generated/AvmMini_flavor.hpp"
#include "barretenberg/relations/generated/AvmMini/avm_mini.hpp"

namespace proof_system {
namespace avm_trace {

/**
* @brief Routine to log some slice of a trace of the AVM. Used to debug or in some unit tests.
Expand Down Expand Up @@ -70,4 +65,4 @@ void log_avmMini_trace(std::vector<Row> const& trace, size_t beg, size_t end)
}
}

} // namespace proof_system
} // namespace avm_trace
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#include "AvmMini_common.hpp"

namespace avm_trace {

void log_avmMini_trace(std::vector<Row> const& trace, size_t beg, size_t end);

} // namespace avm_trace
Loading

0 comments on commit 56c34ca

Please sign in to comment.