Convert most of a interface into a vl-genblob.
(vl-interface->genblob x) → genblob
Certain fields of a vl-interface aren't also fields of a vl-genblob, for instance, a genblob doesn't have warnings, a name, location information, etc.
But aside from these fields, most of a interface can be extracted and turned into a genblob for easy processing. After processing the blob, the updated fields can be reinstalled into the interface using vl-genblob->interface.
Function:
(defun vl-interface->genblob (x) (declare (xargs :guard (vl-interface-p x))) (let ((__function__ 'vl-interface->genblob)) (declare (ignorable __function__)) (b* (((vl-interface x))) (make-vl-genblob :id x.name :scopetype :vl-interface :generates x.generates :ports x.ports :portdecls x.portdecls :assigns x.assigns :aliases x.aliases :vardecls x.vardecls :paramdecls x.paramdecls :fundecls x.fundecls :taskdecls x.taskdecls :modinsts x.modinsts :alwayses x.alwayses :initials x.initials :finals x.finals :typedefs x.typedefs :imports x.imports :modports x.modports :genvars x.genvars :assertions x.assertions :cassertions x.cassertions :properties x.properties :sequences x.sequences :clkdecls x.clkdecls :gclkdecls x.gclkdecls :defaultdisables x.defaultdisables :dpiimports x.dpiimports :dpiexports x.dpiexports :binds x.binds :classes x.classes :elabtasks x.elabtasks))))
Theorem:
(defthm vl-genblob-p-of-vl-interface->genblob (b* ((genblob (vl-interface->genblob x))) (vl-genblob-p genblob)) :rule-classes :rewrite)
Theorem:
(defthm vl-interface->genblob-of-vl-interface-fix-x (equal (vl-interface->genblob (vl-interface-fix x)) (vl-interface->genblob x)))
Theorem:
(defthm vl-interface->genblob-vl-interface-equiv-congruence-on-x (implies (vl-interface-equiv x x-equiv) (equal (vl-interface->genblob x) (vl-interface->genblob x-equiv))) :rule-classes :congruence)