• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
          • Expression-sizing
          • Occform
          • Oprewrite
          • Expand-functions
          • Delayredux
          • Unparameterization
          • Caseelim
          • Split
          • Selresolve
          • Weirdint-elim
          • Vl-delta
          • Replicate-insts
          • Rangeresolve
          • Propagate
          • Clean-selects
          • Clean-params
          • Blankargs
          • Inline-mods
          • Expr-simp
          • Trunc
          • Always-top
          • Gatesplit
          • Gate-elim
          • Expression-optimization
          • Elim-supplies
          • Wildelim
            • Vl-design-wildelim
            • Vl-expr-wildelim
          • Drop-blankports
          • Clean-warnings
          • Addinstnames
          • Custom-transform-hooks
          • Annotate
          • Latchcode
          • Elim-unused-vars
          • Problem-modules
        • Lint
        • Mlib
        • Server
        • Kit
        • Printer
        • Esim-vl
        • Well-formedness
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Transforms

Wildelim

Elimination of wildcard equality operators, ==? and !=?.

See SystemVerilog 2012, Section 11.4.6 Wildcard Equality Operators. In brief:

  • a ==? b determines whether a equals b, except that X and Z values in b act as wildcards.
  • a !=? b determines whether a does not equal b, except that X and Z values in b act as wildcards.

These operators produce 1-bit, self-determined results. If a and b are of unequal bit lengths, they are extended in the same manner as for the logical equality/inequality operators. The result is X if the a operand contains any X or Z bit that is not being compared with a wildcard in the b operand.

These operators are basically fine and sensible when b is a constant integer literal like 4'b0101 or a weird integer like 4'b01xx. However, in the more general case where b is some expression that is computed at runtime, these operators are fundamentally broken because they do not treat X bits within b as unknowns. This poses problems for back-end tools like esim that expect operators to behave monotonically.

VL attempts to support simple uses of ==? and !=?, i.e., when the right-hand argument is a constant or weird integer literal. In this case, we can compute the mask of bits that we care about, and then consider the equality of the masked expressions.

Ordering notes. We expect that this transform should be run after sizing. Typically you will want to run it after sizing but before, e.g., truncating or splitting expressions.

Subtopics

Vl-design-wildelim
Top-level wildelim transform.
Vl-expr-wildelim
Top-level wrapper for eliminating ==? and !=? from an expression. Avoids reconsing when there are no ==? or !=? operators.