• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Lexer
          • Vl-loadstate
          • Parser
            • Parse-expressions
            • Parse-udps
            • Vl-genelements
            • Parse-paramdecls
            • Parse-blockitems
            • Parse-utils
            • Parse-insts
            • Parse-datatype
            • Parse-functions
            • Parse-datatypes
            • Parse-strengths
            • Vl-parse-genvar-declaration
            • Vl-parse
            • Parse-ports
              • Parse-port-types
              • Sv-ansi-portdecls
                • Vl-parsed-ansi-port-p
                • Vl-parse-ansi-port-header
                • Vl-parse-ansi-port-declaration
                  • Vl-parse-1+-ansi-port-declarations
                  • Vl-parsed-interface-head
                  • Vl-parse-optional-port-direction
                  • Vl-parsed-ansi-portlist-p
                  • Vl-parsed-ansi-head
                  • *vl-directions-kwds*
                  • *vl-directions-kwd-alist*
                • Creating-portdecls/vardecls
                • Sv-non-ansi-portdecls
                • Verilog-2005-ports
                • Sv-ansi-port-interpretation
                • Verilog-2005-portdecls
              • Seq
              • Parse-packages
            • Vl-load-merge-descriptions
            • Scope-of-defines
            • Vl-load-file
            • Vl-flush-out-descriptions
            • Vl-description
            • Vl-loadresult
            • Vl-read-file
            • Vl-find-basename/extension
            • Vl-find-file
            • Vl-read-files
            • Extended-characters
            • Vl-load
            • Vl-load-main
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-load-descriptions
            • Vl-load-files
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-descriptionlist
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Sv-ansi-portdecls

    Vl-parse-ansi-port-declaration

    Matches ansi_port_declaration.

    Signature
    (vl-parse-ansi-port-declaration atts &key (tokstream 'tokstream) 
                                    (config 'config)) 
     
      → 
    (mv errmsg? value new-tokstream)
    Arguments
    config — Guard (vl-loadconfig-p config).

    Definitions and Theorems

    Function: vl-parse-ansi-port-declaration-fn

    (defun vl-parse-ansi-port-declaration-fn (atts tokstream config)
     (declare (xargs :stobjs (tokstream)))
     (declare (xargs :guard (vl-loadconfig-p config)))
     (declare (ignorable config))
     (declare (xargs :guard (vl-atts-p atts)))
     (let ((__function__ 'vl-parse-ansi-port-declaration))
      (declare (ignorable __function__))
      (seq
       tokstream
       (dir := (vl-parse-optional-port-direction))
       (when
          dir
          (head := (vl-parse-port-declaration-head-2012))
          (id := (vl-match-token :vl-idtoken))
          (udims := (vl-parse-0+-variable-dimensions))
          (return
               (make-vl-parsed-ansi-port
                    :dir dir
                    :atts atts
                    :head head
                    :id (make-vl-parsed-port-identifier :name id
                                                        :udims udims))))
       (head := (vl-parse-ansi-port-header))
       (id := (vl-match-token :vl-idtoken))
       (udims := (vl-parse-0+-variable-dimensions))
       (return
            (make-vl-parsed-ansi-port
                 :dir nil
                 :head head
                 :atts atts
                 :id (make-vl-parsed-port-identifier :name id
                                                     :udims udims))))))

    Theorem: vl-parse-ansi-port-declaration-fails-gracefully

    (defthm vl-parse-ansi-port-declaration-fails-gracefully
      (implies (mv-nth 0 (vl-parse-ansi-port-declaration atts))
               (not (mv-nth 1
                            (vl-parse-ansi-port-declaration atts)))))

    Theorem: vl-warning-p-of-vl-parse-ansi-port-declaration

    (defthm vl-warning-p-of-vl-parse-ansi-port-declaration
      (iff (vl-warning-p (mv-nth 0
                                 (vl-parse-ansi-port-declaration atts)))
           (mv-nth 0
                   (vl-parse-ansi-port-declaration atts))))

    Theorem: vl-parse-ansi-port-declaration-result

    (defthm vl-parse-ansi-port-declaration-result
     (implies
          (and (force (vl-atts-p atts)))
          (equal (vl-parsed-ansi-port-p
                      (mv-nth 1
                              (vl-parse-ansi-port-declaration atts)))
                 (not (mv-nth 0
                              (vl-parse-ansi-port-declaration atts))))))

    Theorem: vl-parse-ansi-port-declaration-count-strong

    (defthm vl-parse-ansi-port-declaration-count-strong
     (and
      (<=
         (vl-tokstream-measure
              :tokstream (mv-nth 2
                                 (vl-parse-ansi-port-declaration atts)))
         (vl-tokstream-measure))
      (implies
       (not (mv-nth 0
                    (vl-parse-ansi-port-declaration atts)))
       (<
         (vl-tokstream-measure
              :tokstream (mv-nth 2
                                 (vl-parse-ansi-port-declaration atts)))
         (vl-tokstream-measure))))
     :rule-classes ((:rewrite) (:linear)))