Generate expressions and declarations for some fresh, one-bit wires.
(vl-make-temporary-wires prefix i nf loc) → (mv exprs vardecls nf)
Function:
(defun vl-make-temporary-wires (prefix i nf loc) (declare (xargs :guard (and (stringp prefix) (natp i) (vl-namefactory-p nf) (vl-location-p loc)))) (let ((__function__ 'vl-make-temporary-wires)) (declare (ignorable __function__)) (b* (((when (zp i)) (mv nil nil nf)) ((mv new-name nf) (vl-namefactory-indexed-name prefix nf)) (expr1 (make-vl-atom :guts (make-vl-id :name new-name) :finalwidth 1 :finaltype :vl-unsigned)) (decl1 (make-vl-vardecl :name new-name :type *vl-plain-old-wire-type* :nettype :vl-wire :loc loc)) ((mv exprs decls nf) (vl-make-temporary-wires prefix (- i 1) nf loc))) (mv (cons expr1 exprs) (cons decl1 decls) nf))))
Theorem:
(defthm return-type-of-vl-make-temporary-wires.exprs (b* (((mv ?exprs ?vardecls ?nf) (vl-make-temporary-wires prefix i nf loc))) (and (vl-exprlist-p exprs) (equal (len exprs) (nfix i)))) :rule-classes :rewrite)
Theorem:
(defthm vl-vardecllist-p-of-vl-make-temporary-wires.vardecls (implies (force (vl-location-p loc)) (b* (((mv ?exprs ?vardecls ?nf) (vl-make-temporary-wires prefix i nf loc))) (vl-vardecllist-p vardecls))) :rule-classes :rewrite)
Theorem:
(defthm vl-namefactory-p-of-vl-make-temporary-wires.nf (implies (and (force (stringp prefix)) (force (vl-namefactory-p nf))) (b* (((mv ?exprs ?vardecls ?nf) (vl-make-temporary-wires prefix i nf loc))) (vl-namefactory-p nf))) :rule-classes :rewrite)
Theorem:
(defthm vl-make-temporary-wires-mvtypes-0 (true-listp (mv-nth 0 (vl-make-temporary-wires prefix i nf loc))) :rule-classes :type-prescription)
Theorem:
(defthm vl-make-temporary-wires-mvtypes-1 (true-listp (mv-nth 1 (vl-make-temporary-wires prefix i nf loc))) :rule-classes :type-prescription)
Theorem:
(defthm vl-make-temporary-wires-0-under-iff (iff (mv-nth 0 (vl-make-temporary-wires prefix i nf loc)) (not (zp i))))