← Design Verification Interviews

Interview Question · Concept

Assertoff, Assertkill and Disable Iff

L1 JuniorL2 Mid-Levelsvaassertion controlreset

The Question

The interviewer asks

When would you turn assertions off with $assertoff or $assertkill from the test, rather than writing disable iff in the property?

Reveal the Model Answer

disable iff belongs to the property. It states when the rule does not apply, such as reset. It travels with the checker into every test and into formal. $assertoff, $asserton and $assertkill are switches in the test. They cover situations the rule cannot know about, such as an error-injection test or a power-down. $assertoff stops new attempts but lets attempts already running finish; $assertkill also aborts those.

An attempt started at 15 checks ack at 45; the test acts at 30
0123edge (ns)15253545reqacktest calls $assertoff or $assertkill at 30$assertoff: this attempt still fails; $assertkill: aborted

The standard's behaviour. Verilator 5.052 differs; see the pitfalls.

Self-Check

Tick each key point you covered in your answer.

What Interviewers Listen For (Junior)

A good junior answer keeps reset inside the property with disable iff. It uses the control tasks only for situations special to one test.

Cross-Questions

Where the interviewer goes next. Open a node to practise that follow-up.

WhyWhat IfCompareScale It

  1. Assertoff, Assertkill and Disable Iff
  2. CompareWhat Happens to the Attempt Already RunningL2 Mid-Level

    Compare $assertoff and $assertkill for an attempt that started two cycles before the call and is still waiting for its consequent.

    Reveal the Model Answer

    With $assertoff that attempt runs to completion and can still fail; only attempts that would start later are suppressed. With $assertkill it is aborted at once and reports nothing. Use $assertkill when the scenario that started those attempts has become meaningless, for example after an injected error.

    $assertoff$assertkill
    New attemptsNot startedNot started
    An attempt already runningRuns to the end and can still failAborted at once; reports nothing
    Use it whenRunning attempts are still meaningfulThe scenario behind them is now meaningless

    Self-Check

    Tick each key point you covered in your answer.

    Misconception

    "$asserton resumes the attempts that $assertkill stopped."

    Killed attempts are gone. $asserton lets new attempts start at the following clock ticks.

    Source IEEE 1800-2017 §20.12

  3. What IfAssertions During an Error-Injection TestL2 Mid-Level

    Asked if they mention error-injection tests

    What if a test deliberately corrupts a CRC to check the error path? Write the control around the injection so only the right checks are switched off.

    Reveal the Model Answer

    Switch off only the checker instance that would fire on the injected error, with a scoped call such as $assertkill(0, tb.dut.rx.u_crc_chk). Inject the error, wait for the error path to finish, then call $asserton(0, tb.dut.rx.u_crc_chk). Keep the error-response checks on, since they are what the test is for, and log both calls.

    Self-Check

    Tick each key point you covered in your answer.

    Missed Corner

    Calls $assertoff; with no arguments for the whole test.

    That disables every assertion in the design, including the ones that check the error response, for the rest of the run.

    Source IEEE 1800-2017 §20.12

  4. WhyWhy Assertion Control Lives in the TestL1 Junior

    If properties can describe their own exceptions, why does the language also give the test switches?

    Reveal the Model Answer

    Some exceptions depend on what the test is doing, not on design signals. Examples are an injected fault, a power-aware run with a domain switched off, or a bring-up test that runs before configuration. Encoding those in every property would couple checkers to tests. Control tasks keep the checker generic and put the test-specific decision in the test.

    Self-Check

    Tick each key point you covered in your answer.

    Half-Truth

    "Control tasks are a debugging convenience only."

    They are a standard part of assertion methodology for scenarios the properties cannot observe.

    Source Mehta, SystemVerilog Assertions and Functional Coverage (3rd ed.), §9.6 (PDF p196)

  5. What IfAn Assertoff That Was Never UndoneL1 JuniorL2 Mid-Level

    What if the test calls $assertoff for an error injection and never calls $asserton again?

    Reveal the Model Answer

    The rest of the test then runs with those checks off, and it still passes. Scope the call to the assertions the fault affects and to the window it lasts. Turn them back on with $asserton at a known point. Log both calls, so a review can see what was off and when.

    Self-Check

    Tick each key point you covered in your answer.

    Missed Corner

    "$assertoff is harmless; the next test starts fresh."

    Within this test it stays in force until $asserton. Bugs after the injection window then pass without a check.

    Source Mehta, SystemVerilog Assertions and Functional Coverage (3rd ed.), §9.6 (PDF p196)

  6. Scale ItA Regression Policy for Suppressed AssertionsL3 SeniorL4 Staff

    In a large regression, how do you stop assertion suppression from quietly hiding bugs?

    Reveal the Model Answer

    Route all control through one testbench utility that logs each call with its scope and time. Fail the test if any scope is still off at the end. Report per test which checkers were suppressed and for how long, and review that list like waivers. Prefer fixing an over-strict property to suppressing it.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Staff)

    A good staff answer makes every switch-off auditable: logged, scoped, switched back on and reviewed. It treats a growing list of switched-off checks as a sign of weak properties.

    Wrong Altitude

    "Each test owner manages their own $assertoff calls."

    Unreviewed, unscoped calls accumulate, and a single forgotten one disables checking for every following phase of a test.

What People Get Wrong

Common wrong answers and why they fail.

Misconception

"$assertoff kills the checks already running, like a reset."

Attempts already under way finish normally; only new attempts stop. Aborting them is what $assertkill is for.

Source Mehta, SystemVerilog Assertions and Functional Coverage (3rd ed.), §9.6 (PDF p196)

Tool as Truth

"On our simulator $assertoff(0, tb.p_off) silenced only p_off and dropped its in-flight attempt, so that is the rule."

In a probe for this batch Verilator 5.052 silenced every assertion, not just the listed one, and dropped the attempt already running. The standard limits the call to the listed scope and lets running attempts finish.

Source Measured for this batch on Verilator 5.052: $assertoff(0, tb.p_off) at 30 also silenced an uncontrolled assertion and the 15 ns attempt never reported

Wrong Altitude

"Use $assertoff during reset instead of disable iff; it is less typing."

Then the rule is wrong outside that test: formal and any other test that resets mid-run see false failures. Reset belongs in the property.

Learn It, Then Prove It