• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • 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
            • Parse-expressions
            • Parse-udps
            • Parse-statements
            • Parse-property
            • Vl-genelements
            • Parse-paramdecls
            • Parse-blockitems
            • Parse-utils
            • Parse-insts
            • Parse-functions
            • Parse-assignments
            • Parse-clocking
            • Parse-strengths
            • Vl-parse-genvar-declaration
            • Vl-parse
            • Parse-netdecls
            • Parse-asserts
            • Vl-maybe-parse-lifetime
            • Parse-dpi-import-export
              • Vl-warn-about-deprecated-dpi
                • Vl-parse-dpi-import
                • Vl-parse-dpi-export
                • Vl-parse-very-optional-tf-port-list
                • Vl-parse-optional-dpi-function-import-property
                • Vl-parse-c-identifier
                • Vl-parse-dpi-spec-string
                • Vl-interpret-dpi-spec-token
                • Vl-is-dpi-spec-string?
                • Vl-dpi-spec-token-p
              • Parse-ports
              • Parse-timeunits
              • Seq
              • Parse-packages
              • Parse-eventctrl
            • 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-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
    • Parse-dpi-import-export

    Vl-warn-about-deprecated-dpi

    Maybe warn about deprecated DPI imports/exports. Compatible with seq and styled after vl-parse-warning.

    Signature
    (vl-warn-about-deprecated-dpi spec name 
                                  importp &key (tokstream 'tokstream)) 
     
      → 
    (mv errmsg value new-tokstream)
    Arguments
    spec — The "DPI" or "DPI-C" ness of a DPI import/export.
        Guard (vl-dpispec-p spec).
    name — Name of the function being imported/exported.
        Guard (vl-idtoken-p name).
    importp — Are we importing or exporting?.
        Guard (booleanp importp).
    Returns
    errmsg — Never produces an error.
        Type (not errmsg).
    value — Value is always nil.
        Type (not value).

    The SystemVerilog-2012 spec (Section 35.5.4, Page 908) requires implementations to generate a compile time warning or error when "DPI" is used instead of "DPI-C". We create this warning here, if necessary.

    Definitions and Theorems

    Function: vl-warn-about-deprecated-dpi-fn

    (defun vl-warn-about-deprecated-dpi-fn (spec name importp tokstream)
     (declare (xargs :stobjs (tokstream)))
     (declare (xargs :guard (and (vl-dpispec-p spec)
                                 (vl-idtoken-p name)
                                 (booleanp importp))))
     (let ((__function__ 'vl-warn-about-deprecated-dpi))
      (declare (ignorable __function__))
      (b*
       (((unless (vl-dpispec-equiv spec :vl-dpi))
         (mv nil nil tokstream))
        (warning
         (make-vl-warning
          :type :vl-warn-deprecated-dpi
          :msg
          "At ~a0: ~s1 of ~s2: \"DPI\" is deprecated and should ~
                            be replaced with \"DPI-C\", but note that use of the ~
                            \"DPI-C\" string may require changes in the DPI ~
                            application's C code."
          :args (list (vl-token->loc name)
                      (if importp "import" "export")
                      (vl-idtoken->name name))
          :fatalp nil
          :fn __function__))
        (tokstream (vl-tokstream-add-warning warning)))
       (mv nil nil tokstream))))

    Theorem: not-of-vl-warn-about-deprecated-dpi.errmsg

    (defthm not-of-vl-warn-about-deprecated-dpi.errmsg
      (b*
       (((mv ?errmsg acl2::?value ?new-tokstream)
         (vl-warn-about-deprecated-dpi-fn spec name importp tokstream)))
       (not errmsg))
      :rule-classes :rewrite)

    Theorem: not-of-vl-warn-about-deprecated-dpi.value

    (defthm not-of-vl-warn-about-deprecated-dpi.value
      (b*
       (((mv ?errmsg acl2::?value ?new-tokstream)
         (vl-warn-about-deprecated-dpi-fn spec name importp tokstream)))
       (not value))
      :rule-classes :rewrite)

    Theorem: vl-tokstream->tokens-of-vl-warn-about-deprecated-dpi

    (defthm vl-tokstream->tokens-of-vl-warn-about-deprecated-dpi
      (b*
       (((mv ?errmsg acl2::?value ?new-tokstream)
         (vl-warn-about-deprecated-dpi-fn spec name importp tokstream)))
       (equal (vl-tokstream->tokens :tokstream new-tokstream)
              (vl-tokstream->tokens)))
      :rule-classes :rewrite)