• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • 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-class
          • Vl-sort-blockitems-aux
          • Vl-plainarglist->exprs
          • Vl-taskdecllist->names
          • Expressions-and-datatypes
          • Vl-fundecllist->names
          • 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-final
          • Vl-udpsymbol-p
          • Vl-maybe-clkskew
          • Vl-function-specialization
          • 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-ctxelement
          • Vl-ctxelement->loc
          • Vl-modelement->loc
          • Statements
            • Vl-stmt
              • Vl-assignstmt
                • Make-vl-assignstmt
                • Vl-assignstmt->ctrl
                • Vl-assignstmt->lvalue
                • Vl-assignstmt->type
                • Vl-assignstmt->rhs
                • Vl-assignstmt->loc
                • Vl-assignstmt->atts
                • Change-vl-assignstmt
                • Vl-assign-type-p
              • Vl-blockstmt
              • Vl-stmt-p
              • Vl-casestmt
              • Vl-forstmt
              • Vl-foreachstmt
              • Vl-callstmt
              • Vl-stmt-case
              • Vl-waitstmt
              • Vl-repeatstmt
              • Vl-whilestmt
              • Vl-assertstmt
              • Vl-ifstmt
              • Vl-eventtriggerstmt
              • Vl-timingstmt
              • Vl-dostmt
              • Vl-deassignstmt
              • Vl-cassertstmt
              • Vl-nullstmt
              • Vl-stmt-kind
              • Vl-returnstmt
              • Vl-foreverstmt
              • Vl-disablestmt
              • Vl-stmt-equiv
              • Vl-continuestmt
              • Vl-breakstmt
              • Vl-stmt-fix
              • Vl-stmt-count
            • Vl-cassertion
            • Vl-assertion
            • Vl-stmtlist
            • Vl-caselist
          • Vl-blockitem
          • Vl-vardecllist
          • Vl-interface->ifports
          • Vl-syntaxversion
          • Vl-nettypename-p
          • Vl-module->ifports
          • Vl-lifetime-p
          • Vl-paramdecllist
          • Vl-modelementlist->genelements
          • Vl-importlist
          • Vl-typedeflist
          • Vl-gatetype-p
          • Vl-cstrength-p
          • Vl-port->name
          • Vl-genelement->loc
          • Vl-delayoreventcontrol
          • Vl-udpentry-p
          • Vl-portdecllist
          • Vl-elabtask->loc
          • Property-expressions
          • Vl-taskdecllist
          • Vl-port->loc
          • 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-bindlist
          • Vl-initiallist
          • Vl-genvarlist
          • Vl-gclkdecllist
          • Vl-function-specialization-map
          • Vl-finallist
          • Vl-elabtasklist
          • Vl-defaultdisablelist
          • Vl-clkdecllist
          • Vl-cassertionlist
          • Vl-blockstmt-p
          • 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-blockitemlist
          • Vl-ansi-portdecllist
          • Vl-regularportlist
          • Vl-paramdecllist-list
          • Vl-modelementlist
          • Vl-interfaceportlist
          • Vl-casekey-p
          • Sv::maybe-4veclist
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
        • Transforms
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Vl-stmt

Vl-assignstmt

Representation of an assignment statement.

This is a product type, introduced by deftagsum in support of vl-stmt.

Fields
type — vl-assign-type-p
Kind of assignment statement, e.g., blocking, nonblocking, etc.
lvalue — vl-expr
Location being assigned to. Note that the Verilog-2005 standard places various restrictions on lvalues, e.g., for a procedural assignment the lvalue may contain only plain variables, and bit-selects, part-selects, memory words, and nested concatenations of these things. We do not enforce these restrictions in vl-assignstmt-p, but only require that the lvalue is an expression.
rhs — vl-rhs
The right-hand side expression that should be assigned to the lvalue.
loc — vl-location
Where the statement was found in the source code.
ctrl — vl-maybe-delayoreventcontrol
Control that affects when the assignment is done, if any. These controls can be a delay like #(6) or an event control like @(posedge clk). The rules for this are covered in Section 9.2 and appear to perhaps be different depending upon the type of assignment. Further coverage seems to be available in Section 9.7.7.
atts — vl-atts
Any (* foo, bar = 1*) style attributes associated with this statement.

Assignment statements are covered in Section 9.2. There are two major types of assignment statements.

Procedural Assignments

Procedural assignment statements may only be used to assign to reg, integer, time, realtime, and memory data types, and cannot be used to assign to ordinary nets such as wires. There are two kinds of procedural assignments:

foo = bar ;     // "blocking" -- do the assignment now
foo <= bar ;    // "nonblocking" -- schedule the assignment to occur

The difference between these two statements has to do with Verilog's timing model and simulation semantics. In particular, a blocking assignment "executes before the statements that follow it," whereas a non-blocking assignment only "schedules" an assignment to occur and can be thought of as executing in parallel with what follows it.

Continuous Procedural Assignments

Continuous procedural assignment statements may apparently be used to assign to either nets or variables. There are two kinds:

assign foo = bar ;  // only for variables
force foo = bar ;   // for variables or nets

We represent all of these kinds of assignment statements uniformly as vl-assignstmt-p objects.

SystemVerilog Extensions

SystemVerilog-2012 implements special additional assignment operators such as a += b. Per Section 11.4 of SystemVerilog-2012, these operators are semantically equivalent to blocking assignment statements except that in the case of index expressions such as a[i] += b, the index i is only evaluated once. VL's parser converts assignments such as a += b into blocking assignments such as a = a + b. To note that this was a += style assignment, the parser adds a VL_FANCY_ASSIGNMENT_OPERATOR attribute to the assignstmt.

SystemVerilog also adds increment and decrement operators, i.e., a++ and a--. These operators, per Section 11.4.2 of SystemVerilog-2012, also "behave as blocking assignments."

Subtopics

Make-vl-assignstmt
Basic constructor macro for vl-assignstmt structures.
Vl-assignstmt->ctrl
Get the ctrl field from a vl-assignstmt.
Vl-assignstmt->lvalue
Get the lvalue field from a vl-assignstmt.
Vl-assignstmt->type
Get the type field from a vl-assignstmt.
Vl-assignstmt->rhs
Get the rhs field from a vl-assignstmt.
Vl-assignstmt->loc
Get the loc field from a vl-assignstmt.
Vl-assignstmt->atts
Get the atts field from a vl-assignstmt.
Change-vl-assignstmt
Modifying constructor for vl-assignstmt structures.
Vl-assign-type-p
Type of an assignment statement.