Skip to main content

An Apology for Local Variables

  • Chapter
  • First Online:
SVA: The Power of Assertions in SystemVerilog
  • 2537 Accesses

Abstract

This chapter gives an intuitive introduction to SystemVerilog Assertion local variables based on examples. Local variables are a powerful feature of SVA that enable an assertion to capture the value of an expression at a specified point in its evaluation and store that value for later reference or modification. While local variables do not increase the theoretical expressive power of SVA, they do make the encoding of many assertions much easier, and they help to avoid the need to create auxiliary state machines to support assertions.

Local color has a fatal tendency to remain local; but it is also true that the universal often borders on the void. — DuBose Heyward and Hervey Allen

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 99.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 129.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 179.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    The use of $sampled specifies that sampled values of start and dataIn are used in the always procedure, maintaining consistency with the implicit use of sampled values in a_seq_data_check. See the detailed discussion in Sect. 9.1.1.

  2. 2.

    The antecedent written in Line 6 of Fig. 15.4 is more verbose than the one in Line 22 of Fig. 9.4. This has been done to help highlight the similarities of the code in Figs. 15.4 and 15.5.

  3. 3.

    A formal tool may also accept procedural concurrent assertions or final assertions.

  4. 4.

    The initialization could be skipped because the valid members are of data of type bit, which is initialized by default to 1’b0. The explicit initialization clarifies the intention. The initial values of the activeTag members are not important. Note also that only the first MAX_ACTIVE entries of the array need be initialized.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Cerny, E., Dudani, S., Havlicek, J., Korchemny, D. (2015). An Apology for Local Variables. In: SVA: The Power of Assertions in SystemVerilog. Springer, Cham. https://doi.org/10.1007/978-3-319-07139-8_15

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-07139-8_15

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-07138-1

  • Online ISBN: 978-3-319-07139-8

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics