• 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
            • Parse-asserts
            • Vl-maybe-parse-lifetime
            • Parse-dpi-import-export
            • Parse-ports
            • Parse-timeunits
              • Vl-parse-optional-timeunits-declaration
                • Vl-parse-timeliteral
                • Vl-parse-timeunitdecl
                • Vl-parse-timeprecisiondecl
              • 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-timeunits

    Vl-parse-optional-timeunits-declaration

    Matches [timeunits_declaration].

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

    Definitions and Theorems

    Function: vl-parse-optional-timeunits-declaration-fn

    (defun vl-parse-optional-timeunits-declaration-fn (tokstream config)
      (declare (xargs :stobjs (tokstream)))
      (declare (xargs :guard (vl-loadconfig-p config)))
      (declare (ignorable config))
      (let ((__function__ 'vl-parse-optional-timeunits-declaration))
        (declare (ignorable __function__))
        (seq tokstream
             (when (vl-is-token? :vl-kwd-timeunit)
                   (unit1 := (vl-parse-timeunitdecl)))
             (when (vl-is-token? :vl-kwd-timeprecision)
                   (prec := (vl-parse-timeprecisiondecl)))
             (when (and (not unit1)
                        (vl-is-token? :vl-kwd-timeunit))
                   (unit2 := (vl-parse-timeunitdecl)))
             (return (cons (or unit1 unit2) prec)))))

    Theorem: vl-parse-optional-timeunits-declaration-fails-gracefully

    (defthm vl-parse-optional-timeunits-declaration-fails-gracefully
     (implies (mv-nth 0
                      (vl-parse-optional-timeunits-declaration))
              (not (mv-nth 1
                           (vl-parse-optional-timeunits-declaration)))))

    Theorem: vl-warning-p-of-vl-parse-optional-timeunits-declaration

    (defthm vl-warning-p-of-vl-parse-optional-timeunits-declaration
     (iff
       (vl-warning-p (mv-nth 0
                             (vl-parse-optional-timeunits-declaration)))
       (mv-nth 0
               (vl-parse-optional-timeunits-declaration))))

    Theorem: vl-parse-optional-timeunits-declaration-result

    (defthm vl-parse-optional-timeunits-declaration-result
     (implies
      (and (not (mv-nth 0
                        (vl-parse-optional-timeunits-declaration)))
           (and t))
      (and
       (consp (mv-nth 1
                      (vl-parse-optional-timeunits-declaration)))
       (vl-maybe-timeunitdecl-p
            (car (mv-nth 1
                         (vl-parse-optional-timeunits-declaration))))
       (vl-maybe-timeprecisiondecl-p
            (cdr (mv-nth 1
                         (vl-parse-optional-timeunits-declaration)))))))

    Theorem: vl-parse-optional-timeunits-declaration-count-weak

    (defthm vl-parse-optional-timeunits-declaration-count-weak
     (<=
      (vl-tokstream-measure
          :tokstream (mv-nth 2
                             (vl-parse-optional-timeunits-declaration)))
      (vl-tokstream-measure))
     :rule-classes ((:rewrite) (:linear)))