• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Vwsim
      • Fgl
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
          • Ps
          • Verilog-printing
            • Vl-pp-expr
            • Vl-fmt
            • Vl-progindent
            • Vl-ppc-module
            • Vl-mimic-linestart
            • Vl-maybe-escape-identifier
            • Vl-print-ext-wirename
            • Vl-maybe-strip-outer-linestart
            • Vl-print-wirename
            • Vl-print-loc
              • Vl-pp-module
              • Vl-pp-describe
              • Vl-print-modname
              • Vl-pp-genblob-guts
              • Vl-pp-origexpr
              • Vl-pp-modinst
              • Vl-pps-module
              • Vl-ppc-modulelist
              • Vl-pp-interface
              • Vl-pps-expr
              • Vl-pp-modulename-link
              • Vl-binaryop-precedence
              • Vl-pp-genblob
              • Vl-ppcs-module
              • Vl-pp-paramdecl
              • Vl-pp-package
              • Vl-pp-modulename-link-aux
              • Vl-pp-modelement
              • Vl-pp-interfacelist
              • Vl-pp-bind
              • Vl-pp-arguments
              • Vl-ps-update-mimic-linebreaks
              • Vl-pp-vardecl-aux
              • Vl-pp-repetition
              • Vl-pp-packagelist
              • Vl-pp-modulelist
              • Vl-pp-modinstlist
              • Vl-pp-definition-scope-summary
              • Vl-pp-bindlist
              • Vl-maybe-escape-string
              • Vl-ps-update-show-atts
              • Vl-pps-modulelist
              • Vl-ppcs-modulelist
              • Vl-pp-portdecl
              • Vl-pp-ansi-portdecl
              • Vl-cw-obj
              • Vl-ps-update-copious-parens
              • Vl-pps-origexpr
              • Vl-pp-vardecl-atts-begin
              • Vl-pp-propport
              • Vl-pp-gateinst-atts-begin
              • Vl-pp-gatedelay
              • Vl-pp-foreachstmt-loopvars
              • Vl-pp-dpiimport
              • Vl-pp-clkdecl
              • Vl-gatetype-string
              • Vl-coretypename-string
              • Vl-atts-find-paramname
              • Vl-randomqualifier-string
              • Vl-ps-update-use-origexprs
              • Vl-pp-vardecl-atts-end
              • Vl-pp-taskdecl
              • Vl-pp-scope-summary
              • Vl-pp-namedparamvaluelist
              • Vl-pp-modinst-atts-begin
              • Vl-pp-gatestrength
              • Vl-pp-gateinst
              • Vl-pp-fundecl
              • Vl-nettypename-string
              • Vl-fwdtypedefkind-string
              • Vl-expr-precedence
              • Vl-distweighttype-string
              • Vl-assertdeferral-string
              • Vl-pp-vardecllist-comma-separated
              • Vl-pp-repeateventcontrol
              • Vl-pp-regularport
              • Vl-pp-plainarglist
              • Vl-pp-plainarg
              • Vl-pp-paramvaluelist
              • Vl-pp-namedarglist
              • Vl-pp-modport-port
              • Vl-pp-interfaceport
              • Vl-pp-forloop-assigns
              • Vl-pp-exprdistlist-with-commas
              • Vl-pp-dpiexport
              • Vl-pp-distitem
              • Vl-pp-design
              • Vl-pp-delayoreventcontrol
              • Vl-pp-assign
              • Vl-blocktype-startstring
              • Vl-blocktype-endstring
              • Vl-asserttype-string
              • Vl-alwaystype-string
              • Vl-pp-vardecllist-indented
              • Vl-pp-typedeflist-indented
              • Vl-pp-typedef
              • Vl-pp-set-portnames
              • Vl-pp-sequence
              • Vl-pp-scopetype
              • Vl-pp-regularportlist
              • Vl-pp-propspec
              • Vl-pp-property
              • Vl-pp-paramdecllist-indented
              • Vl-pp-namedparamvalue
              • Vl-pp-namedarg
              • Vl-pp-modport-portlist
              • Vl-pp-interfaceportlist
              • Vl-pp-delaycontrol
              • Vl-pp-defaultdisablelist
              • Vl-pp-defaultdisable
              • Vl-pp-covergroup
              • Vl-pp-constint
              • Vl-pp-clkskew
              • Vl-pp-clkassign
              • Vl-leftright-string
              • Vl-direction-string
              • Vl-cstrength-string
              • Vl-casetype-string
              • Vl-casecheck-string
              • Vl-pp-taskdecllist
              • Vl-pp-specialkey
              • Vl-pp-scopename
              • Vl-pp-rhs
              • Vl-pp-propportlist
              • Vl-pp-program
              • Vl-pp-paramdecllist
              • Vl-pp-paramargs
              • Vl-pp-modelementlist
              • Vl-pp-importlist-indented
              • Vl-pp-import
              • Vl-pp-gclkdecl
              • Vl-pp-fwdtypedeflist
              • Vl-pp-fwdtypedef
              • Vl-pp-exprdist
              • Vl-pp-eventcontrol
              • Vl-pp-dpiimportlist
              • Vl-pp-dpiexportlist
              • Vl-pp-covergrouplist
              • Vl-pp-clkassignlist
              • Vl-pp-class
              • Vl-pp-cassertionlist
              • Vl-pp-assertionlist
              • Vl-pp-alias
              • Vl-vardecl-hiddenp
              • Vl-pps-range
              • Vl-pp-weirdint
              • Vl-pp-vardecllist
              • Vl-pp-value
              • Vl-pp-udp
              • Vl-pp-typedeflist
              • Vl-pp-string
              • Vl-pp-sequencelist
              • Vl-pp-rangelist
              • Vl-pp-propertylist
              • Vl-pp-programlist
              • Vl-pp-portlist
              • Vl-pp-portdecllist
              • Vl-pp-paramvalue
              • Vl-pp-modport
              • Vl-pp-lifetime
              • Vl-pp-initiallist
              • Vl-pp-initial
              • Vl-pp-importlist
              • Vl-pp-genvar
              • Vl-pp-gclkdecllist
              • Vl-pp-gateinstlist
              • Vl-pp-fundecllist
              • Vl-pp-finallist
              • Vl-pp-extint
              • Vl-pp-elabtasklist
              • Vl-pp-distlist
              • Vl-pp-configlist
              • Vl-pp-config
              • Vl-pp-clkdecllist
              • Vl-pp-classlist
              • Vl-pp-assignlist
              • Vl-pp-alwayslist
              • Vl-pp-always
              • Vl-pp-vardecl
              • Vl-pp-udplist
              • Vl-pp-time
              • Vl-pp-real
              • Vl-pp-port
              • Vl-pp-final
              • Vl-pp-elabtask
              • Vl-lifetime-string
              • Vl-expr-dollarsign-p
              • Vl-dpispec->string
              • Vl-dpiprop->string
              • Vl-dpifntask->string
              • Vl-ps->copious-parens-p
              • Vl-ps->show-atts-p
              • Vl-ps->mimic-linebreaks-p
              • Vl-ps->use-origexprs-p
              • Vl-progindent-block-start
              • Vl-progindent-block-end
              • Vl-cw
            • Basic-printing
            • Printing-locally
            • Formatted-printing
            • Accessing-printed-output
            • Json-printing
            • Vl-printedlist
          • Kit
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Verilog-printing

    Vl-print-loc

    (vl-print-loc x &key (ps 'ps)) prints a vl-location-p.

    Signature
    (vl-print-loc x &key (ps 'ps)) → ps
    Arguments
    x — Guard (vl-location-p x).

    In text mode, this function basically prints the string produced by vl-location-string. But when HTML mode is active, we instead print something along the lines of:

    <a class="vl_loclink"
       href="javascript:void(0);"
       onClick="showLoc('foo', 'line', 'col')">
      foo:line:col
    </a>

    This function is used in various warning messages, reports, and other displays. The module browser's web pages are responsible for defining the showLoc function to carry out some sensible behavior.

    Definitions and Theorems

    Function: vl-print-loc-fn

    (defun vl-print-loc-fn (x ps)
     (declare (xargs :stobjs (ps)))
     (declare (xargs :guard (vl-location-p x)))
     (let ((__function__ 'vl-print-loc))
      (declare (ignorable __function__))
      (if (not (vl-ps->htmlp))
          (let* ((str (vl-location-string x))
                 (len (length str))
                 (col (vl-ps->col))
                 (autowrap-col (vl-ps->autowrap-col))
                 (autowrap-ind (vl-ps->autowrap-ind)))
            (cond ((or (< (+ col len) autowrap-col)
                       (< col (+ autowrap-ind 10)))
                   (vl-print-str str))
                  (t (vl-ps-seq (vl-println "")
                                (vl-indent autowrap-ind)
                                (vl-print-str str)))))
       (let* ((filename (vl-location->filename x))
              (line (vl-location->line x))
              (col (vl-location->col x))
              (flen (length filename))
              (last-slash (str::strrpos "/" filename))
              (shortname (if (and last-slash (< last-slash flen))
                             (subseq filename (1+ last-slash) nil)
                           filename)))
        (vl-ps-seq
         (vl-print-markup
          "<a class=\"vl_loclink\" href=\"javascript:void(0);\" onClick=\"showLoc('")
         (vl-print-url (vl-location->filename x))
         (vl-print-markup "', '")
         (vl-print-url line)
         (vl-print-markup "', '")
         (vl-print-url col)
         (vl-print-markup "')\")>")
         (vl-print-str shortname)
         (vl-print-str ":")
         (vl-print-nat line)
         (vl-print-str ":")
         (vl-print-nat col)
         (vl-print-markup "</a>"))))))

    Theorem: vl-print-loc-fn-of-vl-location-fix-x

    (defthm vl-print-loc-fn-of-vl-location-fix-x
      (equal (vl-print-loc-fn (vl-location-fix x) ps)
             (vl-print-loc-fn x ps)))

    Theorem: vl-print-loc-fn-vl-location-equiv-congruence-on-x

    (defthm vl-print-loc-fn-vl-location-equiv-congruence-on-x
      (implies (vl-location-equiv x x-equiv)
               (equal (vl-print-loc-fn x ps)
                      (vl-print-loc-fn x-equiv ps)))
      :rule-classes :congruence)