Match a single, non-global
(vl-parse-normal-clocking-declaration atts &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
SystemVerilog-2012 Grammar:
clocking_declaration ::= ['default'] 'clocking' [ identifier ] clocking_event ';' {clocking_item} 'endclocking' [ ':' identifier ]
Function:
(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:
(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:
(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:
(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:
(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)))