pub trait Tracer {
Show 15 methods
// Required methods
fn start_clock_cycle(
&mut self,
processor: &FastProcessor,
execution_state: NodeExecutionState,
continuation_stack: &mut ContinuationStack,
current_forest: &Arc<MastForest>,
);
fn record_external_node_resolution(
&mut self,
node_id: MastNodeId,
forest: &Arc<MastForest>,
);
fn record_hasher_permute(&mut self, hashed_state: [Felt; 12]);
fn record_hasher_build_merkle_root(
&mut self,
path: Option<&MerklePath>,
root: Word,
);
fn record_hasher_update_merkle_root(
&mut self,
path: Option<&MerklePath>,
old_root: Word,
new_root: Word,
);
fn record_memory_read_element(&mut self, element: Felt, addr: Felt);
fn record_memory_read_word(&mut self, word: Word, addr: Felt);
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 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_external_node_resolution(
&mut self,
node_id: MastNodeId,
forest: &Arc<MastForest>,
)
fn record_external_node_resolution( &mut self, node_id: MastNodeId, forest: &Arc<MastForest>, )
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. 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, hashed_state: [Felt; 12])
fn record_hasher_permute(&mut self, hashed_state: [Felt; 12])
Records the result of a call to Hasher::permute()
.
Sourcefn record_hasher_build_merkle_root(
&mut self,
path: Option<&MerklePath>,
root: Word,
)
fn record_hasher_build_merkle_root( &mut self, path: Option<&MerklePath>, 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,
path: Option<&MerklePath>,
old_root: Word,
new_root: Word,
)
fn record_hasher_update_merkle_root( &mut self, path: Option<&MerklePath>, 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)
fn record_memory_read_element(&mut self, element: Felt, addr: Felt)
Records the element read from memory at the given address.
Sourcefn record_memory_read_word(&mut self, word: Word, addr: Felt)
fn record_memory_read_word(&mut self, word: Word, addr: Felt)
Records the word read from 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 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.