pub enum SensitivityEntry {
Static {
proc: ProcessId,
term_index: usize,
edge: Option<EdgeKind>,
sel: Option<(u32, u32)>,
},
Dynamic {
proc: ProcessId,
term_index: usize,
edge: EdgeKind,
iff: Option<PredicateFn>,
repeat_total: Option<u64>,
sel: Option<(u32, u32)>,
},
}Expand description
One row of the inverted index (scheduler.md §4’s literal shape): Static
entries are installed once, at process-registration time, from
codegen-supplied StaticSensitivity metadata; Dynamic entries are
installed/removed every time a process suspends/resumes on a general
@(...)/wait(...) (built from the live EventWaitSet at that exact
suspend point) and are gone from the table the instant the owning process
resumes.
Static::edge == None means “any change” (always_comb/always_latch’s
LRM-implicit “all variables read” sensitivity); Static::edge == Some(k) means “only transitions classifying as k” (always_ff’s
explicit clock/reset edge). Dynamic::edge is not wrapped in Option
because scheduler.md’s EventWaitSet/EventTerm family never produces an
untyped “no edge” dynamic term — an any-change dynamic wakeup (e.g. an
ImplicitAny disjunct, or a named-event trigger pulse) is represented
directly as EdgeKind::None, the same sentinel SensitivityTable::matches
treats as an unconditional match (any call into matches already implies
a real change happened — see matches’s doc comment) for Static
entries — so one matching rule serves both variants uniformly.
Variants§
Static
Fields
term_index: usizeThe edge’s index in StaticSensitivity::edges (reported as the fired
term, so a native process can tell which member of its event list fired).
sel: Option<(u32, u32)>Some((lsb, width)) for an always_comb/always_latch that reads
only a constant bit/part select of the cell (LRM 9.2.2.2.1: the
longest static prefix, not the whole variable, is in the implicit
sensitivity list): the entry matches only an update that changed
those bits (see SensitivityTable::narrow_static).
Dynamic
Fields
iff: Option<PredicateFn>repeat_total: Option<u64>Some(count) iff this row was installed from the inner term of
an EventTerm::Repeat { count, inner } (ledger SC-052) — None
for an ordinary Edge/ImplicitAny/NamedEventTrigger term.
matches surfaces this so sched::control’s
EngineNotifySink::notify_change can route a matching firing
through RepeatCounters::on_term_fired before ever enqueueing —
the sensitivity table itself only tracks whether a row is
repeat-sourced and its declared total, never a live remaining
count (that lives in sched::repeat::RepeatCounters, keyed by
(proc, term_index), not here).
sel: Option<(u32, u32)>Some((lsb, width)) for a wait on a bit/part select of the cell
(@(v[3]), @(posedge v[5:4]), LRM 9.4.2): the entry matches only
an update that changed those bits (and, for an edge, whose
transition on bit lsb is that edge) – decided from the update’s
ChangeDelta, not from the cell’s own bit-0 classification.