• 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
          • Vl-module
          • Vl-vardecl
          • Expressions
          • Vl-fundecl
          • Vl-assign
          • Vl-gateinst
          • Vl-modinst
          • Vl-commentmap
          • Vl-portdecl
          • Vl-taskdecl
          • Vl-design
          • Vl-interface
          • Vl-plainarglist->exprs
          • Vl-taskdecllist->names
          • Vl-fundecllist->names
          • Vl-package
          • Vl-port
          • Vl-udp
          • Vl-paramdecl
          • Vl-genelement
          • Vl-cycledelayrange
          • Vl-namedarg
          • Vl-sort-blockitems-aux
          • Vl-distitem
          • Vl-gatedelay
          • Vl-repetition
          • Vl-typedef
          • Vl-range
          • Vl-gatestrength
          • Vl-program
          • Vl-config
          • Vl-always
          • Vl-datatype-update-dims
          • Vl-import
          • Vl-enumbasetype
          • Vl-repeateventcontrol
          • Vl-paramargs
          • Vl-initial
          • Vl-eventcontrol
          • Vl-udpsymbol-p
          • Vl-maybe-range
          • Vl-maybe-nettypename
          • Vl-maybe-gatestrength
          • Vl-maybe-gatedelay
          • Vl-maybe-delayoreventcontrol
          • Vl-alias
          • Maybe-string-fix
          • Vl-maybe-packeddimension
          • Vl-fwdtypedef
          • Vl-evatom
          • Vl-packeddimension-p
          • Vl-maybe-udpsymbol
          • Vl-maybe-module
          • Vl-maybe-direction
          • Vl-maybe-datatype
          • Vl-maybe-cstrength
          • Vl-direction-p
          • Vl-arguments
          • Vl-maybe-design
          • Vl-udpline
          • Vl-exprdist
          • Vl-context1
          • Vl-genvar
          • Vl-enumitem
          • Vl-datatype-update-udims
          • Vl-datatype-update-pdims
          • Vl-modelement
          • Vl-udpedge
          • Vl-delaycontrol
          • Vl-context
          • Vl-sort-blockitems
          • Vl-distweighttype-p
          • Vl-ctxelement->loc
          • Vl-blockitem
          • Vl-vardecllist
          • Vl-module->ifports
          • Vl-modelement->loc
          • Vl-ctxelement
          • Vl-coretypename-p
          • Vl-packeddimensionlist
          • Vl-modelementlist->genelements
          • Vl-gatetype-p
          • Vl-paramdecllist
          • Vl-lifetime-p
          • Vl-datatype->udims
          • Vl-datatype->pdims
          • Vl-timeunit-p
          • Vl-repetitiontype-p
          • Vl-port->name
          • Vl-importlist
          • Vl-genelement->loc
          • Vl-delayoreventcontrol
          • Vl-cstrength-p
          • Statements
          • Vl-udpentry-p
          • Vl-packeddimension-fix
          • Vl-nettypename-p
          • Vl-portdecllist
          • Vl-port->loc
          • Vl-enumbasekind-fix
          • Vl-arguments->args
          • Vl-taskdecllist
          • Vl-portlist
          • Vl-importpart-p
          • Vl-importpart-fix
          • Vl-fundecllist
          • Vl-blockstmt-p
          • Vl-assignlist
          • Vl-alwaystype-p
          • Vl-typedeflist
          • Vl-syntaxversion-p
          • Vl-randomqualifier-p
          • Vl-modinstlist
          • Vl-gateinstlist
          • Vl-blockitemlist
          • Vl-udptable
          • Vl-udplist
          • Vl-udpentrylist
          • Vl-programlist
          • Vl-paramvaluelist
          • Vl-packagelist
          • Vl-namedparamvaluelist
          • Vl-namedarglist
          • Vl-modulelist
          • Vl-modportlist
          • Vl-modport-portlist
          • Vl-interfacelist
          • Vl-initiallist
          • Vl-genvarlist
          • Vl-fwdtypedeflist
          • Vl-evatomlist
          • Vl-enumitemlist
          • Vl-distlist
          • Vl-configlist
          • Vl-alwayslist
          • Vl-aliaslist
          • Vl-regularportlist
          • Vl-rangelist-list
          • Vl-rangelist
          • Vl-paramdecllist-list
          • Vl-modelementlist
          • Vl-maybe-range-list
          • Vl-interfaceportlist
          • Vl-argumentlist
          • Data-types
            • Vl-structmember
              • Vl-structmember-equiv
              • Make-vl-structmember
              • Vl-structmember->type
              • Vl-structmember->rand
              • Change-vl-structmember
              • Vl-structmember->rhs
              • Vl-structmember->name
              • Vl-structmember->atts
              • Vl-structmember-p
              • Vl-structmember-fix
              • Vl-structmember-count
            • Vl-datatype
            • Vl-structmemberlist
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
        • Mlib
        • Server
        • Kit
        • Printer
        • Esim-vl
        • Well-formedness
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Data-types

