pub trait Tracer {
Show 22 methods
// Required methods
fn start_clock_cycle(
&mut self,
processor: &FastProcessor,
execution_state: NodeExecutionState,
continuation_stack: &mut ContinuationStack,
current_forest: &Arc<MastForest>,
);
fn record_mast_forest_resolution(
&mut self,
node_id: MastNodeId,
forest: &Arc<MastForest>,
);
fn record_hasher_permute(
&mut self,
input_state: [Felt; 12],
output_state: [Felt; 12],
);
fn record_hasher_build_merkle_root(
&mut self,
node: Word,
path: Option<&MerklePath>,
index: Felt,
output_root: Word,
);
fn record_hasher_update_merkle_root(
&mut self,
old_value: Word,
new_value: Word,
path: Option<&MerklePath>,
index: Felt,
old_root: Word,
new_root: Word,
);
fn record_memory_read_element(
&mut self,
element: Felt,
addr: Felt,
ctx: ContextId,
clk: RowIndex,
);
fn record_memory_read_word(
&mut self,
word: Word,
addr: Felt,
ctx: ContextId,
clk: RowIndex,
);
fn record_memory_write_element(
&mut self,
element: Felt,
addr: Felt,
ctx: ContextId,
clk: RowIndex,
);
fn record_memory_write_word(
&mut self,
word: Word,
addr: Felt,
ctx: ContextId,
clk: RowIndex,
);
fn record_advice_pop_stack(&mut self, value: Felt);
fn record_advice_pop_stack_word(&mut self, word: Word);
fn record_advice_pop_stack_dword(&mut self, words: [Word; 2]);
fn record_u32and(&mut self, a: Felt, b: Felt);
fn record_u32xor(&mut self, a: Felt, b: Felt);
fn record_u32_range_checks(
&mut self,
clk: RowIndex,
u32_lo: Felt,
u32_hi: Felt,
);
fn record_kernel_proc_access(&mut self, proc_hash: Word);
fn record_circuit_evaluation(
&mut self,
clk: RowIndex,
circuit_eval: CircuitEvaluation,
);
fn increment_clk(&mut self);
fn increment_stack_size(&mut self, processor: &FastProcessor);
fn decrement_stack_size(&mut self);
fn start_context(&mut self);
fn restore_context(&mut self);
}Expand description
A trait for tracing the execution of a FastProcessor.
Required Methods§
Sourcefn start_clock_cycle(
&mut self,
processor: &FastProcessor,
execution_state: NodeExecutionState,
continuation_stack: &mut ContinuationStack,
current_forest: &Arc<MastForest>,
)
fn start_clock_cycle( &mut self, processor: &FastProcessor, execution_state: NodeExecutionState, continuation_stack: &mut ContinuationStack, current_forest: &Arc<MastForest>, )
Signals the start of a new clock cycle.
This is guaranteed to be called before executing the operation at the given clock cycle. Additionally, miden_core::mast::ExternalNode nodes are guaranteed to be resolved before this method is called.
Sourcefn record_mast_forest_resolution(
&mut self,
node_id: MastNodeId,
forest: &Arc<MastForest>,
)
fn record_mast_forest_resolution( &mut self, node_id: MastNodeId, forest: &Arc<MastForest>, )
Records and replays the resolutions of crate::host::AsyncHost::get_mast_forest or crate::host::SyncHost::get_mast_forest.
Note that when execution encounters a miden_core::mast::ExternalNode, the external node gets resolved to the MAST node it refers to in the new MAST forest, without consuming the clock cycle (or writing anything to the trace). Hence, a clock cycle where execution encounters an external node effectively has 2 nodes associated with it. Tracer::start_clock_cycle is called on the resolved node (i.e. not the external node). This method is called on the external node before it is resolved, and hence is guaranteed to be called before Tracer::start_clock_cycle for clock cycles involving an external node.
Sourcefn record_hasher_permute(
&mut self,
input_state: [Felt; 12],
output_state: [Felt; 12],
)
fn record_hasher_permute( &mut self, input_state: [Felt; 12], output_state: [Felt; 12], )
Records the result of a call to Hasher::permute().
Sourcefn record_hasher_build_merkle_root(
&mut self,
node: Word,
path: Option<&MerklePath>,
index: Felt,
output_root: Word,
)
fn record_hasher_build_merkle_root( &mut self, node: Word, path: Option<&MerklePath>, index: Felt, output_root: Word, )
Records the result of a call to Hasher::build_merkle_root().
The path is an Option to support environments where the Hasher is not present, such as
in the context of parallel trace generation.
Sourcefn record_hasher_update_merkle_root(
&mut self,
old_value: Word,
new_value: Word,
path: Option<&MerklePath>,
index: Felt,
old_root: Word,
new_root: Word,
)
fn record_hasher_update_merkle_root( &mut self, old_value: Word, new_value: Word, path: Option<&MerklePath>, index: Felt, old_root: Word, new_root: Word, )
Records the result of a call to Hasher::update_merkle_root().
The path is an Option to support environments where the Hasher is not present, such as
in the context of parallel trace generation.
Sourcefn record_memory_read_element(
&mut self,
element: Felt,
addr: Felt,
ctx: ContextId,
clk: RowIndex,
)
fn record_memory_read_element( &mut self, element: Felt, addr: Felt, ctx: ContextId, clk: RowIndex, )
Records the element read from memory at the given address.
Sourcefn record_memory_read_word(
&mut self,
word: Word,
addr: Felt,
ctx: ContextId,
clk: RowIndex,
)
fn record_memory_read_word( &mut self, word: Word, addr: Felt, ctx: ContextId, clk: RowIndex, )
Records the word read from memory at the given address.
Sourcefn record_memory_write_element(
&mut self,
element: Felt,
addr: Felt,
ctx: ContextId,
clk: RowIndex,
)
fn record_memory_write_element( &mut self, element: Felt, addr: Felt, ctx: ContextId, clk: RowIndex, )
Records the element written to memory at the given address.
Sourcefn record_memory_write_word(
&mut self,
word: Word,
addr: Felt,
ctx: ContextId,
clk: RowIndex,
)
fn record_memory_write_word( &mut self, word: Word, addr: Felt, ctx: ContextId, clk: RowIndex, )
Records the word written to memory at the given address.
Sourcefn record_advice_pop_stack(&mut self, value: Felt)
fn record_advice_pop_stack(&mut self, value: Felt)
Records the value returned by a crate::host::advice::AdviceProvider::pop_stack operation.
Sourcefn record_advice_pop_stack_word(&mut self, word: Word)
fn record_advice_pop_stack_word(&mut self, word: Word)
Records the value returned by a crate::host::advice::AdviceProvider::pop_stack_word operation.
Sourcefn record_advice_pop_stack_dword(&mut self, words: [Word; 2])
fn record_advice_pop_stack_dword(&mut self, words: [Word; 2])
Records the value returned by a crate::host::advice::AdviceProvider::pop_stack_dword operation.
Sourcefn record_u32and(&mut self, a: Felt, b: Felt)
fn record_u32and(&mut self, a: Felt, b: Felt)
Records the operands of a u32and operation.
Sourcefn record_u32xor(&mut self, a: Felt, b: Felt)
fn record_u32xor(&mut self, a: Felt, b: Felt)
Records the operands of a u32xor operation.
Sourcefn record_u32_range_checks(&mut self, clk: RowIndex, u32_lo: Felt, u32_hi: Felt)
fn record_u32_range_checks(&mut self, clk: RowIndex, u32_lo: Felt, u32_hi: Felt)
Records the high and low 32-bit limbs of the result of a u32 operation for the purposes of the range checker. This is expected to result in four 16-bit range checks.
Sourcefn record_kernel_proc_access(&mut self, proc_hash: Word)
fn record_kernel_proc_access(&mut self, proc_hash: Word)
Records the procedure hash of a syscall.
Sourcefn record_circuit_evaluation(
&mut self,
clk: RowIndex,
circuit_eval: CircuitEvaluation,
)
fn record_circuit_evaluation( &mut self, clk: RowIndex, circuit_eval: CircuitEvaluation, )
Records the evaluation of a circuit.
Sourcefn increment_clk(&mut self)
fn increment_clk(&mut self)
Signals that the processor clock is being incremented.
Sourcefn increment_stack_size(&mut self, processor: &FastProcessor)
fn increment_stack_size(&mut self, processor: &FastProcessor)
Signals that the stack depth is incremented as a result of pushing a new element.
Sourcefn decrement_stack_size(&mut self)
fn decrement_stack_size(&mut self)
Signals that the stack depth is decremented as a result of popping an element off the stack.
Note that if the stack depth is already miden_core::stack::MIN_STACK_DEPTH, then the stack depth is unchanged; the top element is popped off, and a ZERO is shifted in at the bottom.
Sourcefn start_context(&mut self)
fn start_context(&mut self)
Signals the start of a new execution context, as a result of a CALL, SYSCALL or DYNCALL operation being executed.
Sourcefn restore_context(&mut self)
fn restore_context(&mut self)
Signals the end of an execution context, as a result of an END operation associated with a CALL, SYSCALL or DYNCALL.