• 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
                • Vl-parse-port-declaration-noatts-2012
                  • Vl-parse-port-declaration-noatts
                  • Vl-parse-list-of-port-identifiers
                  • Vl-parsed-portdecl-head->complete-p
                • 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-non-ansi-portdecls

    Vl-parse-port-declaration-noatts-2012

    Matches the rest of any port_declaration, after the attributes.

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

    BOZO many, many subtle questions here about the net types we're supposed to use here. See the comments.

    Definitions and Theorems

    Function: vl-parse-port-declaration-noatts-2012-fn

    (defun vl-parse-port-declaration-noatts-2012-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-port-declaration-noatts-2012))
      (declare (ignorable __function__))
      (seq
       tokstream
       (when
        (vl-is-token? :vl-kwd-inout)
        (:= (vl-match))
        (head := (vl-parse-port-declaration-head-2012))
        (when
         (vl-parsed-portdecl-head->var-p head)
         (return-raw
          (vl-parse-error
           "Inout ports cannot have variable types, they must be nets.")))
        (pids := (vl-parse-list-of-port-identifiers))
        (return
           (b* (((vl-parsed-portdecl-head head)))
             (vl-make-ports-and-maybe-nets
                  pids
                  :dir :vl-inout
                  :nettype (or head.nettype :vl-wire)
                  :type head.type
                  :complete-p (vl-parsed-portdecl-head->complete-p head)
                  :atts atts))))
       (when
        (vl-is-token? :vl-kwd-input)
        (:= (vl-match))
        (head := (vl-parse-port-declaration-head-2012))
        (pids := (vl-parse-list-of-port-identifiers))
        (return
           (b* (((vl-parsed-portdecl-head head)))
             (vl-make-ports-and-maybe-nets
                  pids :dir :vl-input :nettype
                  (if head.var-p nil
                    (or head.nettype :vl-wire))
                  :type head.type
                  :complete-p (vl-parsed-portdecl-head->complete-p head)
                  :atts atts))))
       (when
        (vl-is-token? :vl-kwd-output)
        (:= (vl-match))
        (head := (vl-parse-port-declaration-head-2012))
        (pids := (vl-parse-list-of-port-identifiers))
        (return
           (b* (((vl-parsed-portdecl-head head)))
             (vl-make-ports-and-maybe-nets
                  pids
                  :dir :vl-output
                  :nettype (cond (head.var-p nil)
                                 (head.nettype head.nettype)
                                 (head.explicit-p nil)
                                 (t :vl-wire))
                  :type head.type
                  :complete-p (vl-parsed-portdecl-head->complete-p head)
                  :atts atts))))
       (when
        (vl-is-token? :vl-kwd-ref)
        (return-raw
            (vl-parse-error "BOZO ref ports are not yet implemented.")))
       (:= (vl-match-token :vl-idtoken))
       (return-raw
            (vl-parse-error
                 "BOZO interface ports are not yet implemented.")))))

    Theorem: vl-parse-port-declaration-noatts-2012-fails-gracefully

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

    Theorem: vl-warning-p-of-vl-parse-port-declaration-noatts-2012

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

    Theorem: vl-parse-port-declaration-noatts-2012-result

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

    Theorem: vl-parse-port-declaration-noatts-2012-count-strong

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

    Theorem: true-listp-of-vl-parse-port-declaration-noatts-2012-1

    (defthm true-listp-of-vl-parse-port-declaration-noatts-2012-1
      (true-listp
           (car (mv-nth 1
                        (vl-parse-port-declaration-noatts-2012 atts))))
      :rule-classes :type-prescription)

    Theorem: true-listp-of-vl-parse-port-declaration-noatts-2012-2

    (defthm true-listp-of-vl-parse-port-declaration-noatts-2012-2
      (true-listp
           (cdr (mv-nth 1
                        (vl-parse-port-declaration-noatts-2012 atts))))
      :rule-classes :type-prescription)

    Theorem: vl-parse-port-declaration-noatts-2012-basics

    (defthm vl-parse-port-declaration-noatts-2012-basics
     (and
      (vl-portdecllist-p
           (car (mv-nth 1
                        (vl-parse-port-declaration-noatts-2012 atts))))
      (vl-vardecllist-p
          (cdr (mv-nth 1
                       (vl-parse-port-declaration-noatts-2012 atts))))))