• 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
              • Creating-portdecls/vardecls
              • Sv-non-ansi-portdecls
              • Verilog-2005-ports
              • Sv-ansi-port-interpretation
              • Verilog-2005-portdecls
                • Vl-parse-basic-port-declaration-tail
                • Vl-parse-port-declaration-noatts-2005
                • Vl-parse-port-declaration-atts-2005
                • Vl-parse-1+-port-declarations-separated-by-commas-2005
                • Vl-parse-1+-identifiers-separated-by-commas
                • Vl-parse-port-declaration-noatts
                • Vl-parse-module-port-list-top-2005
                  • Vl-parse-output-reg-port-tail
              • 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
    • Verilog-2005-portdecls

    Vl-parse-module-port-list-top-2005

    Verilog-2005 only. Top-level function for parsing port lists in both ANSI and non-ANSI styles.

    Signature
    (vl-parse-module-port-list-top-2005 &key (tokstream 'tokstream) 
                                        (config 'config)) 
     
      → 
    (mv errmsg? value new-tokstream)
    Arguments
    config — Guard (vl-loadconfig-p config).

    See verilog-2005-ports and verilog-2005-portdecls. We match the following, contrived grammar rule:

    vl_module_port_list ::= list_of_ports
                          | [list_of_port_declarations]

    We can tell which variant we are following because a port_declaration must begin with one of:

    (*
    input
    output
    inout

    Definitions and Theorems

    Function: vl-parse-module-port-list-top-2005-fn

    (defun vl-parse-module-port-list-top-2005-fn (tokstream config)
     (declare (xargs :stobjs (tokstream)))
     (declare (xargs :guard (vl-loadconfig-p config)))
     (declare (ignorable config))
     (let ((__function__ 'vl-parse-module-port-list-top-2005))
      (declare (ignorable __function__))
      (seq
       tokstream
       (unless (vl-is-token? :vl-lparen)
               (return (make-vl-parsed-ports :ansi-p nil
                                             :ports nil
                                             :portdecls nil
                                             :vardecls nil)))
       (:= (vl-match))
       (when (vl-is-token? :vl-rparen)
             (:= (vl-match-token :vl-rparen))
             (return (make-vl-parsed-ports :ansi-p nil
                                           :ports nil
                                           :portdecls nil
                                           :vardecls nil)))
       (when
           (vl-is-some-token?
                '(:vl-kwd-output :vl-kwd-input
                                 :vl-kwd-inout :vl-beginattr))
           ((portdecls . vardecls)
            := (vl-parse-1+-port-declarations-separated-by-commas-2005))
           (:= (vl-match-token :vl-rparen))
           (return (make-vl-parsed-ports
                        :ansi-p t
                        :ports (vl-ports-from-portdecls portdecls)
                        :portdecls portdecls
                        :vardecls vardecls)))
       (ports := (vl-parse-1+-ports-separated-by-commas))
       (:= (vl-match-token :vl-rparen))
       (return (make-vl-parsed-ports :ansi-p nil
                                     :ports ports
                                     :portdecls nil
                                     :vardecls nil)))))

    Theorem: vl-parse-module-port-list-top-2005-fails-gracefully

    (defthm vl-parse-module-port-list-top-2005-fails-gracefully
      (implies (mv-nth 0 (vl-parse-module-port-list-top-2005))
               (not (mv-nth 1
                            (vl-parse-module-port-list-top-2005)))))

    Theorem: vl-warning-p-of-vl-parse-module-port-list-top-2005

    (defthm vl-warning-p-of-vl-parse-module-port-list-top-2005
     (iff (vl-warning-p (mv-nth 0 (vl-parse-module-port-list-top-2005)))
          (mv-nth 0
                  (vl-parse-module-port-list-top-2005))))

    Theorem: vl-parse-module-port-list-top-2005-result

    (defthm vl-parse-module-port-list-top-2005-result
      (implies
           (and t)
           (equal (vl-parsed-ports-p
                       (mv-nth 1 (vl-parse-module-port-list-top-2005)))
                  (not (mv-nth 0
                               (vl-parse-module-port-list-top-2005))))))

    Theorem: vl-parse-module-port-list-top-2005-count-weak

    (defthm vl-parse-module-port-list-top-2005-count-weak
     (<=
        (vl-tokstream-measure
             :tokstream (mv-nth 2 (vl-parse-module-port-list-top-2005)))
        (vl-tokstream-measure))
     :rule-classes ((:rewrite) (:linear)))