• 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
              • Vl-sort-clocking-block-items
              • Vl-parse-normal-clocking-declaration
                • Vl-parse-list-of-clocking-decl-assigns
                • Vl-clocking-direction-head
                • Vl-parse-default-skew-item
                • Vl-parse-clocking-block-item
                • Vl-parse-global-clocking-declaration
                • Vl-parse-clocking-direction
                • Vl-parse-clocking-block-items-until-endclocking
                • Vl-defaultskew-item
                • Vl-parse-clocking-skew
                • Vl-parse-defaultdisable
                • Vl-maybe-parse-clocking-skew
                • Vl-clocking-block-item
                • Vl-clocking-block-item-list
                • Vl-defaultskew-item-list
              • 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-clocking

    Vl-parse-normal-clocking-declaration

    Match a single, non-global clocking_declaration.

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

    SystemVerilog-2012 Grammar:

    clocking_declaration ::=
       ['default'] 'clocking' [ identifier ] clocking_event ';'
         {clocking_item}
    'endclocking' [ ':' identifier ]

    Definitions and Theorems

    Function: vl-parse-normal-clocking-declaration-fn

    (defun vl-parse-normal-clocking-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-normal-clocking-declaration))
      (declare (ignorable __function__))
      (seq
       tokstream
       (when (vl-is-token? :vl-kwd-default)
             (default := (vl-match)))
       (kwd := (vl-match-token :vl-kwd-clocking))
       (when (vl-is-token? :vl-idtoken)
             (name := (vl-match)))
       (event := (vl-parse-clocking-event))
       (:= (vl-match-token :vl-semi))
       (unless
            (or name default)
            (return-raw
                 (vl-parse-error
                      "Only default clocking blocks may be unnamed.")))
       (items := (vl-parse-clocking-block-items-until-endclocking))
       (:= (vl-match-token :vl-kwd-endclocking))
       (when
          name
          (:= (vl-parse-endblock-name (and name (vl-idtoken->name name))
                                      "clocking")))
       (return-raw
        (b*
         (((mv idefaults odefaults
               clkassigns properties sequences)
           (vl-sort-clocking-block-items items nil nil nil nil nil))
          ((unless (or (atom idefaults)
                       (atom (cdr idefaults))))
           (vl-parse-error "Multiple default input clock skews"))
          ((unless (or (atom odefaults)
                       (atom (cdr odefaults))))
           (vl-parse-error "Multiple default output clock skews"))
          (ans
           (make-vl-clkdecl
                :defaultp (if default t nil)
                :name (and name (vl-idtoken->name name))
                :event event
                :iskew (and (consp idefaults)
                            (vl-defaultskew-item->skew (car idefaults)))
                :oskew (and (consp odefaults)
                            (vl-defaultskew-item->skew (car odefaults)))
                :clkassigns clkassigns
                :properties properties
                :sequences sequences
                :loc (vl-token->loc kwd)
                :atts atts)))
         (mv nil ans tokstream))))))

    Theorem: vl-parse-normal-clocking-declaration-fails-gracefully

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

    Theorem: vl-warning-p-of-vl-parse-normal-clocking-declaration

    (defthm vl-warning-p-of-vl-parse-normal-clocking-declaration
      (iff (vl-warning-p
                (mv-nth 0
                        (vl-parse-normal-clocking-declaration atts)))
           (mv-nth 0
                   (vl-parse-normal-clocking-declaration atts))))

    Theorem: vl-parse-normal-clocking-declaration-result

    (defthm vl-parse-normal-clocking-declaration-result
     (implies
      (and (force (vl-atts-p atts)))
      (equal
           (vl-clkdecl-p
                (mv-nth 1
                        (vl-parse-normal-clocking-declaration atts)))
           (not (mv-nth 0
                        (vl-parse-normal-clocking-declaration atts))))))

    Theorem: vl-parse-normal-clocking-declaration-count-strong

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