#include <data_copy.hpp>
|
uint64_t | min (uint64_t a, uint64_t b) |
|
Definition at line 25 of file data_copy.hpp.
◆ DataCopy()
◆ cd_copy()
void bb::avm2::simulation::DataCopy::cd_copy |
( |
ContextInterface & |
context, |
|
|
const uint32_t |
copy_size, |
|
|
const uint32_t |
offset, |
|
|
const MemoryAddress |
dst_addr |
|
) |
| |
|
overridevirtual |
Writes calldata into dst_addr. There is slight difference in how enqueued and nested contexts, this is mostly encapsulated in context.get_calldata()
Notes on DataCopy: The simulation for DataCopy has a lot of subtle complexity due to the requirements of the circuit constraints. The main complexity comes from the need to have the following 32-bit range checks (1) Computing the max_read_index via min, which is used to determine the final index in the cd/rd to read up to. (2) In error handling to check that reads and writes are within bounds of the memory. (3) In computing the actual number of elements from calldata/returndata to read (i.e. from [offset, max_read_index])
- Parameters
-
cd_copy_size | The size of calldata to copy, must be a u32. |
cd_offset | The offset in calldata to start copying from, must be a u32. |
dst_addr | The address in memory to write the calldata to. |
- Exceptions
-
DataCopyException | if the calldata size or offset are not u32, or if the memory access is out of bounds. |
Implements bb::avm2::simulation::DataCopyInterface.
Definition at line 87 of file data_copy.cpp.
◆ min()
uint64_t bb::avm2::simulation::DataCopy::min |
( |
uint64_t |
a, |
|
|
uint64_t |
b |
|
) |
| |
|
private |
◆ rd_copy()
void bb::avm2::simulation::DataCopy::rd_copy |
( |
ContextInterface & |
context, |
|
|
const uint32_t |
copy_size, |
|
|
const uint32_t |
offset, |
|
|
const MemoryAddress |
dst_addr |
|
) |
| |
|
overridevirtual |
Copies returndata from the last executed context to the dst_addr.
- Parameters
-
rd_copy_size | The size of returndata to copy, must be a u32. |
rd_offset | The offset in returndata to start copying from, must be a u32. |
dst_addr | The address in memory to write the returndata to. |
- Exceptions
-
DataCopyException | if the returndata size or offset are not u32, or if the memory access is out of bounds. |
Implements bb::avm2::simulation::DataCopyInterface.
Definition at line 145 of file data_copy.cpp.
◆ events
◆ execution_id_manager
◆ gt
The documentation for this class was generated from the following files: