• 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-arguments-p
              • Vl-plainarg
                • Vl-plainarg-p
                  • Vl-plainarg-lvaluecheck
                  • Vl-plainarg-fix
                  • Vl-plainarg-equiv
                  • Make-vl-plainarg
                  • Vl-plainarg->portname
                  • Vl-plainarg->expr
                  • Vl-plainarg->dir
                  • Change-vl-plainarg
                  • Vl-plainarg->atts
                • Vl-arguments-lvaluecheck
                • Vl-plainarglist
                • Vl-plainarglistlist
                • Vl-jp-arguments
              • Vl-arguments-fix
              • Vl-arguments-case
              • Vl-arguments-equiv
              • Vl-arguments-named
              • Vl-arguments-plain
              • Vl-arguments-kind
            • 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
          • 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
    • Vl-plainarg-p
    • Lvaluecheck

    Vl-plainarg-lvaluecheck

    Check well-formedness of lvalues in a vl-plainarg-p.

    Signature
    (vl-plainarg-lvaluecheck x loc instname warnings) 
      → 
    new-warnings
    Arguments
    x — Guard (vl-plainarg-p x).
    warnings — Ordinary warnings accumulator.
        Guard (vl-warninglist-p warnings).
    Returns
    new-warnings — Type (vl-warninglist-p new-warnings).

    We check the lvalues throughout x for well-formedness in the sense of vl-expr-lvaluep, and generate non-fatal warnings for any problematic lvalues encountered.

    Definitions and Theorems

    Function: vl-plainarg-lvaluecheck

    (defun vl-plainarg-lvaluecheck (x loc instname warnings)
     (declare (xargs :guard (and (vl-plainarg-p x)
                                 (vl-warninglist-p warnings))))
     (declare (xargs :guard (and (vl-location-p loc)
                                 (maybe-stringp instname))))
     (let ((__function__ 'vl-plainarg-lvaluecheck))
      (declare (ignorable __function__))
      (b* ((dir (vl-plainarg->dir x))
           (expr (vl-plainarg->expr x))
           ((unless expr) (ok))
           ((unless dir) (ok))
           ((when (eq dir :vl-input)) (ok))
           ((when (vl-expr-lvaluep expr)) (ok)))
       (warn
        :type :vl-bad-lvalue
        :msg
        "~l0: expression for ~s1 port ~s2 of instance ~w3 is not a ~
                    valid lvalue: ~a4.~%"
        :args (list loc
                    (if (eq dir :vl-inout) "inout" "output")
                    (vl-plainarg->portname x)
                    instname expr)))))

    Theorem: vl-warninglist-p-of-vl-plainarg-lvaluecheck

    (defthm vl-warninglist-p-of-vl-plainarg-lvaluecheck
     (b*
      ((new-warnings (vl-plainarg-lvaluecheck x loc instname warnings)))
      (vl-warninglist-p new-warnings))
     :rule-classes :rewrite)

    Theorem: vl-plainarg-lvaluecheck-of-vl-plainarg-fix-x

    (defthm vl-plainarg-lvaluecheck-of-vl-plainarg-fix-x
      (equal (vl-plainarg-lvaluecheck (vl-plainarg-fix x)
                                      loc instname warnings)
             (vl-plainarg-lvaluecheck x loc instname warnings)))

    Theorem: vl-plainarg-lvaluecheck-vl-plainarg-equiv-congruence-on-x

    (defthm vl-plainarg-lvaluecheck-vl-plainarg-equiv-congruence-on-x
     (implies
        (vl-plainarg-equiv x x-equiv)
        (equal (vl-plainarg-lvaluecheck x loc instname warnings)
               (vl-plainarg-lvaluecheck x-equiv loc instname warnings)))
     :rule-classes :congruence)

    Theorem: vl-plainarg-lvaluecheck-of-vl-warninglist-fix-warnings

    (defthm vl-plainarg-lvaluecheck-of-vl-warninglist-fix-warnings
     (equal
        (vl-plainarg-lvaluecheck x loc
                                 instname (vl-warninglist-fix warnings))
        (vl-plainarg-lvaluecheck x loc instname warnings)))

    Theorem: vl-plainarg-lvaluecheck-vl-warninglist-equiv-congruence-on-warnings

    (defthm
     vl-plainarg-lvaluecheck-vl-warninglist-equiv-congruence-on-warnings
     (implies
        (vl-warninglist-equiv warnings warnings-equiv)
        (equal (vl-plainarg-lvaluecheck x loc instname warnings)
               (vl-plainarg-lvaluecheck x loc instname warnings-equiv)))
     :rule-classes :congruence)