Generate an instkey for an unparameterized module and add it to the ledger if it isn't there already.
(vl-unparam-add-to-ledger origname paramdecls ports ifportalist ledger inst-ss mod-ss &key (no-rename 'nil) user-name) → (mv instkey ledger)
Function:
(defun vl-unparam-add-to-ledger-fn (origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name) (declare (xargs :guard (and (stringp origname) (vl-paramdecllist-p paramdecls) (vl-portlist-p ports) (vl-ifport-alist-p ifportalist) (vl-unparam-ledger-p ledger) (vl-scopestack-p inst-ss) (vl-scopestack-p mod-ss) (maybe-stringp user-name)))) (let ((__function__ 'vl-unparam-add-to-ledger)) (declare (ignorable __function__)) (b* (((vl-unparam-ledger ledger) (vl-unparam-ledger-fix ledger)) (ifportalist (vl-ifport-alist-fix ifportalist)) (origname (string-fix origname)) (instkey (vl-unparam-inst->instkey origname paramdecls ifportalist inst-ss mod-ss)) (existing (cdr (hons-get instkey ledger.instkeymap))) ((when existing) (mv instkey ledger)) (basename (or user-name (if (or no-rename (and (vl-paramdecllist-all-localp paramdecls) (atom ifportalist))) origname (vl-unparam-basename origname paramdecls ifportalist (not ledger.omit-default-params))))) ((mv newname ndb) (vl-namedb-plain-name basename ledger.ndb)) (signature (make-vl-unparam-signature :modname origname :newname newname :final-params paramdecls :final-ports ports)) (instkeymap (hons-acons instkey signature ledger.instkeymap))) (mv instkey (change-vl-unparam-ledger ledger :ndb ndb :instkeymap instkeymap)))))
Theorem:
(defthm vl-unparam-instkey-p-of-vl-unparam-add-to-ledger.instkey (b* (((mv ?instkey ?ledger) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name))) (vl-unparam-instkey-p instkey)) :rule-classes :rewrite)
Theorem:
(defthm vl-unparam-ledger-p-of-vl-unparam-add-to-ledger.ledger (b* (((mv ?instkey ?ledger) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name))) (vl-unparam-ledger-p ledger)) :rule-classes :rewrite)
Theorem:
(defthm vl-unparam-add-to-ledger-binds-instkey (b* (((mv ?instkey ?ledger) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name))) (hons-assoc-equal instkey (vl-unparam-ledger->instkeymap ledger))))
Theorem:
(defthm vl-unparam-add-to-ledger-fn-of-str-fix-origname (equal (vl-unparam-add-to-ledger-fn (str-fix origname) paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name)))
Theorem:
(defthm vl-unparam-add-to-ledger-fn-streqv-congruence-on-origname (implies (streqv origname origname-equiv) (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname-equiv paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name))) :rule-classes :congruence)
Theorem:
(defthm vl-unparam-add-to-ledger-fn-of-vl-paramdecllist-fix-paramdecls (equal (vl-unparam-add-to-ledger-fn origname (vl-paramdecllist-fix paramdecls) ports ifportalist ledger inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name)))
Theorem:
(defthm vl-unparam-add-to-ledger-fn-vl-paramdecllist-equiv-congruence-on-paramdecls (implies (vl-paramdecllist-equiv paramdecls paramdecls-equiv) (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls-equiv ports ifportalist ledger inst-ss mod-ss no-rename user-name))) :rule-classes :congruence)
Theorem:
(defthm vl-unparam-add-to-ledger-fn-of-vl-portlist-fix-ports (equal (vl-unparam-add-to-ledger-fn origname paramdecls (vl-portlist-fix ports) ifportalist ledger inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name)))
Theorem:
(defthm vl-unparam-add-to-ledger-fn-vl-portlist-equiv-congruence-on-ports (implies (vl-portlist-equiv ports ports-equiv) (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports-equiv ifportalist ledger inst-ss mod-ss no-rename user-name))) :rule-classes :congruence)
Theorem:
(defthm vl-unparam-add-to-ledger-fn-of-vl-ifport-alist-fix-ifportalist (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports (vl-ifport-alist-fix ifportalist) ledger inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name)))
Theorem:
(defthm vl-unparam-add-to-ledger-fn-vl-ifport-alist-equiv-congruence-on-ifportalist (implies (vl-ifport-alist-equiv ifportalist ifportalist-equiv) (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist-equiv ledger inst-ss mod-ss no-rename user-name))) :rule-classes :congruence)
Theorem:
(defthm vl-unparam-add-to-ledger-fn-of-vl-unparam-ledger-fix-ledger (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist (vl-unparam-ledger-fix ledger) inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name)))
Theorem:
(defthm vl-unparam-add-to-ledger-fn-vl-unparam-ledger-equiv-congruence-on-ledger (implies (vl-unparam-ledger-equiv ledger ledger-equiv) (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger-equiv inst-ss mod-ss no-rename user-name))) :rule-classes :congruence)
Theorem:
(defthm vl-unparam-add-to-ledger-fn-of-vl-scopestack-fix-inst-ss (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger (vl-scopestack-fix inst-ss) mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name)))
Theorem:
(defthm vl-unparam-add-to-ledger-fn-vl-scopestack-equiv-congruence-on-inst-ss (implies (vl-scopestack-equiv inst-ss inst-ss-equiv) (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss-equiv mod-ss no-rename user-name))) :rule-classes :congruence)
Theorem:
(defthm vl-unparam-add-to-ledger-fn-of-vl-scopestack-fix-mod-ss (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss (vl-scopestack-fix mod-ss) no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name)))
Theorem:
(defthm vl-unparam-add-to-ledger-fn-vl-scopestack-equiv-congruence-on-mod-ss (implies (vl-scopestack-equiv mod-ss mod-ss-equiv) (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss-equiv no-rename user-name))) :rule-classes :congruence)
Theorem:
(defthm vl-unparam-add-to-ledger-fn-of-maybe-string-fix-user-name (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename (maybe-string-fix user-name)) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name)))
Theorem:
(defthm vl-unparam-add-to-ledger-fn-maybe-string-equiv-congruence-on-user-name (implies (maybe-string-equiv user-name user-name-equiv) (equal (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name) (vl-unparam-add-to-ledger-fn origname paramdecls ports ifportalist ledger inst-ss mod-ss no-rename user-name-equiv))) :rule-classes :congruence)