• 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
              • Vl-blockstmt
                • Make-vl-blockstmt
                • Vl-blockstmt->paramdecls
                • Vl-blockstmt->loaditems
                • Vl-blockstmt->vardecls
                • Vl-blockstmt->typedefs
                • Vl-blockstmt->imports
                • Vl-blockstmt->blocktype
                • Change-vl-blockstmt
                • Vl-blockstmt->stmts
                • Vl-blockstmt->name
                • Vl-blockstmt->atts
                • Vl-blocktype-p
              • 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-blockstmt

Representation of begin/end and fork/join blocks.

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

Fields
blocktype — vl-blocktype-p
Kind of block statement—begin/end, fork/join, etc.
stmts — vl-stmtlist
name — maybe-string
E.g., foo in foo : begin ... end or in begin : foo ... end, if applicable.
atts — vl-atts
Any (* foo, bar = 1*) style attributes associated with this statement.
vardecls — vl-vardecllist
paramdecls — vl-paramdecllist
typedefs — vl-typedeflist
imports — vl-importlist
loaditems — vl-blockitemlist
Block items for this block in parse order, before splitting out into typed lists. Should not be used except in shadowcheck.

General Form (from Verilog-2005)

begin [ : <name> <declarations> ]
  <statements>
end

fork [ : <name> <declarations> ]
  <statements>
join

See Section 9.8. The difference between the two kinds of blocks is that in a begin/end block, statements are to be executed in order, whereas in a fork/join block, statements are executed simultaneously.

A further remark is that "Block names give a means of uniquely identifying all variables at any simulation time." This seems to suggest that one might try to flatten all of the declarations in a module by, e.g., prepending the block name to each variable name.

With regards to declarations: "All variables shall be static; that is, a unique location exists for all variables, and leaving or entering blocks shall not affect the values stored in them."

SystemVerilog-2012 Extensions

In Verilog-2005 only blocks that are named can have local declarations. SystemVerilog drops this restriction and allows declarations even in unnamed blocks.

SystemVerilog also allows the label to occur before the begin or fork keyword, and, more generally, allows labels to be added to other kinds of statements. For instance, you can write:

update_foo: foo = foo + bar;

We turn labels like this into named begin/end blocks that surround their statement.

Note that it's not legal to label a block both before and after the begin keyword. See SystemVerilog-2012 Section 9.3.5, Statement Labels, on page 178.

SystemVerilog also adds different kinds of join keywords, which we now represent as part of the block's type.

Subtopics

Make-vl-blockstmt
Basic constructor macro for vl-blockstmt structures.
Vl-blockstmt->paramdecls
Get the paramdecls field from a vl-blockstmt.
Vl-blockstmt->loaditems
Get the loaditems field from a vl-blockstmt.
Vl-blockstmt->vardecls
Get the vardecls field from a vl-blockstmt.
Vl-blockstmt->typedefs
Get the typedefs field from a vl-blockstmt.
Vl-blockstmt->imports
Get the imports field from a vl-blockstmt.
Vl-blockstmt->blocktype
Get the blocktype field from a vl-blockstmt.
Change-vl-blockstmt
Modifying constructor for vl-blockstmt structures.
Vl-blockstmt->stmts
Get the stmts field from a vl-blockstmt.
Vl-blockstmt->name
Get the name field from a vl-blockstmt.
Vl-blockstmt->atts
Get the atts field from a vl-blockstmt.
Vl-blocktype-p
Indicates whether this is a begin/end, fork/join, fork/join_any, or fork/join_none statement.