• 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
        • Transforms
          • Unparameterization
          • Elaborate
          • Addnames
          • Annotate
            • Increment-elim
            • Make-implicit-wires
            • Basic-bind-elim
            • Argresolve
              • Vl-convert-namedargs
              • Vl-unhierarchicalize-interfaceport
              • Vl-interfacelist-argresolve
              • Vl-modulelist-argresolve
              • Vl-gateinst-dirassign
              • Vl-arguments-argresolve
                • Vl-unhierarchicalize-interfaceports
                • Vl-check-blankargs
                • Vl-annotate-plainargs
                • Vl-modinst-maybe-argresolve
                • Vl-modinst-argresolve
                • Vl-modinstlist-argresolve
                • Vl-gateinstlist-dirassign
                • Vl-interface-argresolve
                • Vl-module-argresolve
                • Vl-namedarglist-alist
                • Vl-make-namedarg-alist
                • Vl-design-argresolve
                • Vl-fast-find-namedarg
                • Vl-namedarg-alist
                • Vl-scopeitem-modport-p
                • Vl-scopeitem-modinst-p
                • Vl-scopeitem-interfaceport-p
                • Vl-port-interface-p
              • Basicsanity
              • Portdecl-sign
              • Enum-names
              • Port-resolve
              • Udp-elim
              • Vl-annotate-design
              • Vl-annotate-module
            • Clean-warnings
            • Eliminitial
            • Custom-transform-hooks
            • Problem-modules
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Argresolve

    Vl-arguments-argresolve

    Apply the argresolve transformation to some arguments.

    Signature
    (vl-arguments-argresolve x ss ports scope warnings inst) 
      → 
    (mv warnings new-x)
    Arguments
    x — arguments of a module instance, named or plain.
        Guard (vl-arguments-p x).
    ss — Guard (vl-scopestack-p ss).
    ports — ports of the submodule.
        Guard (vl-portlist-p ports).
    scope — instantiated module or interface.
        Guard (vl-scope-p scope).
    warnings — warnings accumulator.
        Guard (vl-warninglist-p warnings).
    inst — just a context for error messages.
        Guard (vl-modinst-p inst).
    Returns
    warnings — Type (vl-warninglist-p warnings).
    new-x — Type (vl-arguments-p new-x).

    This wrapper is really the heart of the argresolve transform. We convert x into a plain argument list, do basic arity/blank checking, and add direction/name annotations.

    Definitions and Theorems

    Function: vl-arguments-argresolve

    (defun vl-arguments-argresolve (x ss ports scope warnings inst)
     (declare (xargs :guard (and (vl-arguments-p x)
                                 (vl-scopestack-p ss)
                                 (vl-portlist-p ports)
                                 (vl-scope-p scope)
                                 (vl-warninglist-p warnings)
                                 (vl-modinst-p inst))))
     (let ((__function__ 'vl-arguments-argresolve))
      (declare (ignorable __function__))
      (b*
       (((mv successp warnings x)
         (vl-convert-namedargs x ss ports warnings inst))
        ((unless successp) (mv (ok) x))
        (inst (vl-modinst-fix inst))
        (plainargs (vl-arguments-plain->args x))
        ((unless (same-lengthp plainargs ports))
         (b* ((nports (len ports))
              (nargs (len plainargs)))
          (mv (fatal :type :vl-instance-wrong-arity
                     :msg "~a0 ~s1 ~x2 ~s3, but module ~m4 ~s5 ~x6 ~s7."
                     :args (list inst
                                 (if (< nargs nports) "only has" "has")
                                 nargs
                                 (if (= nargs 1) "argument" "arguments")
                                 (vl-modinst->modname inst)
                                 (if (< nargs nports) "has" "only has")
                                 nports
                                 (if (= nports 1) "port" "ports")))
              x)))
        (plainargs (vl-annotate-plainargs plainargs ports scope))
        (warnings (vl-check-blankargs plainargs ports inst warnings))
        ((mv warnings plainargs)
         (vl-unhierarchicalize-interfaceports
              plainargs ports ss inst warnings))
        (new-x (make-vl-arguments-plain :args plainargs)))
       (mv (ok) new-x))))

    Theorem: vl-warninglist-p-of-vl-arguments-argresolve.warnings

    (defthm vl-warninglist-p-of-vl-arguments-argresolve.warnings
      (b* (((mv ?warnings ?new-x)
            (vl-arguments-argresolve x ss ports scope warnings inst)))
        (vl-warninglist-p warnings))
      :rule-classes :rewrite)

    Theorem: vl-arguments-p-of-vl-arguments-argresolve.new-x

    (defthm vl-arguments-p-of-vl-arguments-argresolve.new-x
      (b* (((mv ?warnings ?new-x)
            (vl-arguments-argresolve x ss ports scope warnings inst)))
        (vl-arguments-p new-x))
      :rule-classes :rewrite)

    Theorem: vl-arguments-argresolve-of-vl-arguments-fix-x

    (defthm vl-arguments-argresolve-of-vl-arguments-fix-x
      (equal (vl-arguments-argresolve (vl-arguments-fix x)
                                      ss ports scope warnings inst)
             (vl-arguments-argresolve x ss ports scope warnings inst)))

    Theorem: vl-arguments-argresolve-vl-arguments-equiv-congruence-on-x

    (defthm vl-arguments-argresolve-vl-arguments-equiv-congruence-on-x
     (implies
      (vl-arguments-equiv x x-equiv)
      (equal
        (vl-arguments-argresolve x ss ports scope warnings inst)
        (vl-arguments-argresolve x-equiv ss ports scope warnings inst)))
     :rule-classes :congruence)

    Theorem: vl-arguments-argresolve-of-vl-scopestack-fix-ss

    (defthm vl-arguments-argresolve-of-vl-scopestack-fix-ss
      (equal (vl-arguments-argresolve x (vl-scopestack-fix ss)
                                      ports scope warnings inst)
             (vl-arguments-argresolve x ss ports scope warnings inst)))

    Theorem: vl-arguments-argresolve-vl-scopestack-equiv-congruence-on-ss

    (defthm vl-arguments-argresolve-vl-scopestack-equiv-congruence-on-ss
     (implies
      (vl-scopestack-equiv ss ss-equiv)
      (equal
        (vl-arguments-argresolve x ss ports scope warnings inst)
        (vl-arguments-argresolve x ss-equiv ports scope warnings inst)))
     :rule-classes :congruence)

    Theorem: vl-arguments-argresolve-of-vl-portlist-fix-ports

    (defthm vl-arguments-argresolve-of-vl-portlist-fix-ports
      (equal (vl-arguments-argresolve x ss (vl-portlist-fix ports)
                                      scope warnings inst)
             (vl-arguments-argresolve x ss ports scope warnings inst)))

    Theorem: vl-arguments-argresolve-vl-portlist-equiv-congruence-on-ports

    (defthm
          vl-arguments-argresolve-vl-portlist-equiv-congruence-on-ports
     (implies
      (vl-portlist-equiv ports ports-equiv)
      (equal
        (vl-arguments-argresolve x ss ports scope warnings inst)
        (vl-arguments-argresolve x ss ports-equiv scope warnings inst)))
     :rule-classes :congruence)

    Theorem: vl-arguments-argresolve-of-vl-scope-fix-scope

    (defthm vl-arguments-argresolve-of-vl-scope-fix-scope
      (equal (vl-arguments-argresolve x ss ports (vl-scope-fix scope)
                                      warnings inst)
             (vl-arguments-argresolve x ss ports scope warnings inst)))

    Theorem: vl-arguments-argresolve-vl-scope-equiv-congruence-on-scope

    (defthm vl-arguments-argresolve-vl-scope-equiv-congruence-on-scope
     (implies
      (vl-scope-equiv scope scope-equiv)
      (equal
        (vl-arguments-argresolve x ss ports scope warnings inst)
        (vl-arguments-argresolve x ss ports scope-equiv warnings inst)))
     :rule-classes :congruence)

    Theorem: vl-arguments-argresolve-of-vl-warninglist-fix-warnings

    (defthm vl-arguments-argresolve-of-vl-warninglist-fix-warnings
     (equal (vl-arguments-argresolve x ss ports
                                     scope (vl-warninglist-fix warnings)
                                     inst)
            (vl-arguments-argresolve x ss ports scope warnings inst)))

    Theorem: vl-arguments-argresolve-vl-warninglist-equiv-congruence-on-warnings

    (defthm
     vl-arguments-argresolve-vl-warninglist-equiv-congruence-on-warnings
     (implies
      (vl-warninglist-equiv warnings warnings-equiv)
      (equal
        (vl-arguments-argresolve x ss ports scope warnings inst)
        (vl-arguments-argresolve x ss ports scope warnings-equiv inst)))
     :rule-classes :congruence)

    Theorem: vl-arguments-argresolve-of-vl-modinst-fix-inst

    (defthm vl-arguments-argresolve-of-vl-modinst-fix-inst
     (equal
          (vl-arguments-argresolve x ss ports
                                   scope warnings (vl-modinst-fix inst))
          (vl-arguments-argresolve x ss ports scope warnings inst)))

    Theorem: vl-arguments-argresolve-vl-modinst-equiv-congruence-on-inst

    (defthm vl-arguments-argresolve-vl-modinst-equiv-congruence-on-inst
     (implies
      (vl-modinst-equiv inst inst-equiv)
      (equal
        (vl-arguments-argresolve x ss ports scope warnings inst)
        (vl-arguments-argresolve x ss ports scope warnings inst-equiv)))
     :rule-classes :congruence)