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-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-genif :vl-genloop :vl-gencase :vl-genblock :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)