• 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
          • Vls-commands
          • Vl-descriptionlist-summaries
          • Vls-transdb
          • File-layout
          • Vls-data-p
          • Ts-queue
          • Vls-showloc
          • Vls-get-plainsrc
            • Vl-description->warnings
            • Vl-describe
            • Vls-port-table
            • Vls-describe
            • Vls-data-from-translation
            • Vl-find-description-insensitive
            • Vls-get-warnings
            • Vls-get-summary
            • Vls-get-origsrc
            • Vls-data-origname-reportcard
            • Vls-get-parents
            • Vls-get-children
            • Vls-get-summaries
            • Vl-ppc-description
            • Vls-get-desctypes
            • Vl-description-summary
            • Start
            • Vl-descalist->descriptions/types
            • Stop
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Server

    Vls-get-plainsrc

    Signature
    (vls-get-plainsrc origname data) → ans
    Arguments
    origname — Guard (stringp origname).
    data — Guard (vls-data-p data).
    Returns
    ans — Type (stringp ans).

    Definitions and Theorems

    Function: vls-get-plainsrc

    (defun vls-get-plainsrc (origname data)
     (declare (xargs :guard (and (stringp origname)
                                 (vls-data-p data))))
     (let ((__function__ 'vls-get-plainsrc))
      (declare (ignorable __function__))
      (b*
       (((vls-data data))
        (desc (cdr (hons-assoc-equal origname data.orig-descalist)))
        ((unless desc)
         (cat "Error: " origname " not found."))
        (minloc (vl-description->minloc desc))
        (maxloc (vl-description->maxloc desc))
        (maxloc
         (change-vl-location
             maxloc
             :col (nfix (+ (vl-location->col maxloc)
                           (case (tag desc)
                                 (:vl-module (length "endmodule"))
                                 (:vl-udp (length "endprimitive"))
                                 (:vl-interface (length "endinterface"))
                                 (:vl-package (length "endpackage"))
                                 (:vl-program (length "endprogram"))
                                 (:vl-config (length "endconfig"))
                                 (otherwise 0))))))
        (filename (vl-location->filename minloc))
        ((unless (equal filename
                        (vl-location->filename maxloc)))
         (cat "Error: " origname
              " starts/ends in different files?"))
        (filemap (vls-data->filemap data))
        (lookup (hons-assoc-equal filename filemap))
        ((unless lookup)
         (cat "Error: "
              origname " not found in the filemap."))
        (result (vl-string-between-locs (cdr lookup)
                                        minloc maxloc))
        ((unless result)
         (cat "Error: invalid locations for "
              origname)))
       result)))

    Theorem: stringp-of-vls-get-plainsrc

    (defthm stringp-of-vls-get-plainsrc
      (b* ((ans (vls-get-plainsrc origname data)))
        (stringp ans))
      :rule-classes :type-prescription)