Convert a gate array instance into a list of gates (if necessary).
(vl-replicate-gateinst x nf ss warnings) → (mv warnings new-gateinsts nf)
If
Function:
(defun vl-replicate-gateinst (x nf ss warnings) (declare (xargs :guard (and (vl-gateinst-p x) (vl-namefactory-p nf) (vl-scopestack-p ss) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-replicate-gateinst)) (declare (ignorable __function__)) (b* ((x (vl-gateinst-fix x)) (nf (vl-namefactory-fix nf)) ((vl-gateinst x) x) ((unless x.range) (mv (ok) (list x) nf)) ((unless (vl-range-resolved-p x.range)) (mv (fatal :type :vl-bad-gate :msg "~a0: expected range of instance array to be ~ resolved, but found ~a1." :args (list x x.range)) (list x) nf)) (x.atts (cons (list "VL_FROM_GATE_ARRAY") x.atts)) (size (vl-range-size x.range)) (port-widths (replicate (len x.args) 1)) ((mv successp warnings slices) (vl-partition-plainarglist x.args port-widths size ss x warnings)) ((unless successp) (mv warnings (list x) nf)) (transpose (vl-reorient-partitioned-args slices size)) ((mv warnings names nf) (vl-replicated-instnames x.name x.range nf x warnings)) (new-atts (if x.name (cons (cons "VL_REPLICATE_ORIGNAME" (make-vl-atom :guts (vl-string x.name))) x.atts) x.atts)) (left-idx (vl-resolved->val (vl-range->msb x.range))) (right-idx (vl-resolved->val (vl-range->lsb x.range))) (idx-incr (if (>= left-idx right-idx) -1 1)) (new-gates (vl-assemble-gateinsts names transpose left-idx idx-incr x.type x.strength x.delay new-atts x.loc))) (mv warnings new-gates nf))))
Theorem:
(defthm vl-warninglist-p-of-vl-replicate-gateinst.warnings (b* (((mv ?warnings ?new-gateinsts ?nf) (vl-replicate-gateinst x nf ss warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-gateinstlist-p-of-vl-replicate-gateinst.new-gateinsts (b* (((mv ?warnings ?new-gateinsts ?nf) (vl-replicate-gateinst x nf ss warnings))) (vl-gateinstlist-p new-gateinsts)) :rule-classes :rewrite)
Theorem:
(defthm vl-namefactory-p-of-vl-replicate-gateinst.nf (b* (((mv ?warnings ?new-gateinsts ?nf) (vl-replicate-gateinst x nf ss warnings))) (vl-namefactory-p nf)) :rule-classes :rewrite)
Theorem:
(defthm vl-replicate-gateinst-mvtypes-1 (true-listp (mv-nth 1 (vl-replicate-gateinst x nf ss warnings))) :rule-classes :type-prescription)
Theorem:
(defthm vl-replicate-gateinst-of-vl-gateinst-fix-x (equal (vl-replicate-gateinst (vl-gateinst-fix x) nf ss warnings) (vl-replicate-gateinst x nf ss warnings)))
Theorem:
(defthm vl-replicate-gateinst-vl-gateinst-equiv-congruence-on-x (implies (vl-gateinst-equiv x x-equiv) (equal (vl-replicate-gateinst x nf ss warnings) (vl-replicate-gateinst x-equiv nf ss warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-replicate-gateinst-of-vl-namefactory-fix-nf (equal (vl-replicate-gateinst x (vl-namefactory-fix nf) ss warnings) (vl-replicate-gateinst x nf ss warnings)))
Theorem:
(defthm vl-replicate-gateinst-vl-namefactory-equiv-congruence-on-nf (implies (vl-namefactory-equiv nf nf-equiv) (equal (vl-replicate-gateinst x nf ss warnings) (vl-replicate-gateinst x nf-equiv ss warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-replicate-gateinst-of-vl-scopestack-fix-ss (equal (vl-replicate-gateinst x nf (vl-scopestack-fix ss) warnings) (vl-replicate-gateinst x nf ss warnings)))
Theorem:
(defthm vl-replicate-gateinst-vl-scopestack-equiv-congruence-on-ss (implies (vl-scopestack-equiv ss ss-equiv) (equal (vl-replicate-gateinst x nf ss warnings) (vl-replicate-gateinst x nf ss-equiv warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-replicate-gateinst-of-vl-warninglist-fix-warnings (equal (vl-replicate-gateinst x nf ss (vl-warninglist-fix warnings)) (vl-replicate-gateinst x nf ss warnings)))
Theorem:
(defthm vl-replicate-gateinst-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-replicate-gateinst x nf ss warnings) (vl-replicate-gateinst x nf ss warnings-equiv))) :rule-classes :congruence)