• 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
              • Vl-idtokenlist->names
              • Vl-make-traditional-udp-head
              • Vl-udp-head-p
              • Vl-parse-traditional-udp-head
              • Vl-parse-1+-udp-input-declarations-separated-by-commas
              • Vl-parse-udp-output-declaration
                • Vl-parse-integrated-udp-head
                • Vl-parse-udp-declaration
                • Vl-udp-body-p
                • Vl-parse-udp-initial-statement
                • Vl-parse-two-level-symbols
                • Vl-parse-udp-input-declaration
                • Vl-parse-combinational-entries-until-endtable
                • Vl-parse-udp-port-declaration
                • Vl-parse-sequential-entries-until-endtable
                • Vl-parse-level-symbol
                • Vl-parse-edge-symbol
                • Vl-parse-1+-udp-port-declarations
                • Vl-parse-0+-udp-port-declarations
                • Vl-skip-through-endprimitive
                • Vl-parse-udp-reg-declaration
                • Vl-parse-udp-init-val
                • Vl-parse-sequential-entry
                • Vl-parse-level-input-list
                • Vl-parse-edge-input-list
                • Vl-parse-udp-body
                • Vl-parse-seq-input-list
                • Vl-parse-combinational-entry
                • Vl-parse-combinational-body
                • Vl-port/vardecllist-p
                • Vl-parse-sequential-table
                • Vl-parse-edge-indicator
                • Vl-parse-output-symbol
                • Vl-parse-0+-level-symbols
                • Vl-parse-next-state
                • Vl-parse-current-state
                • Vl-make-udp-with-parse-error
                • Vl-make-udp-portdecls
                • Vl-port/vardecllist->vardecls
                • Vl-port/vardecllist->portdecls
                • Vl-port/vardecl
                • Vl-10-integer-token-p
                • Vl-01-integer-token-p
              • 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
              • 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-udps

    Vl-parse-udp-output-declaration

    Matches udp_output_declaration.

    Signature
    (vl-parse-udp-output-declaration atts &key (tokstream 'tokstream) 
                                     (config 'config)) 
     
      → 
    (mv errmsg? value new-tokstream)
    Arguments
    config — Guard (vl-loadconfig-p config).
    udp_output_declaration ::= { attribute_instance } 'output' port_identifier
                             | { attribute_instance } 'output' 'reg' port_identifier [ '=' constant_expression ] ')

    But BOZO I don't know what the constant_expression is for, so I don't implement the optional assignment part here.

    Definitions and Theorems

    Function: vl-parse-udp-output-declaration-fn

    (defun vl-parse-udp-output-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-udp-output-declaration))
      (declare (ignorable __function__))
      (seq
       tokstream
       (:= (vl-match-token :vl-kwd-output))
       (when (vl-is-token? :vl-kwd-reg)
             (reg := (vl-match)))
       (id := (vl-match-token :vl-idtoken))
       (when
        (vl-is-token? :vl-equalsign)
        (return-raw
         (vl-parse-error
          "Assignments to UDP output reg declarations are not currently supported.")))
       (return (make-vl-portdecl :loc (vl-token->loc id)
                                 :name (vl-idtoken->name id)
                                 :dir :vl-output :type
                                 (if reg *vl-plain-old-reg-type*
                                   *vl-plain-old-logic-type*)
                                 :atts atts)))))

    Theorem: vl-parse-udp-output-declaration-fails-gracefully

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

    Theorem: vl-warning-p-of-vl-parse-udp-output-declaration

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

    Theorem: vl-parse-udp-output-declaration-result

    (defthm vl-parse-udp-output-declaration-result
     (implies
      (and (force (vl-atts-p atts)))
      (equal
         (vl-portdecl-p (mv-nth 1
                                (vl-parse-udp-output-declaration atts)))
         (not (mv-nth 0
                      (vl-parse-udp-output-declaration atts))))))

    Theorem: vl-parse-udp-output-declaration-count-strong

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

    Theorem: type-of-vl-parse-udp-output-declaration

    (defthm type-of-vl-parse-udp-output-declaration
      (b* (((mv err val ?tokstream)
            (vl-parse-udp-output-declaration atts)))
        (implies (not err)
                 (let ((type (vl-portdecl->type val)))
                   (or (equal type *vl-plain-old-logic-type*)
                       (equal type *vl-plain-old-reg-type*)))))
      :rule-classes
      ((:forward-chaining
            :trigger-terms
            ((mv-nth 1
                     (vl-parse-udp-output-declaration atts))))))