SVA coding style

Hi all
any there sva cookbooks or article that show how to write sva in good coding styles?
thanks a lot!

In reply to peter:

Hi all
any there sva cookbooks or article that show how to write sva in good coding styles?
thanks a lot!

“Style” is a very fluid word as it involves many disciplines. In my SVA Handbook 4th Edition chapter 8, SystemVerilog Assertions Guidelines, addresses that topic (see the TOC). There is style in:

  • Naming convention, as that helps in the identity of variables, type of construct, etc. For example

  • Separating properties from assertions: Unless there is a lot of reuse, and if the property has no local variables, I prefer to just use the assertion statement without the property declaration.

  • Use of defaults: I generally like the default clocking and disable.

  • Writing the antecedents: This is a good example of what NOT TO DO in style
    Assertion causes sim crash - SystemVerilog - Verification Academy

  • Where to put the assertions in the DUT? in a separate module bound to the DUT?, in SystemVerilog checker inline or bound to the DUT an/or interface?

  • Approaching the requirements: Multiple small assertions? Approaching the requirements from different levels? etc.

  • [b]Correctness/completion:[/b] It is very easy to write assertions that can never fail, or never succeed; this must be avoided.

  • Using alternate approaches to SVA: See my white papers with the links below my signature.

  • Bad properties: Avoid vacuous properties, and contradictory properties

  • Use of unsized additions using +1 versus +1’b1,

  • Adding Environmental properties: They represent properties that are required for a proper functionality of the design when it is embedded into a larger design. For example:

  1. Never PUSH while the FIFO FULL flag is asserted.
  2. Never POP while the FIFO EMPTY flag is asserted.
  3. Never a DMA interrupt until done of DMA transfer

Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact Home - My cvcblr


  1. VF Horizons:PAPER: SVA Alternative for Complex Assertions - SystemVerilog - Verification Academy
  2. http://systemverilog.us/vf/SolvingComplexUsersAssertions.pdf
  3. “Using SVA for scoreboarding and TB designs”
    http://systemverilog.us/papers/sva4scoreboarding.pdf
  4. “Assertions Instead of FSMs/logic for Scoreboarding and Verification”
    https://verificationacademy.com/verification-horizons/october-2013-volume-9-issue-3
  5. SVA in a UVM Class-based Environment
    https://verificationacademy.com/verification-horizons/february-2013-volume-9-issue-1/SVA-in-a-UVM-Class-based-Environment

In reply to ben@SystemVerilog.us:

Thanks!!