• 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-drive-strength-or-charge-strength
              • Vl-parse-drive-strength
              • Vl-parse-optional-drive-strength
                • Vl-parse-charge-strength
                • *vl-strength1-alist*
                • *vl-strength0-alist*
                • *vl-ds1-alist*
                • *vl-ds0/1-keywords*
                • *vl-ds0-alist*
                • *vl-charge-strengths-keywords*
                • *vl-charge-strengths-alist*
                • *vl-ds1-keywords*
                • *vl-ds0-keywords*
              • Vl-parse-genvar-declaration
              • Vl-parse
              • Parse-ports
              • 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
    • Parse-strengths

    Vl-parse-optional-drive-strength

    Never fails. If there's a valid drive_strength, we match it and return a vl-gatestrength-p. Otherwise, we don't do anything to the token list and just return nil.

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

    Definitions and Theorems

    Function: vl-parse-optional-drive-strength-fn

    (defun vl-parse-optional-drive-strength-fn (tokstream config)
      (declare (xargs :stobjs (tokstream)))
      (declare (xargs :guard (vl-loadconfig-p config)))
      (declare (ignorable config))
      (let ((__function__ 'vl-parse-optional-drive-strength))
        (declare (ignorable __function__))
        (b* ((backup (vl-tokstream-save))
             ((mv erp val tokstream)
              (vl-parse-drive-strength))
             ((unless erp) (mv erp val tokstream))
             (tokstream (vl-tokstream-restore backup)))
          (mv nil nil tokstream))))

    Theorem: vl-parse-optional-drive-strength-never-fails

    (defthm vl-parse-optional-drive-strength-never-fails
      (not (mv-nth 0 (vl-parse-optional-drive-strength))))

    Theorem: vl-parse-optional-drive-strength-result

    (defthm vl-parse-optional-drive-strength-result
      (implies (and (not (mv-nth 0 (vl-parse-optional-drive-strength)))
                    (and t))
               (vl-maybe-gatestrength-p
                    (mv-nth 1 (vl-parse-optional-drive-strength)))))

    Theorem: vl-parse-optional-drive-strength-count-strong-on-value

    (defthm vl-parse-optional-drive-strength-count-strong-on-value
     (and
      (<= (vl-tokstream-measure
               :tokstream (mv-nth 2 (vl-parse-optional-drive-strength)))
          (vl-tokstream-measure))
      (implies
       (mv-nth 1 (vl-parse-optional-drive-strength))
       (< (vl-tokstream-measure
               :tokstream (mv-nth 2 (vl-parse-optional-drive-strength)))
          (vl-tokstream-measure))))
     :rule-classes ((:rewrite) (:linear)))