• 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
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
          • Scopestack
          • Hid-tools
          • Filtering-by-name
          • Vl-interface-mocktype
          • Stripping-functions
          • Genblob
          • Expr-tools
          • Extract-vl-types
          • Hierarchy
          • Range-tools
          • Finding-by-name
          • Stmt-tools
          • Modnamespace
          • Flat-warnings
          • Reordering-by-name
          • Datatype-tools
          • Syscalls
          • Allexprs
          • Lvalues
            • Lvaluecheck
              • Vl-modulelist-lvaluecheck
              • Vl-plainarglist-lvaluecheck
              • Vl-modelement-lvaluecheck
              • Vl-plainarg-lvaluecheck
                • Vl-arguments-lvaluecheck
                • Vl-function-specialization-map-lvaluecheck
                • Vl-module-lvaluecheck-aux
                • Vl-function-specialization-lvaluecheck
                • Vl-maybe-parse-temps-lvaluecheck
                • Vl-taskdecllist-lvaluecheck
                • Vl-modinstlist-lvaluecheck
                • Vl-initiallist-lvaluecheck
                • Vl-gateinstlist-lvaluecheck
                • Vl-fundecllist-lvaluecheck
                • Vl-elabtasklist-lvaluecheck
                • Vl-cassertionlist-lvaluecheck
                • Vl-assertionlist-lvaluecheck
                • Vl-assignlist-lvaluecheck
                • Vl-alwayslist-lvaluecheck
                • Vl-parse-temps-lvaluecheck
                • Vl-finallist-lvaluecheck
                • Vl-classlist-lvaluecheck
                • Vl-bindlist-lvaluecheck
                • Vl-taskdecl-lvaluecheck
                • Vl-initial-lvaluecheck
                • Vl-fundecl-lvaluecheck
                • Vl-elabtask-lvaluecheck
                • Vl-class-lvaluecheck
                • Vl-always-lvaluecheck
                • Vl-modinst-lvaluecheck
                • Vl-gateinst-lvaluecheck
                • Vl-final-lvaluecheck
                • Vl-bind-lvaluecheck
                • Vl-assign-lvaluecheck
                • Vl-module-lvaluecheck
                • Vl-design-lvaluecheck
              • Vl-expr-variable-lvalue-p
              • Vl-expr-net-lvalue-p
            • Port-tools
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Lvaluecheck

    Vl-plainarg-lvaluecheck

    Signature
    (vl-plainarg-lvaluecheck x loc instname warnings) → warnings
    Arguments
    x — Guard (vl-plainarg-p x).
    loc — Guard (vl-location-p loc).
    instname — Guard (maybe-stringp instname).
    warnings — Guard (vl-warninglist-p warnings).
    Returns
    warnings — Type (vl-warninglist-p warnings).

    Definitions and Theorems

    Function: vl-plainarg-lvaluecheck

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

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

    (defthm vl-warninglist-p-of-vl-plainarg-lvaluecheck
      (b* ((warnings (vl-plainarg-lvaluecheck x loc instname warnings)))
        (vl-warninglist-p 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-location-fix-loc

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

    Theorem: vl-plainarg-lvaluecheck-vl-location-equiv-congruence-on-loc

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

    Theorem: vl-plainarg-lvaluecheck-of-maybe-string-fix-instname

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

    Theorem: vl-plainarg-lvaluecheck-maybe-string-equiv-congruence-on-instname

    (defthm
      vl-plainarg-lvaluecheck-maybe-string-equiv-congruence-on-instname
     (implies
        (maybe-string-equiv instname instname-equiv)
        (equal (vl-plainarg-lvaluecheck x loc instname warnings)
               (vl-plainarg-lvaluecheck x loc instname-equiv 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)