Trait miden_processor::ProcessState
source · pub trait ProcessState {
// Required methods
fn clk(&self) -> u32;
fn ctx(&self) -> ContextId;
fn fmp(&self) -> u64;
fn get_stack_item(&self, pos: usize) -> Felt;
fn get_stack_word(&self, word_idx: usize) -> Word;
fn get_stack_state(&self) -> Vec<Felt>;
fn get_mem_value(&self, ctx: ContextId, addr: u32) -> Option<Word>;
fn get_mem_state(&self, ctx: ContextId) -> Vec<(u64, Word)>;
}
Expand description
A trait that defines a set of methods which allow access to the state of the process.
Required Methods§
sourcefn get_stack_item(&self, pos: usize) -> Felt
fn get_stack_item(&self, pos: usize) -> Felt
Returns the value located at the specified position on the stack at the current clock cycle.
sourcefn get_stack_word(&self, word_idx: usize) -> Word
fn get_stack_word(&self, word_idx: usize) -> Word
Returns a word located at the specified word index on the stack.
Specifically, word 0 is defined by the first 4 elements of the stack, word 1 is defined by the next 4 elements etc. Since the top of the stack contains 4 word, the highest valid word index is 3.
The words are created in reverse order. For example, for word 0 the top element of the stack will be at the last position in the word.
Creating a word does not change the state of the stack.
sourcefn get_stack_state(&self) -> Vec<Felt>
fn get_stack_state(&self) -> Vec<Felt>
Returns stack state at the current clock cycle. This includes the top 16 items of the stack + overflow entries.