• 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-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

    Vl-parse-taskport-declaration

    Verilog-2005 only. Match tf_input_declaration, tf_output_declaration, or tf_inout_declaration.

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

    Relevant grammar rules:

    tf_input_declaration ::= 'input' [ 'reg' ] [ 'signed' ] [ range ] list_of_port_identifiers
                           | 'input' task_port_type list_of_port_identifiers
    
    tf_output_declaration ::= 'output' [ 'reg' ] [ 'signed' ] [ range ] list_of_port_identifiers
                           | 'input' task_port_type list_of_port_identifiers
    
    tf_inout_declaration ::= 'inout' [ 'reg' ] [ 'signed' ] [ range ] list_of_port_identifiers
                           | 'input' task_port_type list_of_port_identifiers
    
    task_port_type ::= 'integer' | 'real' | 'realtime' | 'time'
    
    list_of_port_identifiers ::= identifier { ',' identifier }

    Definitions and Theorems

    Function: vl-parse-taskport-declaration-fn

    (defun vl-parse-taskport-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-taskport-declaration))
      (declare (ignorable __function__))
      (seq
       tokstream
       (dir := (vl-match-some-token
                    '(:vl-kwd-input :vl-kwd-output :vl-kwd-inout)))
       (when (vl-is-token? :vl-kwd-reg)
             (reg := (vl-match-token :vl-kwd-reg)))
       (when (vl-is-token? :vl-kwd-signed)
             (signed := (vl-match-token :vl-kwd-signed)))
       (when (vl-is-token? :vl-lbrack)
             (range := (vl-parse-range)))
       (when (vl-is-some-token?
                  '(:vl-kwd-integer :vl-kwd-real
                                    :vl-kwd-realtime :vl-kwd-time))
             (type := (vl-match)))
       (names := (vl-parse-1+-identifiers-separated-by-commas))
       (return-raw
        (b*
         (((when (and type (or reg signed range)))
           (vl-parse-error
            "Task/function port declarations cannot ~
                                    combine reg/signed keyword with variable ~
                                    types (integer, real, realtime, time)."))
          (dir (case (vl-token->type dir)
                     (:vl-kwd-input :vl-input)
                     (:vl-kwd-output :vl-output)
                     (:vl-kwd-inout :vl-inout)))
          (type
               (if type
                   (case (vl-token->type type)
                         (:vl-kwd-integer *vl-plain-old-integer-type*)
                         (:vl-kwd-real *vl-plain-old-real-type*)
                         (:vl-kwd-realtime *vl-plain-old-realtime-type*)
                         (:vl-kwd-time *vl-plain-old-time-type*))
                 (make-vl-coretype
                      :name :vl-logic
                      :signedp (if signed t nil)
                      :pdims (and range
                                  (list (vl-range->dimension range))))))
          (ret (vl-build-taskports atts dir type names)))
         (mv nil ret tokstream))))))

    Theorem: vl-parse-taskport-declaration-fails-gracefully

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

    Theorem: vl-warning-p-of-vl-parse-taskport-declaration

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

    Theorem: vl-parse-taskport-declaration-result

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

    Theorem: vl-parse-taskport-declaration-true-listp

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

    Theorem: vl-parse-taskport-declaration-count-strong

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