• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
          • Vl-module
          • Vl-vardecl
          • Vl-fundecl
          • Vl-interface
          • Vl-design
          • Vl-assign
          • Vl-modinst
          • Vl-gateinst
          • Vl-taskdecl
          • Vl-portdecl
          • Vl-commentmap
          • Vl-dpiimport
          • Vl-ansi-portdecl
          • Vl-package
          • Vl-paramdecl
          • Vl-dpiexport
          • Vl-class
          • Vl-sort-blockitems-aux
          • Vl-plainarglist->exprs
          • Vl-taskdecllist->names
          • Expressions-and-datatypes
          • Vl-fundecllist->names
          • Vl-udp
          • Vl-port
          • Vl-genelement
          • Vl-clkdecl
          • Vl-parse-temps
          • Vl-bind
          • Vl-namedarg
          • Vl-exprdist
          • Vl-clkassign
          • Vl-range
          • Vl-propport
          • Vl-typedef
          • Vl-gatedelay
          • Vl-dimension
          • Vl-sequence
          • Vl-clkskew
          • Vl-program
          • Vl-gatestrength
          • Vl-property
          • Vl-config
          • Vl-always
          • Vl-import
          • Vl-repeateventcontrol
          • Vl-timeliteral
          • Vl-initial
          • Vl-eventcontrol
          • Vl-final
          • Vl-udpsymbol-p
          • Vl-maybe-clkskew
          • Vl-function-specialization
          • Vl-alias
          • Vl-maybe-nettypename
          • Vl-maybe-gatedelay
          • Vl-letdecl
          • Vl-direction-p
          • Vl-modelement
          • Vl-maybe-timeprecisiondecl
          • Vl-maybe-scopeid
          • Vl-maybe-gatestrength
          • Vl-maybe-direction
          • Vl-maybe-delayoreventcontrol
          • Vl-gclkdecl
          • Vl-fwdtypedef
          • Vl-maybe-udpsymbol-p
          • Vl-maybe-timeunitdecl
          • Vl-maybe-timeliteral
          • Vl-maybe-parse-temps
          • Vl-maybe-cstrength
          • Vl-arguments
          • Vl-maybe-module
          • Vl-maybe-design
          • Vl-covergroup
          • Vl-udpline
          • Vl-timeunitdecl
          • Vl-genvar
          • Vl-defaultdisable
          • Vl-context1
          • Vl-timeprecisiondecl
          • Vl-sort-blockitems
          • Vl-elabtask
          • Vl-udpedge
          • Vl-delaycontrol
          • Vl-context
            • Vl-pp-ctxelement-summary
              • Ctxexprs
              • Vl-pp-ctxelement-full
              • Vl-context-fix
              • Vl-ctxelement-summary
              • Vl-context-summary
              • Vl-context-p
              • Vl-pp-context-summary
              • Vl-pp-context-full
            • Vl-ctxelement
            • Vl-ctxelement->loc
            • Vl-modelement->loc
            • Statements
            • Vl-blockitem
            • Vl-vardecllist
            • Vl-interface->ifports
            • Vl-syntaxversion
            • Vl-nettypename-p
            • Vl-module->ifports
            • Vl-lifetime-p
            • Vl-paramdecllist
            • Vl-modelementlist->genelements
            • Vl-importlist
            • Vl-typedeflist
            • Vl-gatetype-p
            • Vl-cstrength-p
            • Vl-port->name
            • Vl-genelement->loc
            • Vl-delayoreventcontrol
            • Vl-udpentry-p
            • Vl-portdecllist
            • Vl-elabtask->loc
            • Property-expressions
            • Vl-taskdecllist
            • Vl-port->loc
            • Vl-fundecllist
            • Vl-sequencelist
            • Vl-propertylist
            • Vl-portlist
            • Vl-dpiimportlist
            • Vl-dpiexportlist
            • Vl-classlist
            • Vl-arguments->args
            • Vl-alwaystype-p
            • Vl-modinstlist
            • Vl-importpart-p
            • Vl-importpart-fix
            • Vl-bindlist
            • Vl-initiallist
            • Vl-genvarlist
            • Vl-gclkdecllist
            • Vl-function-specialization-map
            • Vl-finallist
            • Vl-elabtasklist
            • Vl-defaultdisablelist
            • Vl-clkdecllist
            • Vl-cassertionlist
            • Vl-blockstmt-p
            • Vl-assignlist
            • Vl-assertionlist
            • Vl-alwayslist
            • Vl-aliaslist
            • Vl-udptable
            • Vl-udplist
            • Vl-udpentrylist
            • Vl-propportlist
            • Vl-programlist
            • Vl-packagelist
            • Vl-namedarglist
            • Vl-modulelist
            • Vl-modportlist
            • Vl-modport-portlist
            • Vl-letdecllist
            • Vl-interfacelist
            • Vl-gateinstlist
            • Vl-fwdtypedeflist
            • Vl-covergrouplist
            • Vl-configlist
            • Vl-clkassignlist
            • Vl-blockitemlist
            • Vl-ansi-portdecllist
            • Vl-regularportlist
            • Vl-paramdecllist-list
            • Vl-modelementlist
            • Vl-interfaceportlist
            • Vl-casekey-p
            • Sv::maybe-4veclist
          • Loader
          • Warnings
          • Getting-started
          • Utilities
          • Printer
          • Kit
          • Mlib
          • Transforms
        • 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-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: 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)