FVO — Formal Verification Online
Lesson 13.1 · Auxiliary Code and Modelling

Why properties need helper logic

SVA is excellent at local timing: "after a request, a grant within four cycles". It is much weaker at counting and remembering. Try writing these with sequences alone:

  • "There are never more than 8 requests waiting for a response."
  • "A response only ever arrives for a tag that was issued and not yet answered."
  • "The value read from address A is the last value written to address A."

Each needs memory of the past that can be arbitrarily long. You could stretch sequences with local variables and unbounded repetition, but the result is hard to read and very expensive for formal engines, because every pending attempt of a property becomes extra hidden state.

The alternative is auxiliary code (also called modelling code or glue logic): a few lines of ordinary, synthesizable SystemVerilog in the formal testbench that keep exactly the history the property needs. The assertion then becomes short.

free inputschosen by the toolDUTunchanged RTLauxiliary modelcounters, flags, refsassertionsone-linersthe model watches inputs and outputs
The auxiliary model observes the DUT's inputs and outputs and keeps the history the assertions need.

Rules for good auxiliary code

RuleWhy
Keep it in the formal testbench (bind or wrapper), never in the RTLThe design stays clean; the same RTL is signed off and shipped.
Make it synthesizable: always_ff, always_comb, no delaysFormal tools only understand synthesizable semantics.
Model the spec, not the implementationIf you copy the RTL into the model, both share the same bugs.
Keep it tiny and obviously correctA bug in the model hides bugs or causes false failures.
Cover the model's interesting statesProves the model is exercised (e.g. "counter reached its maximum").
Prefer outputs and interface signals over internal RTL namesInternal names change; interface behaviour is the contract.

Discussion

No comments yet.

Was this page helpful?

Tip: select any text on the page before clicking Report and it will be quoted in your report.