Top level interface for loading Verilog sources.
(vl-load-main config state) → (mv result state)
Function:
(defun vl-load-main (config state) (declare (xargs :stobjs (state))) (declare (xargs :guard (vl-loadconfig-p config))) (let ((__function__ 'vl-load-main)) (declare (ignorable __function__)) (b* ((state (f-put-global 'vl-read-file-alist nil state)) (config (change-vl-loadconfig config :include-dirs (cons "." (vl-loadconfig->include-dirs config)))) ((mv warnings config) (b* ((start-files (vl-loadconfig->start-files config)) (dupes (duplicated-members start-files)) ((unless dupes) (mv nil config)) (warnings (warn :type :vl-warn-same-file :msg "Duplicate file names given; ignoring later ~ occurrences of ~&0." :args dupes :acc nil)) (start-files (remove-duplicates-equal start-files))) (mv warnings (change-vl-loadconfig config :start-files start-files)))) ((vl-loadconfig config) config) ((mv idcache warnings state) (time$ (vl-make-dirlist-cache config.include-dirs warnings state) :msg "; include-dir cache: ~x0 dirs, ~st sec, ~sa bytes~%" :args (list (len config.include-dirs)) :mintime config.mintime)) ((mv spcache warnings state) (time$ (vl-make-dirxlist-cache config.search-path config.search-exts warnings state) :msg "; search-dir xcache: ~x0 dirs, ~st sec, ~sa bytes~%" :args (list (len config.search-path)) :mintime config.mintime)) (pstate (make-vl-parsestate :warnings warnings)) (st (make-vl-loadstate :config config :descs nil :descalist nil :defines config.defines :reportcard nil :pstate pstate :iskips nil :ifdefmap nil :defmap nil :filemap nil :bytes 0 :idcache idcache :spcache spcache)) ((mv st state) (time$ (vl-load-files config.start-files st state) :msg "; load start-files: ~st sec, ~sa bytes~%" :mintime config.mintime)) ((mv st state) (time$ (vl-flush-out-descriptions st config.flush-tries state) :msg "; load missing modules: ~st sec, ~sa bytes~%" :mintime config.mintime)) ((vl-loadstate st) st) (design (vl-design-from-descriptions st.descs)) (design (vl-apply-reportcard design st.reportcard)) (design (change-vl-design design :plusargs config.plusargs :warnings (append-without-guard (vl-parsestate->warnings st.pstate) (vl-design->warnings design)))) (ifdefmap (fast-alist-clean st.ifdefmap)) (defmap (fast-alist-clean st.defmap)) (result (make-vl-loadresult :design design :filemap st.filemap :defines st.defines :ifdefmap ifdefmap :defmap defmap)) (- (fast-alist-free ifdefmap)) (- (fast-alist-free defmap)) (- (vl-free-dirlist-cache idcache)) (- (vl-free-dirxlist-cache spcache)) (- (fast-alist-free st.descalist)) (- (vl-iskips-report st.iskips)) (state (vl-read-file-report state))) (mv result state))))
Theorem:
(defthm vl-loadresult-p-of-vl-load-main.result (b* (((mv ?result acl2::?state) (vl-load-main config state))) (vl-loadresult-p result)) :rule-classes :rewrite)
Theorem:
(defthm state-p1-of-vl-load-main.state (implies (force (state-p1 state)) (b* (((mv ?result acl2::?state) (vl-load-main config state))) (state-p1 state))) :rule-classes :rewrite)