• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
            • Lex-strings
            • Lex-identifiers
            • Vl-typo-uppercase-p
            • Vl-typo-number-p
            • Vl-typo-lowercase-p
            • Lex-numbers
              • Vl-decimal-digit-p
              • Vl-z-digit-p
              • Vl-x-digit-p
              • Vl-underscore-or-octal-digit-p
              • Vl-underscore-or-hex-digit-p
              • Vl-underscore-or-decimal-digit-p
              • Vl-underscore-or-binary-digit-p
              • Vl-octal-digit-p
              • Vl-non-zero-decimal-digit-p
              • Vl-hex-digit-p
              • Vl-binary-digit-p
              • Vl-lex-integer
              • Vl-correct-bitlist
              • Vl-lex-time-or-real-number
              • Vl-read-decimal-value
              • Vl-lex-unbased-unsized-literal
              • Vl-lex-number
              • Vl-read-non-zero-unsigned-number
              • Vl-read-any-base
              • Vl-read-unsigned-number
              • Vl-read-time-unit
              • Vl-read-binary-value
              • Vl-read-real-tail
              • Vl-read-octal-value
              • Vl-read-hex-value
              • Vl-read-decimal-base
              • Vl-read-octal-base
              • Vl-read-hex-base
              • Vl-read-binary-base
              • Vl-hex-digits-to-bitlist
              • Vl-octal-digits-to-bitlist
              • Vl-decimal-digits-to-bitlist
              • Vl-binary-digits-to-bitlist
              • Vl-underscore-or-octal-digit-list-p
              • Vl-underscore-or-hex-digit-list-p
              • Vl-underscore-or-decimal-digit-list-p
              • Vl-underscore-or-binary-digit-list-p
              • Vl-non-zero-decimal-digit-list-p
              • Vl-decimal-digit-list-p
              • Vl-binary-digit-list-p
              • Vl-z-digit-list-p
              • Vl-x-digit-list-p
              • Vl-octal-digit-list-p
              • Vl-hex-digit-list-p
              • Vl-timeunit-lookup
              • Chartypes
              • Vl-lex
              • Defchar
              • Tokens
              • Lex-keywords
              • Lexstate
              • Make-test-tokens
              • Lexer-utils
              • Lex-comments
              • Vl-typo-uppercase-list-p
              • Vl-typo-lowercase-list-p
              • Vl-typo-number-list-p
            • Parser
            • 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
    • Lex-numbers

    Vl-timeunit-lookup

    Get the vl-timeunit-p corresponding to a time unit string like "us".

    Signature
    (vl-timeunit-lookup x) → unit
    Arguments
    x — Guard (stringp x).
    Returns
    unit — Type (equal (vl-timeunit-p unit) (if unit t nil)).

    Definitions and Theorems

    Function: vl-timeunit-lookup$inline

    (defun vl-timeunit-lookup$inline (x)
      (declare (xargs :guard (stringp x)))
      (let ((__function__ 'vl-timeunit-lookup))
        (declare (ignorable __function__))
        (cdr (assoc-equal x
                          '(("s" . :vl-s)
                            ("ms" . :vl-ms)
                            ("us" . :vl-us)
                            ("ns" . :vl-ns)
                            ("ps" . :vl-ps)
                            ("fs" . :vl-fs))))))

    Theorem: return-type-of-vl-timeunit-lookup

    (defthm return-type-of-vl-timeunit-lookup
      (b* ((unit (vl-timeunit-lookup$inline x)))
        (equal (vl-timeunit-p unit)
               (if unit t nil)))
      :rule-classes :rewrite)