Pretty print a module with comments to ps.
(vl-ppc-module x ss &key (ps 'ps)) → ps
(vl-ppc-module x ss &key (ps 'ps)) extends ps with a pretty-printed
representation of the module
For interactive use you may prefer vl-ppcs-module which writes to a string instead of ps.
The
Function:
(defun vl-ppc-module-fn (x ss ps) (declare (xargs :stobjs (ps))) (declare (xargs :guard (and (vl-module-p x) (vl-scopestack-p ss)))) (let ((__function__ 'vl-ppc-module)) (declare (ignorable __function__)) (b* (((vl-module x) (vl-module-fix x)) (ss (vl-scopestack-push x ss)) (ps (vl-pp-set-portnames x.portdecls)) (imap nil) ((mv imap ps) (vl-genblob-populate-item-map (vl-module->genblob x) ss imap)) (imap (rev imap)) (comments (vl-add-newlines-after-block-comments x.comments)) (comments (if (vl-ps->htmlp) (vl-html-encode-commentmap comments (vl-ps->tabsize)) comments)) (guts (cwtime (vl-commentmap-entry-sort (append comments imap)) :mintime 1/2 :name vl-commentmap-entry-sort)) (guts (vl-remove-empty-commentmap-entries guts))) (vl-ps-seq (vl-when-html (vl-println-markup "<div class=\"vl_src\">")) (if x.atts (vl-pp-atts x.atts) ps) (vl-ps-span "vl_key" (vl-print "module ")) (vl-print-modname x.name) (vl-print " (") (vl-pp-portlist x.ports) (vl-println ");") (vl-progindent-block (vl-pp-encoded-commentmap guts)) (vl-ps-span "vl_key" (vl-println "endmodule")) (vl-println "") (vl-when-html (vl-println-markup "</div>"))))))
Theorem:
(defthm vl-ppc-module-fn-of-vl-module-fix-x (equal (vl-ppc-module-fn (vl-module-fix x) ss ps) (vl-ppc-module-fn x ss ps)))
Theorem:
(defthm vl-ppc-module-fn-vl-module-equiv-congruence-on-x (implies (vl-module-equiv x x-equiv) (equal (vl-ppc-module-fn x ss ps) (vl-ppc-module-fn x-equiv ss ps))) :rule-classes :congruence)
Theorem:
(defthm vl-ppc-module-fn-of-vl-scopestack-fix-ss (equal (vl-ppc-module-fn x (vl-scopestack-fix ss) ps) (vl-ppc-module-fn x ss ps)))
Theorem:
(defthm vl-ppc-module-fn-vl-scopestack-equiv-congruence-on-ss (implies (vl-scopestack-equiv ss ss-equiv) (equal (vl-ppc-module-fn x ss ps) (vl-ppc-module-fn x ss-equiv ps))) :rule-classes :congruence)