Create a single missing argument for a
(vl-create-namedarg-for-dotstar name ss warnings inst) → (mv successp warnings new-args)
Function:
(defun vl-create-namedarg-for-dotstar (name ss warnings inst) (declare (xargs :guard (and (stringp name) (vl-scopestack-p ss) (vl-warninglist-p warnings) (vl-modinst-p inst)))) (let ((__function__ 'vl-create-namedarg-for-dotstar)) (declare (ignorable __function__)) (b* ((name (string-fix name)) ((vl-modinst inst) (vl-modinst-fix inst)) (look (vl-scopestack-find-item name ss)) ((unless look) (mv nil (fatal :type :vl-dotstar-missing-var :msg "~a0: using .* syntax to instantiate ~m1, but there is ~ no declaration for port ~s2." :args (list inst inst.modname name)) nil)) ((when (eq (tag look) :vl-vardecl)) (b* ((new-arg (make-vl-namedarg :name name :expr (vl-idexpr name) :nameonly-p t :atts nil))) (mv t (ok) (list new-arg)))) ((when (eq (tag look) :vl-modinst)) (b* (((vl-modinst look)) (mod/if (vl-scopestack-find-definition look.modname ss)) ((unless mod/if) (mv nil (fatal :type :vl-dotstar-missing-intfc :msg "~a0: trying to resolve .* connection for ~ ~w1 (type ~m2): but ~m2 is not defined." :args (list inst name look.modname)) nil)) ((when (eq (tag mod/if) :vl-interface)) (b* ((new-arg (make-vl-namedarg :name name :expr (vl-idexpr name) :nameonly-p t :atts nil))) (mv t (ok) (list new-arg))))) (mv nil (fatal :type :vl-dotstar-bad-intfc :msg "~a0: using .* syntax to instantiate ~m1 would ~ result in connecting port ~s2 to ~a3, which is ~ an instance of a ~x4." :args (list inst inst.modname name look (tag mod/if))) nil))) ((when (eq (tag look) :vl-interfaceport)) (b* ((new-arg (make-vl-namedarg :name name :expr (vl-idexpr name) :nameonly-p t :atts nil))) (mv t (ok) (list new-arg))))) (mv nil (fatal :type :vl-dotstar-bad-port-connection :msg "~a0: using .* syntax to instantiate ~m1 would result in ~ connecting port ~s2 to ~a3, which has unsupported type ~ ~x4." :args (list inst inst.modname name look (tag look))) nil))))
Theorem:
(defthm booleanp-of-vl-create-namedarg-for-dotstar.successp (b* (((mv ?successp ?warnings ?new-args) (vl-create-namedarg-for-dotstar name ss warnings inst))) (booleanp successp)) :rule-classes :type-prescription)
Theorem:
(defthm vl-warninglist-p-of-vl-create-namedarg-for-dotstar.warnings (b* (((mv ?successp ?warnings ?new-args) (vl-create-namedarg-for-dotstar name ss warnings inst))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-namedarglist-p-of-vl-create-namedarg-for-dotstar.new-args (b* (((mv ?successp ?warnings ?new-args) (vl-create-namedarg-for-dotstar name ss warnings inst))) (vl-namedarglist-p new-args)) :rule-classes :rewrite)
Theorem:
(defthm true-listp-of-vl-create-namedarg-for-dotstar.new-args (b* (((mv ?successp ?warnings ?new-args) (vl-create-namedarg-for-dotstar name ss warnings inst))) (true-listp new-args)) :rule-classes :type-prescription)
Theorem:
(defthm vl-create-namedarg-for-dotstar-of-str-fix-name (equal (vl-create-namedarg-for-dotstar (str-fix name) ss warnings inst) (vl-create-namedarg-for-dotstar name ss warnings inst)))
Theorem:
(defthm vl-create-namedarg-for-dotstar-streqv-congruence-on-name (implies (streqv name name-equiv) (equal (vl-create-namedarg-for-dotstar name ss warnings inst) (vl-create-namedarg-for-dotstar name-equiv ss warnings inst))) :rule-classes :congruence)
Theorem:
(defthm vl-create-namedarg-for-dotstar-of-vl-scopestack-fix-ss (equal (vl-create-namedarg-for-dotstar name (vl-scopestack-fix ss) warnings inst) (vl-create-namedarg-for-dotstar name ss warnings inst)))
Theorem:
(defthm vl-create-namedarg-for-dotstar-vl-scopestack-equiv-congruence-on-ss (implies (vl-scopestack-equiv ss ss-equiv) (equal (vl-create-namedarg-for-dotstar name ss warnings inst) (vl-create-namedarg-for-dotstar name ss-equiv warnings inst))) :rule-classes :congruence)
Theorem:
(defthm vl-create-namedarg-for-dotstar-of-vl-warninglist-fix-warnings (equal (vl-create-namedarg-for-dotstar name ss (vl-warninglist-fix warnings) inst) (vl-create-namedarg-for-dotstar name ss warnings inst)))
Theorem:
(defthm vl-create-namedarg-for-dotstar-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-create-namedarg-for-dotstar name ss warnings inst) (vl-create-namedarg-for-dotstar name ss warnings-equiv inst))) :rule-classes :congruence)
Theorem:
(defthm vl-create-namedarg-for-dotstar-of-vl-modinst-fix-inst (equal (vl-create-namedarg-for-dotstar name ss warnings (vl-modinst-fix inst)) (vl-create-namedarg-for-dotstar name ss warnings inst)))
Theorem:
(defthm vl-create-namedarg-for-dotstar-vl-modinst-equiv-congruence-on-inst (implies (vl-modinst-equiv inst inst-equiv) (equal (vl-create-namedarg-for-dotstar name ss warnings inst) (vl-create-namedarg-for-dotstar name ss warnings inst-equiv))) :rule-classes :congruence)