Skip to main content

Module assert_control

Module assert_control 

Source
Expand description

The assertion control system tasks’ registry (LRM 1800-2023 §20.11: $assertcontrol and the $asserton/$assertoff/$assertkill/ $assertpasson/… conveniences built on it).

Every assertion the run can control is a site: a concurrent assertion statement, a simple/deferred immediate assertion, an expect, or one of the unique/unique0/priority violation checkers. A site is described by its Table 20-5 assertion_type bit, its Table 20-6 directive_type bit (0: the directive type is not checked – it does not apply to expect and violation reports), the hierarchical scope that holds it and its label (the assertion’s full hierarchical name; empty when it has none).

The control tasks themselves are an append-only log. A site’s state is the fold of the matching entries over SiteState::DEFAULT, applied lazily the next time the site is asked about: the log order is the order the tasks executed in, so a $assertlock makes every later entry that matches the site a no-op until the matching unlock, exactly as §20.11 words it. A site the control tasks never name costs one empty-log test.

Only $assertkill-class entries need an immediate effect (they flush queued reports and procedural instances of the sites they kill): control returns those sites. Everything else is polled: the assertion’s executor reads its SiteState where it acts.

Structs§

Op
One executed control task.
SiteDesc
What one site is, as the registry sees it.
SiteState
A site’s control state.

Enums§

Control
control_type values of Table 20-5.
ControlEvent
A change a control task made to one site’s state, as the VPI assertion callbacks report it (IEEE 1800-2023 39.4.2).

Constants§

ASSERT_ALL
assertion_type default of $assertcontrol (every type).
ASSERT_CONCURRENT
Table 20-5 assertion_type bits.
ASSERT_EXPECT
ASSERT_FINAL_DEFERRED
ASSERT_OBSERVED_DEFERRED
ASSERT_PRIORITY
ASSERT_SIMPLE_IMMEDIATE
ASSERT_UNIQUE
ASSERT_UNIQUE0
ASSERT_VIOLATION
The violation report types (unique/unique0/priority).
CTL_OP_CONTROL
sv_rt_assert_ctl’s op for an assertion control task.
CTL_OP_QUERY
sv_rt_assert_ctl’s op for the state query of one site.
DIR_ALL
directive_type default of $assertcontrol (every directive).
DIR_ASSERT
Table 20-6 directive_type bits.
DIR_ASSUME
DIR_COVER
EXPECT_NO_ACTION_TERM
The term an expect’s blocked process is resumed with when its property was decided but the control tasks switched off the action that would run (0: the pass statement, 1: the else statement).
Q_ALL
Every query bit set: no control task has touched the site.
Q_CHECKING
SiteState::query_bits: reporting on, nonvacuous pass action on, vacuous pass action on, fail action on.
Q_FAIL
Q_PASS_NONVACUOUS
Q_PASS_VACUOUS

Functions§

anonymous_target
The target text naming the unlabeled assertion at source offset in the instance scope (vpi_control on an unnamed assertion, 39.5).
control
Executes a control task. Returns the registered sites an $assertkill (or an $assertcontrol Kill) just reached: the caller flushes what they have queued. The control observer (set_control_observer) is told of every change.
execute
Executes a control task and carries out its immediate effects: the queued deferred reports, queued violation reports and pending procedural assertion instances of every site an $assertkill reached are discarded (20.11). Executing attempts are aborted by their runners, which notice the kill count (SiteState::kills) change the next time they run.
intern
The id of the site desc, registering it the first time. Two descriptors that are equal are one site.
intern_text
The id of the site whose SiteDesc::encode text is text.
query_text
The Q_* bits of the site text names: Q_ALL without touching the registry while no control task has run.
real_sv_rt_assert_ctl⚠
u64 sv_rt_assert_ctl(u32 op, i64 a0, i64 a1, i64 a2, i64 a3, ptr text), the one entry point compiled code reaches the registry through.
reset
Forgets every site and control task (the start of a run).
set_control_observer
Installs (or removes) the function told of every site state change a control task makes, after the registry is released.
site_desc
The descriptor the site id was registered with.
state
The current state of the site id.

Type Aliases§

ControlObserver
The function told of every site state change a control task makes.
SiteId
A registry index of one site.