Print a short, human-friendly description of a vl-ctxelement-p.
(vl-pp-ctxelement-summary x &key (withloc 'nil) (ps 'ps)) → ps
Function:
(defun vl-pp-ctxelement-summary-fn (x withloc ps) (declare (xargs :stobjs (ps))) (declare (xargs :guard (vl-ctxelement-p x))) (let ((__function__ 'vl-pp-ctxelement-summary)) (declare (ignorable __function__)) (b* ((x (vl-ctxelement-fix x))) (case (tag x) (:vl-regularport (let* ((name (vl-regularport->name x))) (if name (vl-ps-seq (vl-print "Port ") (vl-print-wirename name) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-port->loc x))) ps)) (vl-ps-seq (vl-print "Unnamed port at ") (vl-print-loc (vl-port->loc x)))))) (:vl-interfaceport (let* ((name (vl-interfaceport->name x))) (vl-ps-seq (vl-print "Interface port ") (vl-print-wirename name) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-interfaceport->loc x))) ps)))) (:vl-portdecl (vl-ps-seq (vl-print "Port declaration of ") (vl-print-wirename (vl-portdecl->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-portdecl->loc x))) ps))) (:vl-assign (let* ((orig (vl-pps-origexpr (vl-assign->lvalue x)))) (vl-ps-seq (vl-print "Assignment to ") (if (< (length orig) 40) (vl-ps-seq (vl-pp-origexpr (vl-assign->lvalue x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-assign->loc x))) ps)) (vl-ps-seq (vl-print (subseq orig 0 40)) (vl-print "... at ") (vl-print-loc (vl-assign->loc x))))))) (:vl-vardecl (vl-ps-seq (vl-print "Declaration of ") (vl-print-wirename (vl-vardecl->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-vardecl->loc x))) ps))) (:vl-paramdecl (vl-ps-seq (vl-print "Param declaration of ") (vl-print-wirename (vl-paramdecl->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-paramdecl->loc x))) ps))) (:vl-fundecl (vl-ps-seq (vl-print "Function ") (vl-print-wirename (vl-fundecl->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-fundecl->loc x))) ps))) (:vl-taskdecl (vl-ps-seq (vl-print "Task ") (vl-print-wirename (vl-taskdecl->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-taskdecl->loc x))) ps))) (:vl-modinst (let* ((instname (vl-modinst->instname x)) (modname (vl-modinst->modname x))) (if instname (vl-ps-seq (vl-print "Instance ") (vl-print-wirename instname) (vl-print " of ") (vl-print-modname modname) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-modinst->loc x))) ps)) (vl-ps-seq (vl-print "Unnamed instance of ") (vl-print-modname modname) (vl-print " at ") (vl-print-loc (vl-modinst->loc x)))))) (:vl-gateinst (b* ((name (vl-gateinst->name x)) (type (vl-gatetype-string (vl-gateinst->type x)))) (if name (vl-ps-seq (vl-print-str (str::upcase-first type)) (vl-print " gate ") (vl-print-wirename name) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-gateinst->loc x))) ps)) (vl-ps-seq (vl-print "Unnamed ") (vl-print-str type) (vl-print " gate at ") (vl-print-loc (vl-gateinst->loc x)))))) (:vl-always (vl-ps-seq (vl-print "Always statement at ") (vl-print-loc (vl-always->loc x)))) (:vl-initial (vl-ps-seq (vl-print "Initial statement at ") (vl-print-loc (vl-initial->loc x)))) (:vl-final (vl-ps-seq (vl-print "Final statement at ") (vl-print-loc (vl-final->loc x)))) (:vl-typedef (vl-ps-seq (vl-print "Typedef of ") (vl-print-wirename (vl-typedef->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-typedef->loc x))) ps))) (:vl-fwdtypedef (vl-ps-seq (vl-print "Fwdtypedef at ") (vl-print-loc (vl-fwdtypedef->loc x)))) (:vl-modport (vl-ps-seq (vl-print "Modport at ") (vl-print-loc (vl-modport->loc x)))) (:vl-alias (vl-ps-seq (vl-print "Alias at ") (vl-print-loc (vl-alias->loc x)))) (:vl-import (vl-pp-import x)) (:vl-property (vl-ps-seq (vl-print "Property ") (vl-print-str (vl-property->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-property->loc x))) ps))) (:vl-sequence (vl-ps-seq (vl-print "Sequence ") (vl-print-str (vl-sequence->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-sequence->loc x))) ps))) (:vl-clkdecl (vl-ps-seq (if (vl-clkdecl->name x) (vl-ps-seq (vl-print "Clocking block ") (vl-print-str (vl-clkdecl->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-clkdecl->loc x))) ps)) (vl-ps-seq (vl-print "Clocking block at ") (vl-print-loc (vl-clkdecl->loc x)))))) (:vl-gclkdecl (vl-ps-seq (if (vl-gclkdecl->name x) (vl-ps-seq (vl-print "Global clocking block ") (vl-print-str (vl-gclkdecl->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-gclkdecl->loc x))) ps)) (vl-ps-seq (vl-print "Global clocking block at ") (vl-print-loc (vl-gclkdecl->loc x)))))) (:vl-defaultdisable (vl-ps-seq (vl-print "Default disable statement at ") (vl-print-loc (vl-defaultdisable->loc x)))) (:vl-assertion (vl-ps-seq (vl-print "Assertion ") (vl-print-str (or (vl-assertion->name x) "")) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-assertion->loc x))) ps))) (:vl-cassertion (vl-ps-seq (vl-print "Assertion ") (vl-print-str (or (vl-cassertion->name x) "")) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-cassertion->loc x))) ps))) (:vl-dpiimport (vl-ps-seq (vl-print "DPI import of ") (vl-print-str (vl-dpiimport->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-dpiimport->loc x))) ps))) (:vl-dpiexport (vl-ps-seq (vl-print "DPI export of ") (vl-print-str (vl-dpiexport->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-dpiexport->loc x))) ps))) (:vl-bind (vl-ps-seq (vl-print "Bind construct at ") (vl-print-loc (vl-bind->loc x)))) (:vl-class (vl-ps-seq (vl-print "Class ") (vl-print-str (vl-class->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-class->loc x))) ps))) (:vl-covergroup (vl-ps-seq (vl-print "Covergroup ") (vl-print-str (vl-covergroup->name x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-covergroup->loc x))) ps))) (:vl-elabtask (vl-ps-seq (vl-print "Elaboration system task ") (vl-pp-stmt (vl-elabtask->stmt x)) (if withloc (vl-ps-seq (vl-print " at ") (vl-print-loc (vl-elabtask->loc x))) ps))) ((:vl-genif :vl-genloop :vl-gencase :vl-genbegin :vl-genarray :vl-genbase) (vl-ps-seq (vl-print "Generate block at ") (vl-print-loc (vl-genelement->loc x)))) (otherwise (prog2$ (impossible) ps))))))
Theorem:
(defthm vl-pp-ctxelement-summary-fn-of-vl-ctxelement-fix-x (equal (vl-pp-ctxelement-summary-fn (vl-ctxelement-fix x) withloc ps) (vl-pp-ctxelement-summary-fn x withloc ps)))
Theorem:
(defthm vl-pp-ctxelement-summary-fn-vl-ctxelement-equiv-congruence-on-x (implies (vl-ctxelement-equiv x x-equiv) (equal (vl-pp-ctxelement-summary-fn x withloc ps) (vl-pp-ctxelement-summary-fn x-equiv withloc ps))) :rule-classes :congruence)