• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
        • Svmods
        • Svstmt
        • Sv-tutorial
        • Expressions
          • Rewriting
          • Svex
          • Bit-blasting
          • Functions
            • 4vec-operations
            • 3vec-operations
            • *svex-op-table*
          • 4vmask
          • Why-infinite-width
          • Svex-vars
          • Evaluation
          • Values
        • Symbolic-test-vector
        • Vl-to-svex
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Expressions

Functions

Our expressions may involve the application of a fixed set of known functions. There are functions available for modeling many bit-vector operations like bitwise and, plus, less-than, and other kinds of hardware operations like resolving multiple drivers, etc.

SVEX has a fixed language of known functions. The following table shows the function symbols (all in the SV package) and their meanings.

We make no attempt to have a minimal set of functions. Generally speaking, the incremental cost in complexity of supporting more functions is relatively low. Our tools for rewriting and symbolically evaluating expressions can be proven correct, so there is little risk that adding new operations to the backend could cause any problems.

On the other hand, the correct translation from languages like Verilog into SV expressions is a serious concern, and we have no way to prove it is correct. Where possible, then, it seems best to add new operators to the backend to make the translation from Verilog as simple as possible.

SVEX form4vec functionDescription
(ID X)4vec-fixidentity function
(BITSEL INDEX X)4vec-bit-extractbit select
(UNFLOAT X)3vec-fixchange Z bits to Xes
(BITNOT X)4vec-bitnotbitwise negation
(BITAND X Y)4vec-bitandbitwise AND
(BITOR X Y)4vec-bitorbitwise OR
(BITXOR X Y)4vec-bitxorbitwise XOR
(RES X Y)4vec-resresolve (short together)
(RESAND X Y)4vec-resandresolve wired AND
(RESOR X Y)4vec-resorresolve wired OR
(OVERRIDE X Y)4vec-overrideresolve different strengths
(ONP X)4vec-onsetidentity, except Z becomes 0
(OFFP X)4vec-offsetnegation, except Z becomes 0
(UAND X)4vec-reduction-andunary (reduction) AND
(UOR X)4vec-reduction-orunary (reduction) OR
(UXOR X)4vec-parityreduction XOR, i.e. parity
(ZEROX WIDTH X)4vec-zero-extzero extend
(SIGNX WIDTH X)4vec-sign-extsign extend
(CONCAT WIDTH X Y)4vec-concatconcatenate at a given bit width
(BLKREV WIDTH BSZ X)4vec-rev-blocksreverse order of blocks
(RSH SHIFT X)4vec-rshright shift
(LSH SHIFT X)4vec-lshleft shift
(+ X Y)4vec-plusaddition
(B- X Y)4vec-minussubtraction
(U- X)4vec-uminusunary minus
(* X Y)4vec-timesmultiplication
(/ X Y)4vec-quotientdivision
(% X Y)4vec-remaindermodulus
(XDET X)4vec-xdetidentity on binary vectors, else X
(COUNTONES X)4vec-countonescount of 1-bits
(ONEHOT X)4vec-onehotone-hot check
(ONEHOT0 X)4vec-onehot0one-hot check (0-hot allowed)
(< X Y)4vec-<less than
(== X Y)4vec-==equality
(=== X Y)4vec-===case equality (scary verilog semantics)
(===* X Y)4vec-===*modified case equality (x-monotonic if y is constant)
(==? X Y)4vec-wildeqwildcard equality (scary verilog semantics)
(SAFER-==? X Y)4vec-wildeq-safewildcard equality (X-monotonic version)
(==?? X Y)4vec-symwildeqwildcard equality for casez
(CLOG2 X)4vec-clog2ceiling of log2
(POW X Y)4vec-powexponentiation
(? TEST THEN ELSE)4vec-?if-then-else
(?* TEST THEN ELSE)4vec-?*if-then-else (for statements)
(BIT? TEST THEN ELSE)4vec-bit?bitwise if-then-else
(BIT?! TEST THEN ELSE)4vec-bit?!bitwise if-then-else, only chooses then[i] when test[i]===1
(?! TEST THEN ELSE)4vec-?!procedural if-then-else, only chooses then when test has a definite 1 bit
(PARTSEL LSB WIDTH IN)4vec-part-selectpart select
(PARTINST LSB WIDTH IN VAL)4vec-part-installpart install

Subtopics

4vec-operations
Core operations on 4vecs.
3vec-operations
Core operations on 3vecs.
*svex-op-table*
Raw table about the known svex functions.