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: booltrue 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>