• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
        • Mlib
        • Server
        • Kit
        • Printer
          • Ps
          • Basic-printing
            • Vl-println?
            • Vl-print
              • Vl-print-raw-fast
              • Vl-print-charlist-main
              • Vl-print-str-main
              • Vl-print-main
              • Vl-print-non-string
              • Vl-print-str
            • Vl-printable-p
            • Vl-col-after-printing-string
            • Vl-col-after-printing-chars
            • Vl-print-strings-with-commas
            • Vl-string-needs-html-encoding-p
            • Vl-println-markup
            • Vl-print-strings-as-lines
            • Vl-print-url
            • Vl-print-nat
            • Vl-indent
            • Vl-println
            • Vl-print-markup
            • Vl-ps-seq
            • Vl-cw-ps-seq
            • Vl-when-html
            • Vl-ps-span
          • Verilog-printing
          • Printing-locally
          • Formatted-printing
          • Accessing-printed-output
          • Vl-printedlist
          • Json-printing
        • Esim-vl
        • Well-formedness
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Basic-printing

Vl-print

(vl-print x) prints text with automatic encoding.

x may be any vl-printable-p object, and we print it to ps. In text mode, the characters for the printed representation of x are printed verbatim. In HTML mode, we automatically encode characters like & into &. See also vl-print-markup and vl-print-url for alternatives that perform different kinds of encoding.

Note: this function ignores ps's print-base and always prints in base 10!

Macro: vl-print

(defmacro vl-print (x)
  (cond ((equal x "") 'ps)
        ((stringp x)
         (if (vl-string-needs-html-encoding-p x 0 (length x))
             (cons 'vl-print-str (cons x 'nil))
           (cons 'vl-print-raw-fast
                 (cons x (cons (length x) 'nil)))))
        ((natp x)
         (cons 'vl-print-nat (cons x 'nil)))
        (t (cons 'vl-print-main (cons x 'nil)))))

Subtopics

Vl-print-raw-fast
Fancy hack for printing string literals.
Vl-print-charlist-main
Vl-print-str-main
Vl-print-main
Vl-print-non-string
Wrapper that makes it more reasonable to inline vl-print-main.
Vl-print-str
(vl-print-str x) is an optimized version of vl-print for strings.