Top-level function for adding drivers for undriven outputs.
Signature: (vl-add-zdrivers all-names flat-ins flat-outs occs) returns
However, as a special exception,
Function:
(defun vl-add-zdrivers (all-names flat-ins flat-outs occs) (declare (xargs :guard (and (vl-emodwirelist-p all-names) (vl-emodwirelist-p flat-ins) (vl-emodwirelist-p flat-outs) (vl-emodwirelist-p (collect-signal-list :i occs)) (vl-emodwirelist-p (collect-signal-list :o occs))))) (b* ((driven-signals (union (mergesort flat-ins) (mergesort (collect-signal-list :o occs)))) (consumed-signals (union (mergesort flat-outs) (mergesort (collect-signal-list :i occs)))) (signals-that-need-zdrivers (difference (difference consumed-signals driven-signals) (mergesort '(acl2::f t)))) ((unless signals-that-need-zdrivers) occs) (idx (vl-emodwirelist-highest "vl_zdrive" all-names)) (new-occs (vl-make-z-occs idx signals-that-need-zdrivers))) (append new-occs occs)))
Theorem:
(defthm good-esim-occsp-of-vl-add-zdrivers (implies (and (force (vl-emodwirelist-p all-names)) (force (vl-emodwirelist-p flat-ins)) (force (vl-emodwirelist-p flat-outs)) (force (vl-emodwirelist-p (collect-signal-list :i occs))) (force (vl-emodwirelist-p (collect-signal-list :o occs))) (force (good-esim-occsp occs))) (good-esim-occsp (vl-add-zdrivers all-names flat-ins flat-outs occs))))