Retrieve the original name of a module instance if it was modified by the replicate transform.
(vl-modinst-origname x) → orig-name
Function:
(defun vl-modinst-origname (x) (declare (xargs :guard (vl-modinst-p x))) (let ((__function__ 'vl-modinst-origname)) (declare (ignorable __function__)) (b* (((vl-modinst x) x) (x.instname (mbe :logic (and (stringp x.instname) x.instname) :exec x.instname)) (look (assoc-equal "VL_REPLICATE_ORIGNAME" x.atts)) ((when (not (cdr look))) x.instname) ((when (not (and (vl-atom-p (cdr look)) (vl-string-p (vl-atom->guts (cdr look)))))) (raise "Malformed VL_REPLICATE_ORIGNAME attribute: ~x0~%" (cdr look)) x.instname)) (vl-string->value (vl-atom->guts (cdr look))))))
Theorem:
(defthm maybe-stringp-of-vl-modinst-origname (b* ((orig-name (vl-modinst-origname x))) (maybe-stringp orig-name)) :rule-classes :type-prescription)
Theorem:
(defthm vl-modinst-origname-of-vl-modinst-fix-x (equal (vl-modinst-origname (vl-modinst-fix x)) (vl-modinst-origname x)))
Theorem:
(defthm vl-modinst-origname-vl-modinst-equiv-congruence-on-x (implies (vl-modinst-equiv x x-equiv) (equal (vl-modinst-origname x) (vl-modinst-origname x-equiv))) :rule-classes :congruence)