Struct miden_processor::Process

source ·
pub struct Process<H>
where H: Host,
{ /* private fields */ }
Expand description

A Process is the underlying execution engine for a Miden Program.

Typically, you do not need to worry about, or use Process directly, instead you should prefer to use either execute or execute_iter, which also handle setting up the process state, inputs, as well as compute the ExecutionTrace for the program.

However, for situations in which you want finer-grained control over those steps, you will need to construct an instance of Process using Process::new, invoke Process::execute, and then get the execution trace using ExecutionTrace::new using the outputs produced by execution.

Implementations§

source§

impl<H> Process<H>
where H: Host,

source

pub fn new( kernel: Kernel, stack_inputs: StackInputs, host: H, execution_options: ExecutionOptions, ) -> Self

Creates a new process with the provided inputs.

source

pub fn new_debug(kernel: Kernel, stack_inputs: StackInputs, host: H) -> Self

Creates a new process with provided inputs and debug options enabled.

source

pub fn execute( &mut self, program: &Program, ) -> Result<StackOutputs, ExecutionError>

Executes the provided Program in this process.

source

pub const fn kernel(&self) -> &Kernel

source

pub fn into_parts(self) -> (System, Decoder, Stack, RangeChecker, Chiplets, H)

Trait Implementations§

source§

impl<H: Host> ProcessState for Process<H>

source§

fn clk(&self) -> RowIndex

Returns the current clock cycle of a process.
source§

fn ctx(&self) -> ContextId

Returns the current execution context ID.
source§

fn fmp(&self) -> u64

Returns the current value of the free memory pointer.
source§

fn get_stack_item(&self, pos: usize) -> Felt

Returns the value located at the specified position on the stack at the current clock cycle.
source§

fn get_stack_word(&self, word_idx: usize) -> Word

Returns a word located at the specified word index on the stack. Read more
source§

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.
source§

fn get_mem_value(&self, ctx: ContextId, addr: u32) -> Option<Word>

Returns a word located at the specified context/address, or None if the address hasn’t been accessed previously.
source§

fn get_mem_state(&self, ctx: ContextId) -> Vec<(u64, Word)>

Returns the entire memory state for the specified execution context at the current clock cycle. Read more

Auto Trait Implementations§

§

impl<H> !Freeze for Process<H>

§

impl<H> !RefUnwindSafe for Process<H>

§

impl<H> Send for Process<H>
where H: Send,

§

impl<H> !Sync for Process<H>

§

impl<H> Unpin for Process<H>
where H: Unpin,

§

impl<H> UnwindSafe for Process<H>
where H: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more