Construct the immediate dependency graph for a design.
(vl-design-immdeps x) → graph
Note that this is a very expensive operation that has to crawl through the entire design and do many name lookups.
Function:
(defun vl-design-immdeps (x) (declare (xargs :guard (vl-design-p x))) (let ((__function__ 'vl-design-immdeps)) (declare (ignorable __function__)) (b* (((vl-design x)) (ss (vl-scopestack-init x)) (graph (time$ (b* ((graph (make-vl-immdepgraph)) (graph (vl-modulelist-immdeps* x.mods graph)) (graph (vl-udplist-immdeps* x.udps graph)) (graph (vl-interfacelist-immdeps* x.interfaces graph)) (graph (vl-programlist-immdeps* x.programs graph)) (graph (vl-classlist-immdeps* x.classes graph)) (graph (vl-packagelist-immdeps* x.packages graph)) (graph (vl-configlist-immdeps* x.configs graph)) (graph (vl-vardecllist-immdeps* x.vardecls graph)) (graph (vl-taskdecllist-immdeps* x.taskdecls graph)) (graph (vl-fundecllist-immdeps* x.fundecls graph)) (graph (vl-paramdecllist-immdeps* x.paramdecls graph)) (graph (vl-typedeflist-immdeps* x.typedefs graph))) graph) :msg "; vl-design-immdeps crawl: ~st sec, ~sa bytes.~%" :mintime 1/2)) (- (vl-scopestacks-free)) ((vl-immdepgraph graph)) (- (or (uniquep (alist-keys graph.deps)) (raise "Design elements are not unique? Name clash for ~&0." (duplicated-members (alist-keys graph.deps))))) (final-deps (time$ (depgraph::mergesort-alist-values graph.deps) :msg "; vl-design-immdeps sort: ~st sec, ~sa bytes.~%" :mintime 1/2))) (change-vl-immdepgraph graph :deps final-deps))))
Theorem:
(defthm vl-immdepgraph-p-of-vl-design-immdeps (b* ((graph (vl-design-immdeps x))) (vl-immdepgraph-p graph)) :rule-classes :rewrite)
Theorem:
(defthm alist-values-are-sets-p-of-vl-design-immdeps (b* (((vl-immdepgraph graph) (vl-design-immdeps x))) (depgraph::alist-values-are-sets-p graph.deps)))
Theorem:
(defthm vl-design-immdeps-of-vl-design-fix-x (equal (vl-design-immdeps (vl-design-fix x)) (vl-design-immdeps x)))
Theorem:
(defthm vl-design-immdeps-vl-design-equiv-congruence-on-x (implies (vl-design-equiv x x-equiv) (equal (vl-design-immdeps x) (vl-design-immdeps x-equiv))) :rule-classes :congruence)