• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
          • Preprocessor
            • Vl-iframe-p
            • Preprocessor-ifdef-minutia
            • Vl-preprocess-loop
            • Vl-read-until-end-of-define
            • Vl-expand-define
            • Vl-read-include
            • Vl-process-ifdef
            • Vl-substitute-into-macro-text
            • Vl-preprocess
            • Vl-define
            • Vl-process-define
            • Vl-process-undef
            • Preprocessor-include-minutia
            • Vl-split-define-text
            • Vl-read-timescale
              • Vl-read-timescale-prefix/remainder-thms
            • Vl-line-up-define-formals-and-actuals
            • Vl-process-else
            • Vl-process-endif
            • Vl-istack-p
            • Vl-is-compiler-directive-p
            • Vl-check-remaining-formals-all-have-defaults
            • Vl-safe-previous-n
            • Vl-safe-next-n
            • Vl-defines
            • *vl-preprocess-clock*
          • Vl-loadconfig
          • Lexer
          • Vl-loadstate
          • Parser
          • 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-read-files
          • Vl-find-file
          • 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
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Testing-utilities
    • Math
  • Preprocessor

Vl-read-timescale

Signature
(vl-read-timescale echars) → (mv prefix remainder)
Arguments
echars — Guard (vl-echarlist-p echars).

Definitions and Theorems

Function: vl-read-timescale

(defun
 vl-read-timescale (echars)
 (declare (xargs :guard (vl-echarlist-p echars)))
 (let
  ((__function__ 'vl-read-timescale))
  (declare (ignorable __function__))
  (b*
   (((mv ws1 remainder)
     (vl-read-while-whitespace echars))
    ((mv tu-val remainder)
     (vl-read-some-literal (list "100" "10" "1")
                           remainder))
    ((mv ws2 remainder)
     (vl-read-while-whitespace remainder))
    ((mv tu-type remainder)
     (vl-read-some-literal (list "fs" "ps" "ns" "us" "ms" "s")
                           remainder))
    ((mv ws3 remainder)
     (vl-read-while-whitespace remainder))
    ((mv div remainder)
     (vl-read-literal "/" remainder))
    ((mv ws4 remainder)
     (vl-read-while-whitespace remainder))
    ((mv tp-val remainder)
     (vl-read-some-literal (list "100" "10" "1")
                           remainder))
    ((mv ws5 remainder)
     (vl-read-while-whitespace remainder))
    ((mv tp-type remainder)
     (vl-read-some-literal (list "fs" "ps" "ns" "us" "ms" "s")
                           remainder)))
   (if
    (and tu-val tu-type div tp-val tp-type)
    (mv (append ws1 tu-val ws2
                tu-type ws3 div ws4 tp-val ws5 tp-type)
        remainder)
    (mv
     (cw "Preprocessor error (~s0): invalid `timescale directive.~%"
         (if (consp echars)
             (vl-location-string (vl-echar->loc (car echars)))
             "at end of file"))
     echars)))))

Theorem: prefix-of-vl-read-timescale

(defthm
 prefix-of-vl-read-timescale
 (and
   (true-listp (mv-nth 0 (vl-read-timescale echars)))
   (implies (force (vl-echarlist-p echars))
            (vl-echarlist-p (mv-nth 0 (vl-read-timescale echars)))))
 :rule-classes
 ((:rewrite)
  (:type-prescription
    :corollary (true-listp (mv-nth 0 (vl-read-timescale echars))))))

Theorem: remainder-of-vl-read-timescale

(defthm
 remainder-of-vl-read-timescale
 (and
   (equal (true-listp (mv-nth 1 (vl-read-timescale echars)))
          (true-listp echars))
   (implies (force (vl-echarlist-p echars))
            (vl-echarlist-p (mv-nth 1 (vl-read-timescale echars)))))
 :rule-classes
 ((:rewrite)
  (:type-prescription
     :corollary
     (implies (true-listp echars)
              (true-listp (mv-nth 1 (vl-read-timescale echars)))))))

Theorem: append-of-vl-read-timescale

(defthm append-of-vl-read-timescale
        (equal (append (mv-nth 0 (vl-read-timescale echars))
                       (mv-nth 1 (vl-read-timescale echars)))
               echars))

Theorem: no-change-loser-of-vl-read-timescale

(defthm no-change-loser-of-vl-read-timescale
        (implies (not (mv-nth 0 (vl-read-timescale echars)))
                 (equal (mv-nth 1 (vl-read-timescale echars))
                        echars)))

Theorem: acl2-count-of-vl-read-timescale-weak

(defthm acl2-count-of-vl-read-timescale-weak
        (<= (acl2-count (mv-nth 1 (vl-read-timescale echars)))
            (acl2-count echars))
        :rule-classes ((:rewrite) (:linear)))

Theorem: acl2-count-of-vl-read-timescale-strong

(defthm
     acl2-count-of-vl-read-timescale-strong
     (implies (mv-nth 0 (vl-read-timescale echars))
              (< (acl2-count (mv-nth 1 (vl-read-timescale echars)))
                 (acl2-count echars)))
     :rule-classes ((:rewrite) (:linear)))

Subtopics

Vl-read-timescale-prefix/remainder-thms
Prefix and remainder theorems for vl-read-timescale, automatically generated by def-prefix/remainder-thms.