Skip to main content

BasicBlock

Struct BasicBlock 

Source
pub struct BasicBlock<'d> {
Show 14 fields pub bindings: Vec<ArgBinding<'d>>, pub this_var: Option<Symbol<'d>>, pub ref_aliases: Vec<(Symbol<'d>, Symbol<'d>)>, pub stmts: Vec<Statement<'d>>, pub probes: Vec<(usize, Statement<'d>)>, pub disable_probes: Vec<(usize, Statement<'d>)>, pub frame_probes: Vec<(usize, FrameProbe<'d>)>, pub block_events: Vec<(usize, Symbol<'d>, bool)>, pub stmt_scopes: Vec<(usize, Symbol<'d>)>, pub step_exprs: Vec<Expression<'d>>, pub repeat_init: Option<(RepeatCounterId, RepeatCount<'d>)>, pub repeat_decrement: Option<RepeatCounterId>, pub expect_resume: bool, pub terminator: Terminator<'d>,
}
Expand description

A straight-line run of non-suspending statements ending in exactly one Terminator (PR-008).

Fields§

§bindings: Vec<ArgBinding<'d>>

Inlined-task argument transfers, run before stmts (see ArgBinding).

§this_var: Option<Symbol<'d>>

The this of the innermost class-method task inlined at this block (its body’s blocks; its binding and continuation blocks belong to the caller): what an implicit-this member access or method call in the block resolves against when the process itself is not a method.

§ref_aliases: Vec<(Symbol<'d>, Symbol<'d>)>

The ref formals of the tasks inlined at this block that name a static variable or net of their call (LRM 13.5.2), with that storage: the formal reads and writes the actual itself in this block, so one process may bind the same formal to different actuals per call.

§stmts: Vec<Statement<'d>>§probes: Vec<(usize, Statement<'d>)>

VPI cbStmt probe points (IEEE 1800-2023 38.36.1): (i, s) means the statement s is about to execute and the probe runs just before stmts[i] (i == stmts.len() is after the last one, still before step_exprs and the terminator). Only statements this CFG decomposes (or keeps as a leaf, which codegen then does not probe again) appear here; codegen emits a probe for them only when a VPI library is loaded.

§disable_probes: Vec<(usize, Statement<'d>)>

VPI cbDisable probe points (38.36.1): (i, s) means the disable statement s, which this CFG turned into a jump out of the named block it names (so it is not in stmts), has taken effect; the probe runs where probes at index i do, after them.

§frame_probes: Vec<(usize, FrameProbe<'d>)>

VPI frame probe points (37.43) of the blocking tasks inlined into this CFG: they run where probes at the same index do, after them (and after any disable_probes).

§block_events: Vec<(usize, Symbol<'d>, bool)>

Covergroup block events (LRM 19.3 @@(begin t) / @@(end t)) of the blocking tasks inlined into this CFG: (i, task, is_end) signals the begin (or end) of task’s activation where probes at index i run. Codegen emits only those whose task a covergroup names.

§stmt_scopes: Vec<(usize, Symbol<'d>)>

(i, subroutine): stmts[i] was written in the body of the inlined subroutine, whose time unit its delays (q <= #d v) are in (LRM 3.14.2.1). Absent for the process’s own.

§step_exprs: Vec<Expression<'d>>

A for loop’s per-iteration step expressions (e.g. i++), run after stmts and before terminator fires (Task 1, walk_for_loop). Empty for every block that is not a for loop’s step block. A separate field, not folded into stmts: Vec<Statement<'d>>, because Statement::for_loop_steps() returns bare Expression<'d>s (i++ is an expression in this grammar position, never a Statement – confirmed against the pinned sv-lang=0.1.9 binding, which has no expression-to-statement wrapper) and this crate never fabricates AST nodes. Every slot this task’s for fixture writes through (i itself) is a FrameSlotSource::DeclaredVar permanent slot (lower_to_segments’s own doc comment), so omitting these from liveness::compute_liveness’s backward read/write walk does not under-approximate any frame-slot’s live range – codegen consumption of this field is future work, tracked in this task’s deviations, not a silent drop (the expressions are still here, in the CFG, for whichever pass reads step_exprs next).

§repeat_init: Option<(RepeatCounterId, RepeatCount<'d>)>

R-run Task 8: Some((counter, count_expr)) iff this block is a suspend-containing repeat(N) loop’s own entry block – count_expr (RepeatLoop::condition(), per LRM the loop’s iteration COUNT, not a boolean) is evaluated exactly ONCE, run after stmts and before terminator fires (mirrors Self::step_exprs’s own “run after stmts, before terminator” placement), its result (clamped to non-negative) becoming counter’s starting value. None for every other block, including a suspend-free repeat (which stays the pre-existing opaque leaf stmt_shared::lower_repeat_loop already handles – see RepeatCounterId’s own doc comment).

§repeat_decrement: Option<RepeatCounterId>

R-run Task 8: Some(counter) iff this block is a suspend-containing repeat(N) loop’s body’s own back-edge block – decrements counter by exactly one, run after stmts/step_exprs and before terminator fires. None for every other block.

§expect_resume: bool

true iff this block is the one an expect statement’s wait resumes into (LRM 1800-2023 §16.17): its first statement is that expect again, whose resume half (the pass/else action, selected by the outcome the process was woken with) codegen lowers there.

§terminator: Terminator<'d>

Trait Implementations§

Source§

impl<'d> Clone for BasicBlock<'d>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'d> Debug for BasicBlock<'d>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'d> !RefUnwindSafe for BasicBlock<'d>

§

impl<'d> !UnwindSafe for BasicBlock<'d>

§

impl<'d> Freeze for BasicBlock<'d>

§

impl<'d> Send for BasicBlock<'d>

§

impl<'d> Sync for BasicBlock<'d>

§

impl<'d> Unpin for BasicBlock<'d>

§

impl<'d> UnsafeUnpin for BasicBlock<'d>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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