• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Vwsim
      • Fgl
      • Vl
        • Syntax
          • Vl-module
          • Vl-vardecl
          • Vl-fundecl
          • Vl-interface
          • Vl-design
          • Vl-assign
          • Vl-modinst
          • Vl-gateinst
          • Vl-taskdecl
          • Vl-portdecl
          • Vl-commentmap
          • Vl-dpiimport
          • Vl-ansi-portdecl
          • Vl-package
          • Vl-paramdecl
          • Vl-dpiexport
          • Vl-plainarglist->exprs
          • Vl-class
          • Vl-taskdecllist->names
          • Vl-sort-blockitems-aux
          • Vl-fundecllist->names
          • Expressions-and-datatypes
            • Vl-atts
            • Vl-expr
            • Vl-datatype
            • New-expression-representation
            • Vl-paramargs
            • Vl-evatom
            • Vl-maybe-paramargs
            • Vl-evatomlist
            • Vl-call-namedargs
            • Vl-paramvaluelist
            • Vl-namedparamvaluelist
          • Vl-udp
          • Vl-port
          • Vl-genelement
          • Vl-clkdecl
          • Vl-parse-temps
          • Vl-bind
          • Vl-namedarg
          • Vl-exprdist
          • Vl-clkassign
          • Vl-range
          • Vl-propport
          • Vl-typedef
          • Vl-gatedelay
          • Vl-dimension
          • Vl-sequence
          • Vl-clkskew
          • Vl-program
          • Vl-gatestrength
          • Vl-property
          • Vl-config
          • Vl-always
          • Vl-import
          • Vl-repeateventcontrol
          • Vl-timeliteral
          • Vl-initial
          • Vl-eventcontrol
          • Vl-udpsymbol-p
          • Vl-final
          • Vl-maybe-clkskew
          • Vl-alias
          • Vl-maybe-nettypename
          • Vl-maybe-gatedelay
          • Vl-letdecl
          • Vl-direction-p
          • Vl-modelement
          • Vl-maybe-timeprecisiondecl
          • Vl-maybe-scopeid
          • Vl-maybe-gatestrength
          • Vl-maybe-direction
          • Vl-maybe-delayoreventcontrol
          • Vl-gclkdecl
          • Vl-fwdtypedef
          • Vl-maybe-udpsymbol-p
          • Vl-maybe-timeunitdecl
          • Vl-maybe-timeliteral
          • Vl-maybe-parse-temps
          • Vl-maybe-cstrength
          • Vl-arguments
          • Vl-maybe-module
          • Vl-maybe-design
          • Vl-covergroup
          • Vl-udpline
          • Vl-timeunitdecl
          • Vl-genvar
          • Vl-defaultdisable
          • Vl-context1
          • Vl-timeprecisiondecl
          • Vl-sort-blockitems
          • Vl-elabtask
          • Vl-udpedge
          • Vl-delaycontrol
          • Vl-context
          • Vl-modelement->loc
          • Vl-ctxelement
          • Vl-ctxelement->loc
          • Statements
          • Vl-interface->ifports
          • Vl-blockitem
          • Vl-vardecllist
          • Vl-module->ifports
          • Vl-lifetime-p
          • Vl-syntaxversion
          • Vl-nettypename-p
          • Vl-paramdecllist
          • Vl-modelementlist->genelements
          • Vl-importlist
          • Vl-gatetype-p
          • Vl-typedeflist
          • Vl-genelement->loc
          • Vl-cstrength-p
          • Vl-port->name
          • Vl-elabtask->loc
          • Vl-delayoreventcontrol
          • Vl-udpentry-p
          • Vl-portdecllist
          • Vl-port->loc
          • Property-expressions
          • Vl-taskdecllist
          • Vl-fundecllist
          • Vl-sequencelist
          • Vl-propertylist
          • Vl-portlist
          • Vl-dpiimportlist
          • Vl-dpiexportlist
          • Vl-classlist
          • Vl-arguments->args
          • Vl-alwaystype-p
          • Vl-modinstlist
          • Vl-importpart-p
          • Vl-importpart-fix
          • Vl-blockstmt-p
          • Vl-bindlist
          • Vl-initiallist
          • Vl-genvarlist
          • Vl-gclkdecllist
          • Vl-finallist
          • Vl-elabtasklist
          • Vl-defaultdisablelist
          • Vl-clkdecllist
          • Vl-cassertionlist
          • Vl-assignlist
          • Vl-assertionlist
          • Vl-alwayslist
          • Vl-aliaslist
          • Vl-udptable
          • Vl-udplist
          • Vl-udpentrylist
          • Vl-propportlist
          • Vl-programlist
          • Vl-packagelist
          • Vl-namedarglist
          • Vl-modulelist
          • Vl-modportlist
          • Vl-modport-portlist
          • Vl-letdecllist
          • Vl-interfacelist
          • Vl-gateinstlist
          • Vl-fwdtypedeflist
          • Vl-covergrouplist
          • Vl-configlist
          • Vl-clkassignlist
          • Vl-casekey-p
          • Vl-blockitemlist
          • Vl-ansi-portdecllist
          • Vl-regularportlist
          • Vl-paramdecllist-list
          • Vl-modelementlist
          • Vl-interfaceportlist
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
        • Transforms
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Testing-utilities
    • Math
  • Syntax

Expressions-and-datatypes

Representation of expressions, datatypes, and other related, mutually recursive concepts.

SystemVerilog has a very rich expression language. For instance:

  • It has many kinds of literals, including integer literals that can be sized and unsized, ``weird'' integers like 4'10xz, infinitely extended integers like '0, reals, times, strings, etc. See vl-literal.
  • It has a rich operand syntax that allows for scoping, indexing into the module hierarchy and structures, and for many kinds of bit/range selects into wires, arrays, etc. See vl-index.
  • It has many familiar C-like operators (+, &, etc.) and numerous extended C-like operators (===, !=?, >>>, etc.) See vl-unary, vl-binary, and vl-qmark.
  • It has certain casting and function call operators that allow for the use of datatypes directly in expressions, which makes expressions and datatypes mutually recursive concepts.
  • It has several esoteric operators like inside and the streaming operators, which have their own sub-syntax of sorts.
  • It has nested attributes like (* foo, bar = 5 *) that can be attached to almost any expression as annotations for tools. See vl-atts.

These expressions occur pretty much everywhere throughout a SystemVerilog design—ports, parameters, assignments, instances, statements, you name it. This complexity and frequency of usage makes a good representation of expressions especially important.

A major differences between vl2014 and vl is that VL uses a new, more mutually recursive, and more strongly typed expression representation. See new-expression-representation for some discussion about the motivation for this change.

Note that there are many useful functions for working with expressions in mlib. See most especially expr-tools which contains many basic functions.

Subtopics

Vl-atts
Representation of (* foo = 3, bar *) style attributes.
Vl-expr
Representation of a single SystemVerilog expression.
Vl-datatype
Representation of a SystemVerilog variable datatype, e.g., logic [7:0][3:0], string, mystruct_t [3:0], etc.
New-expression-representation
Notes about the new expression representation in vl, and how and why it diverges from the vl2014::expressions.
Vl-paramargs
Representation of the values to use for a module instance's parameters (not ports).
Vl-evatom
A single item in an event control list.
Vl-maybe-paramargs
Option type; vl-paramargs or nil.
Vl-evatomlist
A list of vl-evatom-p objects.
Vl-call-namedargs
Representation of any named arguments of a function call.
Vl-paramvaluelist
A list of vl-paramvalue-p objects.
Vl-namedparamvaluelist
A list of vl-namedparamvalue-p objects.