• 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
              • Vl-build-netdecls
              • Vl-parse-net-declaration-finish
                • Vl-parse-net-declaration
                • Vl-build-netdecls-aux
                • Vl-parse-list-of-net-identifiers
                • Vl-parse-netdecltype
                • Vl-netdecls-error
                • Vl-parse-optional-nettype
                • Vl-atomify-assignpairs
                • Vl-rangelist-list
                • Vl-netdeclassigns-check-array-assigns
                • Vl-netdeclassigns-characterize
              • Parse-asserts
              • Vl-maybe-parse-lifetime
              • Parse-dpi-import-export
              • 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-netdecls

    Vl-parse-net-declaration-finish

    Signature
    (vl-parse-net-declaration-finish 
         nettype loc strength rtype 
         type atts &key (tokstream 'tokstream) 
         (config 'config)) 
     
      → 
    (mv errmsg? value new-tokstream)
    Arguments
    config — Guard (vl-loadconfig-p config).

    Definitions and Theorems

    Function: vl-parse-net-declaration-finish-fn

    (defun vl-parse-net-declaration-finish-fn
           (nettype loc strength
                    rtype type atts tokstream config)
     (declare (xargs :stobjs (tokstream)))
     (declare (xargs :guard (vl-loadconfig-p config)))
     (declare (ignorable config))
     (declare (xargs :guard (and (vl-nettypename-p nettype)
                                 (vl-location-p loc)
                                 (or (not strength)
                                     (vl-gatestrength-p strength)
                                     (vl-cstrength-p strength))
                                 (or (not rtype) (vl-token-p rtype))
                                 (vl-datatype-p type)
                                 (vl-atts-p atts))))
     (let ((__function__ 'vl-parse-net-declaration-finish))
      (declare (ignorable __function__))
      (seq
       tokstream
       (when (vl-is-token? :vl-pound)
             (delay := (vl-parse-delay3)))
       (declassigns
         := (vl-parse-1+-variable-decl-assignments-separated-by-commas))
       (:= (vl-match-token :vl-semi))
       (return-raw
         (b*
          ((vectoredp (vl-is-token-of-type-p rtype :vl-kwd-vectored))
           (scalaredp (vl-is-token-of-type-p rtype :vl-kwd-scalared))
           (gstrength (vl-disabled-gstrength strength))
           (cstrength (vl-disabled-cstrength strength))
           (errorstr
                (vl-netdecls-error nettype cstrength gstrength vectoredp
                                   scalaredp type delay declassigns))
           ((when errorstr)
            (vl-parse-error errorstr))
           ((mv decls assigns)
            (vl-build-netdecls loc
                               declassigns nettype type atts vectoredp
                               scalaredp delay cstrength gstrength)))
          (mv nil (cons assigns decls)
              tokstream))))))

    Theorem: vl-parse-net-declaration-finish-fails-gracefully

    (defthm vl-parse-net-declaration-finish-fails-gracefully
      (implies (mv-nth 0
                       (vl-parse-net-declaration-finish
                            nettype loc strength rtype type atts))
               (not (mv-nth 1
                            (vl-parse-net-declaration-finish
                                 nettype
                                 loc strength rtype type atts)))))

    Theorem: vl-warning-p-of-vl-parse-net-declaration-finish

    (defthm vl-warning-p-of-vl-parse-net-declaration-finish
     (iff
      (vl-warning-p (mv-nth 0
                            (vl-parse-net-declaration-finish
                                 nettype loc strength rtype type atts)))
      (mv-nth 0
              (vl-parse-net-declaration-finish
                   nettype loc strength rtype type atts))))

    Theorem: vl-parse-net-declaration-finish-result

    (defthm vl-parse-net-declaration-finish-result
     (implies
      (and (not (mv-nth 0
                        (vl-parse-net-declaration-finish
                             nettype loc strength rtype type atts)))
           (and (and (force (vl-nettypename-p nettype))
                     (force (vl-location-p loc))
                     (force (or (not strength)
                                (vl-gatestrength-p strength)
                                (vl-cstrength-p strength)))
                     (force (or (not rtype) (vl-token-p rtype)))
                     (force (vl-datatype-p type))
                     (force (vl-atts-p atts)))))
      (and
         (consp (mv-nth 1
                        (vl-parse-net-declaration-finish
                             nettype loc strength rtype type atts)))
         (vl-assignlist-p
              (car (mv-nth 1
                           (vl-parse-net-declaration-finish
                                nettype loc strength rtype type atts))))
         (vl-vardecllist-p
              (cdr (mv-nth 1
                           (vl-parse-net-declaration-finish
                                nettype
                                loc strength rtype type atts)))))))

    Theorem: vl-parse-net-declaration-finish-count-strong

    (defthm vl-parse-net-declaration-finish-count-strong
     (and
      (<=
       (vl-tokstream-measure
         :tokstream (mv-nth 2
                            (vl-parse-net-declaration-finish
                                 nettype loc strength rtype type atts)))
       (vl-tokstream-measure))
      (implies
       (not (mv-nth 0
                    (vl-parse-net-declaration-finish
                         nettype loc strength rtype type atts)))
       (<
        (vl-tokstream-measure
         :tokstream (mv-nth 2
                            (vl-parse-net-declaration-finish
                                 nettype loc strength rtype type atts)))
        (vl-tokstream-measure))))
     :rule-classes ((:rewrite) (:linear)))