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