• 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
              • Vl-make-hidden-variables-for-portdecls
              • Vl-parse-function-declaration-2005
              • Vl-parse-task-declaration-2005
              • Vl-parse-task-item-declaration-noatts
              • Vl-parse-taskport-declaration
              • Parse-functions-sv2012
                • Vl-parse-tf-port-item
                • Vl-parse-function-data-type-and-name
                • Vl-parse-function-declaration-2012
                • Vl-parse-function-statements
                • Vl-parse-task-declaration-2012
                • Vl-parse-tf-port-declaration
                  • Vl-tf-parsed-var-id-p
                  • Vl-parse-list-of-tf-variable-identifiers
                  • Vl-parse-tf-item-declaration-noatts
                  • Vl-parse-0+-tf-item-declarations
                  • Vl-datatype-or-implicit
                  • Vl-parse-tf-variable-identifier
                  • Vl-parse-tf-port-list
                  • Vl-parse-tf-item-declaration
                  • Vl-parse-function-declaration
                  • Vl-parse-task-declaration
                  • Vl-make-tf-ports-from-parsed-ids
                  • Vl-tf-parsed-var-idlist-p
                • Vl-parse-taskport-list
                • Vl-make-fundecl-for-parser
                • Vl-make-taskdecl-for-parser
                • Vl-parse-0+-task-item-declarations
                • Vl-parse-optional-function-range-or-type
                • Vl-parse-task-item-declaration
                • Vl-skip-through-endfunction
                • Vl-skip-through-endtask
                • Vl-make-hidden-variable-for-portdecl
                • Vl-filter-portdecl-or-blockitem-list
                • Vl-build-taskports
                • Vl-portdecllist-find-noninput
              • Parse-assignments
              • Parse-clocking
              • Parse-strengths
              • Vl-parse-genvar-declaration
              • Vl-parse
              • Parse-netdecls
              • 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-functions-sv2012

    Vl-parse-tf-port-declaration

    Matches tf_port_declaration.

    Signature
    (vl-parse-tf-port-declaration atts &key (tokstream 'tokstream) 
                                  (config 'config)) 
     
      → 
    (mv errmsg? value new-tokstream)
    Arguments
    config — Guard (vl-loadconfig-p config).
    tf_port_declaration ::= { attribute_instance } tf_port_direction
                            [ var ] data_type_or_implicit list_of_tf_variable_identifiers ';'

    Definitions and Theorems

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

    (defun vl-parse-tf-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-tf-port-declaration))
      (declare (ignorable __function__))
      (seq
       tokstream
       (when
          (vl-is-token? :vl-kwd-const)
          (return-raw
               (vl-parse-error
                    "BOZO implement 'const ref' task/function ports.")))
       (dir := (vl-match-some-token *vl-directions-kwds*))
       (when (vl-is-token? :vl-kwd-var)
             (:= (vl-match)))
       (when (vl-is-some-token? '(:vl-kwd-signed :vl-kwd-unsigned))
             (signing := (vl-match)))
       (when (vl-is-token? :vl-lbrack)
             (ranges := (vl-parse-0+-ranges)))
       (when
        (or signing ranges)
        (ids := (vl-parse-list-of-tf-variable-identifiers))
        (:= (vl-match-token :vl-semi))
        (return
         (vl-make-tf-ports-from-parsed-ids
            ids
            :atts atts
            :dir (cdr (assoc (vl-token->type dir)
                             *vl-directions-kwd-alist*))
            :type
            (make-vl-coretype :name :vl-logic
                              :signedp (and signing
                                            (eq (vl-token->type signing)
                                                :vl-kwd-signed))
                              :pdims (vl-ranges->dimensions ranges)))))
       (when (vl-is-token? :vl-idtoken)
             (type := (vl-parse-datatype-only-if-followed-by-id))
             (ids := (vl-parse-list-of-tf-variable-identifiers))
             (:= (vl-match-token :vl-semi))
             (return (vl-make-tf-ports-from-parsed-ids
                          ids
                          :atts atts
                          :dir (cdr (assoc (vl-token->type dir)
                                           *vl-directions-kwd-alist*))
                          :type (or type
                                    (make-vl-coretype :name :vl-logic
                                                      :signedp nil
                                                      :pdims nil)))))
       (type := (vl-parse-datatype))
       (ids := (vl-parse-list-of-tf-variable-identifiers))
       (:= (vl-match-token :vl-semi))
       (return (vl-make-tf-ports-from-parsed-ids
                    ids
                    :atts atts
                    :dir (cdr (assoc (vl-token->type dir)
                                     *vl-directions-kwd-alist*))
                    :type type)))))

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

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

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

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

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

    (defthm vl-parse-tf-port-declaration-result
     (implies
      (and (force (vl-atts-p atts)))
      (vl-portdecllist-p (mv-nth 1
                                 (vl-parse-tf-port-declaration atts)))))

    Theorem: vl-parse-tf-port-declaration-true-listp

    (defthm vl-parse-tf-port-declaration-true-listp
      (true-listp (mv-nth 1 (vl-parse-tf-port-declaration atts)))
      :rule-classes :type-prescription)

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

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