• 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
          • Basic-printing
            • Vl-println?
            • Vl-printable-p
            • 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-col-after-printing-chars
            • Vl-print-strings-with-commas
            • Vl-col-after-printing-string
            • 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
          • Printing-locally
          • Formatted-printing
          • Accessing-printed-output
          • Json-printing
          • Vl-printedlist
        • Kit
        • Mlib
        • Transforms
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Testing-utilities
    • Math
  • 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)))))
           ((integerp 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.