Vl-structmember

A single member of a struct or union.

This is a product type introduced by defprod.

Fields
atts — vl-atts
rand — vl-randomqualifier-p
type — vl-datatype
name — stringp
rhs — vl-maybe-expr

Currently our structure members are very limited. In the long run we may want to support more of the SystemVerilog grammar. It allows a list of variable declaration assignments, which can have fancy dimensions and different kinds of new operators.

Notes for the future:

variable_decl_assignment ::=
      variable_identifier { variable_dimension } [ '=' expression ]
    | dynamic_array_variable_identifier unsized_dimension { variable_dimension } [ '=' dynamic_array_new ]
    | class_variable_identifier [ '=' class_new ]

These fancy _identifiers are all just identifiers. So really this is:

variable_decl_assignment ::=
    identifier { variable_dimension }                   [ '=' expression ]
  | identifier unsized_dimension { variable_dimension } [ '=' dynamic_array_new ]
  | identifier                                          [ '=' class_new ]

The new keyword can occur in a variety of places. One of these is related to defining constructors for classes, e.g., in class constructor prototypes/declarations we can have things like

function ... new (...) ...

And super.new(...) and so on. But for now let's think of these as separate cases; that is, our approach to new in other contexts doesn't necessarily need to have anything to do with these constructors, which we might instead handle more explicitly.

The other places where new can occur are in:

dynamic_array_new ::= new '[' expression ']' [ '(' expression ')' ]

class_new ::= [ class_scope ] 'new' [ '(' list_of_arguments ')' ]
            | 'new' expression

Which in turn can occur in blocking assignments:

   [some fancy lhs] = dynamic_array_new
or [some other fancy lhs] = class_new
or other things not involving new

(Which is interesting because we also have to support a lot of other new kinds of assignments like += and *=, so maybe this could become a new= kind of assignment or something.)

And they can also occur in variable decl assignments:

    simple id [ = expression ]
or  some fancy lhs with some various dimensions [= dynamic_array_new]
or  some simple lhs [= class_new]

Which can occur in:

  • SVA assertion variable declarations
  • Data declarations (e.g., top-level const suchandso = new ...
  • Structure members in structs and unions.

So maybe we don't so much need these to be expressions. Maybe we can get away with them as alternate kinds of assignments.

Subtopics

Vl-structmember-equiv
Basic equivalence relation for vl-structmember structures.
Make-vl-structmember
Basic constructor macro for vl-structmember structures.
Vl-structmember->type
Get the type field from a vl-structmember.
Vl-structmember->rand
Get the rand field from a vl-structmember.
Change-vl-structmember
Modifying constructor for vl-structmember structures.
Vl-structmember->rhs
Get the rhs field from a vl-structmember.
Vl-structmember->name
Get the name field from a vl-structmember.
Vl-structmember->atts
Get the atts field from a vl-structmember.
Vl-structmember-p
Recognizer for vl-structmember structures.
Vl-structmember-fix
Fixing function for vl-structmember structures.
Vl-structmember-count
Measure for recurring over vl-structmember structures.