Pretty-print a module to ps.
(vl-pp-module x ss &key (ps 'ps)) → ps
You might instead want to use vl-ppc-module, which preserves the order of module elements and its comments. For interactive use, you may want vl-pps-module or vl-ppcs-module, which write to a string instead of ps.
Function:
(defun vl-pp-module-fn (x ss ps) (declare (xargs :stobjs (ps))) (declare (xargs :guard (and (vl-module-p x) (vl-scopestack-p ss)))) (let ((__function__ 'vl-pp-module)) (declare (ignorable __function__)) (b* (((vl-module x) (vl-module-fix x)) (ss (vl-scopestack-push x ss))) (vl-ps-seq (vl-pp-set-portnames x.portdecls) (vl-progindent) (if x.atts (vl-pp-atts x.atts) ps) (vl-ps-span "vl_key" (vl-print "module ")) (if (vl-ps->htmlp) (vl-pp-modulename-link x.name ss) (vl-print-modname x.name)) (vl-print " (") (vl-pp-portlist x.ports) (vl-println ");") (vl-progindent-block (vl-pp-genblob-guts (vl-module->genblob x) ss)) (vl-progindent) (vl-ps-span "vl_key" (vl-println "endmodule")) (vl-println "")))))
Theorem:
(defthm vl-pp-module-fn-of-vl-module-fix-x (equal (vl-pp-module-fn (vl-module-fix x) ss ps) (vl-pp-module-fn x ss ps)))
Theorem:
(defthm vl-pp-module-fn-vl-module-equiv-congruence-on-x (implies (vl-module-equiv x x-equiv) (equal (vl-pp-module-fn x ss ps) (vl-pp-module-fn x-equiv ss ps))) :rule-classes :congruence)
Theorem:
(defthm vl-pp-module-fn-of-vl-scopestack-fix-ss (equal (vl-pp-module-fn x (vl-scopestack-fix ss) ps) (vl-pp-module-fn x ss ps)))
Theorem:
(defthm vl-pp-module-fn-vl-scopestack-equiv-congruence-on-ss (implies (vl-scopestack-equiv ss ss-equiv) (equal (vl-pp-module-fn x ss ps) (vl-pp-module-fn x ss-equiv ps))) :rule-classes :congruence)