• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Vl-loadstate
          • Lexer
          • Parser
          • Vl-load-merge-descriptions
          • Vl-find-basename/extension
          • Vl-load-file
          • Vl-loadresult
          • Scope-of-defines
          • Vl-find-file
          • Vl-flush-out-descriptions
          • Vl-description
          • Vl-read-file
          • Vl-includeskips-report-gather
          • Vl-load-main
          • Extended-characters
          • Vl-load
          • Vl-load-description
          • Vl-descriptions-left-to-load
          • Inject-warnings
          • Vl-preprocess-debug
          • Vl-write-preprocessor-debug-file
          • Vl-read-file-report-gather
          • Vl-load-descriptions
          • Vl-load-files
          • Translate-off
            • Vl-scary-translate-comment-p
              • Vl-commentmap-translate-off-warnings
            • Vl-load-read-file-hook
            • Vl-read-file-report
            • Vl-loadstate-pad
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-loadstate->warnings
            • Vl-iskips-report
            • Vl-descriptionlist
          • Warnings
          • Getting-started
          • Utilities
          • Printer
          • Kit
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Translate-off

    Vl-scary-translate-comment-p

    Recognize special translate_off or translate-on comments.

    Signature
    (vl-scary-translate-comment-p x) → *
    Arguments
    x — Guard (stringp x).

    It seems as though different tools have different syntax for this. From internet searches, it appears that at least the following may be used by different tools:

    • // synopsys translate_off
    • // synthesis translate_off
    • // pragma translate_off
    • // exemplar translate_off
    • // cadence translate_off

    As well as translate_on versions of the above, as well as /*...*/-style instead of //-style comments. The above may well be incomplete.

    Well, it seems pretty reasonable to just flag any comment that mentions translate_on or translate_off.

    Definitions and Theorems

    Function: vl-scary-translate-comment-p

    (defun vl-scary-translate-comment-p (x)
      (declare (xargs :guard (stringp x)))
      (let ((__function__ 'vl-scary-translate-comment-p))
        (declare (ignorable __function__))
        (or (str::substrp "translate_on" x)
            (str::substrp "translate_off" x))))