• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
          • Ps
          • Verilog-printing
          • Basic-printing
          • Printing-locally
            • Vl-psconfig-p
            • Vl-ps-full-reset
            • Vl-ps-save-config
            • Vl-ps-load-config
            • Vl-ps-text-reset
            • With-local-ps
          • Formatted-printing
          • Accessing-printed-output
          • Json-printing
          • Vl-printedlist
        • Kit
        • Mlib
        • Transforms
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Printer

Printing-locally

How to use ps to build strings in a local context.

A disadvantage of using a stobj to represent the printer's state is that it is generally non-instantiable, which makes localized string building more difficult because printing from one function may interfere with printing from another.

We provide two mechanisms for coping with this.

The recommended approach is to use with-local-ps, which in turn uses with-local-stobj to give you a temporary ps to work with.

An alternative, which we do not often use, is to explicitly manage saving and restoring of the printer's state. To support this, we provide some routines for saving and restoring configurations, and for resetting the printer's fields.

Subtopics

Vl-psconfig-p
Configuration object for saving and loading printer state.
Vl-ps-full-reset
Erase all contents and reset ps to its default configuration.
Vl-ps-save-config
Save the current configuration of ps into a vl-psconfig-p object.
Vl-ps-load-config
Load configuration settings from a vl-psconfig-p object into ps.
Vl-ps-text-reset
Erase the contents of ps without altering its configuration.
With-local-ps
Print using a local instance of ps.