Build a (slow) alist binding the "formals" for a module to the "actuals" from an instance.
(vl-modinst-eocc-bindings actuals portpat walist warnings inst) → (mv successp warnings binding-alist)
Function:
(defun vl-modinst-eocc-bindings (actuals portpat walist warnings inst) (declare (xargs :guard (and (vl-plainarglist-p actuals) (vl-emodwirelistlist-p portpat) (vl-wirealist-p walist) (vl-warninglist-p warnings) (vl-modinst-p inst)))) (declare (xargs :guard (and (true-list-listp portpat) (same-lengthp actuals portpat)))) (let ((__function__ 'vl-modinst-eocc-bindings)) (declare (ignorable __function__)) (b* (((when (atom actuals)) (mv t (ok) nil)) ((vl-modinst inst) inst) (expr1 (vl-plainarg->expr (car actuals))) ((unless expr1) (mv nil (fatal :type :vl-programming-error :msg "~a0: expected all arguments to be non-blank." :args (list inst)) nil)) ((mv successp warnings expr1-msb-bits) (vl-msb-expr-bitlist expr1 walist warnings)) ((unless successp) (mv nil (fatal :type :vl-bad-instance :msg "~a0: error generating wires for ~a1." :args (list inst.loc expr1)) nil)) (formal1-msb-bits (car portpat)) ((unless (and (same-lengthp expr1-msb-bits formal1-msb-bits) (mbt (vl-emodwirelist-p formal1-msb-bits)))) (b* ((nactuals (length expr1-msb-bits)) (nformals (length formal1-msb-bits))) (mv nil (fatal :type :vl-bad-instance :msg "~a0: we produced ~x1 wire~s2 for an argument whose ~ corresponding port has ~x3 wire~s4. ~ - Argument wires: ~x5; ~ - Port wires: ~x6." :args (list inst nactuals (if (= nactuals 1) "" "s") nformals (if (= nformals 1) "" "s") (symbol-list-names expr1-msb-bits) (symbol-list-names formal1-msb-bits))) nil))) ((mv successp warnings binding-alist) (vl-modinst-eocc-bindings (cdr actuals) (cdr portpat) walist warnings inst)) (binding-alist (append (pairlis$ formal1-msb-bits expr1-msb-bits) binding-alist))) (mv successp warnings binding-alist))))
Theorem:
(defthm booleanp-of-vl-modinst-eocc-bindings.successp (b* (((mv ?successp ?warnings ?binding-alist) (vl-modinst-eocc-bindings actuals portpat walist warnings inst))) (booleanp successp)) :rule-classes :type-prescription)
Theorem:
(defthm vl-warninglist-p-of-vl-modinst-eocc-bindings.warnings (b* (((mv ?successp ?warnings ?binding-alist) (vl-modinst-eocc-bindings actuals portpat walist warnings inst))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-vl-modinst-eocc-bindings.binding-alist (b* (((mv ?successp ?warnings ?binding-alist) (vl-modinst-eocc-bindings actuals portpat walist warnings inst))) (and (alistp binding-alist) (vl-emodwirelist-p (alist-keys binding-alist)) (vl-emodwirelist-p (alist-vals binding-alist)))) :rule-classes :rewrite)
Theorem:
(defthm true-listp-of-vl-modinst-eocc-bindings.binding-alist (b* (((mv ?successp ?warnings ?binding-alist) (vl-modinst-eocc-bindings actuals portpat walist warnings inst))) (true-listp binding-alist)) :rule-classes :type-prescription)