• 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
                • Vl-parse-port-reference
                • Vl-parse-1+-ports-separated-by-commas
                • Vl-parse-1+-port-references-separated-by-commas
                • Vl-parse-nonnull-port
                  • Vl-parse-port-expression
                • 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
    • Verilog-2005-ports

    Vl-parse-nonnull-port

    Matches port, except for the empty port.

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

    Definitions and Theorems

    Function: vl-parse-nonnull-port-fn

    (defun vl-parse-nonnull-port-fn (tokstream config)
     (declare (xargs :stobjs (tokstream)))
     (declare (xargs :guard (vl-loadconfig-p config)))
     (declare (ignorable config))
     (let ((__function__ 'vl-parse-nonnull-port))
      (declare (ignorable __function__))
      (seq
       tokstream (loc := (vl-current-loc))
       (unless
           (vl-is-token? :vl-dot)
           (pexpr := (vl-parse-port-expression))
           (return (cond ((and (vl-atom-p pexpr)
                               (vl-id-p (vl-atom->guts pexpr)))
                          (make-vl-regularport
                               :name (vl-id->name (vl-atom->guts pexpr))
                               :expr pexpr
                               :loc loc))
                         (t (make-vl-regularport :name nil
                                                 :expr pexpr
                                                 :loc loc)))))
       (:= (vl-match))
       (id := (vl-match-token :vl-idtoken))
       (:= (vl-match-token :vl-lparen))
       (unless (vl-is-token? :vl-rparen)
               (pexpr := (vl-parse-port-expression)))
       (:= (vl-match-token :vl-rparen))
       (return (make-vl-regularport :name (vl-idtoken->name id)
                                    :expr pexpr
                                    :loc loc)))))

    Theorem: vl-parse-nonnull-port-fails-gracefully

    (defthm vl-parse-nonnull-port-fails-gracefully
      (implies (mv-nth 0 (vl-parse-nonnull-port))
               (not (mv-nth 1 (vl-parse-nonnull-port)))))

    Theorem: vl-warning-p-of-vl-parse-nonnull-port

    (defthm vl-warning-p-of-vl-parse-nonnull-port
      (iff (vl-warning-p (mv-nth 0 (vl-parse-nonnull-port)))
           (mv-nth 0 (vl-parse-nonnull-port))))

    Theorem: vl-parse-nonnull-port-result

    (defthm vl-parse-nonnull-port-result
      (implies (and t)
               (equal (vl-port-p (mv-nth 1 (vl-parse-nonnull-port)))
                      (not (mv-nth 0 (vl-parse-nonnull-port))))))

    Theorem: vl-parse-nonnull-port-count-strong

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