• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
          • Vl-module
          • Vl-vardecl
          • Expressions
          • Vl-fundecl
          • Vl-assign
          • Vl-gateinst
          • Vl-modinst
          • Vl-commentmap
          • Vl-portdecl
          • Vl-taskdecl
          • Vl-design
          • Vl-interface
          • Vl-plainarglist->exprs
          • Vl-taskdecllist->names
          • Vl-fundecllist->names
          • Vl-package
          • Vl-port
          • Vl-udp
          • Vl-paramdecl
          • Vl-genelement
          • Vl-cycledelayrange
          • Vl-namedarg
          • Vl-sort-blockitems-aux
          • Vl-distitem
          • Vl-gatedelay
          • Vl-repetition
          • Vl-typedef
          • Vl-range
          • Vl-gatestrength
          • Vl-program
          • Vl-config
          • Vl-always
          • Vl-datatype-update-dims
          • Vl-import
          • Vl-enumbasetype
          • Vl-repeateventcontrol
          • Vl-paramargs
          • Vl-initial
          • Vl-eventcontrol
          • Vl-udpsymbol-p
          • Vl-maybe-range
          • Vl-maybe-nettypename
          • Vl-maybe-gatestrength
          • Vl-maybe-gatedelay
          • Vl-maybe-delayoreventcontrol
          • Vl-alias
          • Maybe-string-fix
          • Vl-maybe-packeddimension
          • Vl-fwdtypedef
          • Vl-evatom
          • Vl-packeddimension-p
          • Vl-maybe-udpsymbol
          • Vl-maybe-module
          • Vl-maybe-direction
          • Vl-maybe-datatype
          • Vl-maybe-cstrength
          • Vl-direction-p
          • Vl-arguments
          • Vl-maybe-design
          • Vl-udpline
          • Vl-exprdist
          • Vl-context1
          • Vl-genvar
          • Vl-enumitem
          • Vl-datatype-update-udims
          • Vl-datatype-update-pdims
          • Vl-modelement
          • Vl-udpedge
          • Vl-delaycontrol
          • Vl-context
            • Vl-context-p
            • Ctxexprs
            • Vl-pp-ctxelement-summary
              • Vl-pp-ctxelement-full
              • Vl-context-fix
              • Vl-ctxelement-summary
              • Vl-context-summary
              • Vl-pp-context-summary
              • Vl-pp-context-full
            • Vl-sort-blockitems
            • Vl-distweighttype-p
            • Vl-ctxelement->loc
            • Vl-blockitem
            • Vl-vardecllist
            • Vl-module->ifports
            • Vl-modelement->loc
            • Vl-ctxelement
            • Vl-coretypename-p
            • Vl-packeddimensionlist
            • Vl-modelementlist->genelements
            • Vl-gatetype-p
            • Vl-paramdecllist
            • Vl-lifetime-p
            • Vl-datatype->udims
            • Vl-datatype->pdims
            • Vl-timeunit-p
            • Vl-repetitiontype-p
            • Vl-port->name
            • Vl-importlist
            • Vl-genelement->loc
            • Vl-delayoreventcontrol
            • Vl-cstrength-p
            • Statements
            • Vl-udpentry-p
            • Vl-packeddimension-fix
            • Vl-nettypename-p
            • Vl-portdecllist
            • Vl-port->loc
            • Vl-enumbasekind-fix
            • Vl-arguments->args
            • Vl-taskdecllist
            • Vl-portlist
            • Vl-importpart-p
            • Vl-importpart-fix
            • Vl-fundecllist
            • Vl-blockstmt-p
            • Vl-assignlist
            • Vl-alwaystype-p
            • Vl-typedeflist
            • Vl-syntaxversion-p
            • Vl-randomqualifier-p
            • Vl-modinstlist
            • Vl-gateinstlist
            • Vl-blockitemlist
            • Vl-udptable
            • Vl-udplist
            • Vl-udpentrylist
            • Vl-programlist
            • Vl-paramvaluelist
            • Vl-packagelist
            • Vl-namedparamvaluelist
            • Vl-namedarglist
            • Vl-modulelist
            • Vl-modportlist
            • Vl-modport-portlist
            • Vl-interfacelist
            • Vl-initiallist
            • Vl-genvarlist
            • Vl-fwdtypedeflist
            • Vl-evatomlist
            • Vl-enumitemlist
            • Vl-distlist
            • Vl-configlist
            • Vl-alwayslist
            • Vl-aliaslist
            • Vl-regularportlist
            • Vl-rangelist-list
            • Vl-rangelist
            • Vl-paramdecllist-list
            • Vl-modelementlist
            • Vl-maybe-range-list
            • Vl-interfaceportlist
            • Vl-argumentlist
            • Data-types
          • Getting-started
          • Utilities
          • Loader
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-context

    Vl-pp-ctxelement-summary

    Print a short, human-friendly description of a vl-ctxelement-p.

    Signature
    (vl-pp-ctxelement-summary x &key (withloc 'nil) (ps 'ps)) → ps
    Arguments
    x — Guard (vl-ctxelement-p x).
    withloc — Ensure that a location is printed. By default we generally hide location numbers and simply say things like, "Assignment to foo." However, in some cases it's useful to ensure that a location gets printed, e.g., for multidrive warnings.

    Definitions and Theorems

    Function: vl-pp-ctxelement-summary-fn

    (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: vl-pp-ctxelement-summary-fn-of-vl-ctxelement-fix-x

    (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: vl-pp-ctxelement-summary-fn-vl-ctxelement-equiv-congruence-on-x

    (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)