Matches
(vl-parse-cycledelayrange &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
Grammar rules are as follows:
cycle_delay_range ::= '##' constant_primary | '##' '[' cycle_delay_const_range_expression ']' | '##[*]' | '##[+]' cycle_delay_const_range_expression ::= constant_expression ':' constant_expression | constant_expression ':' '$'
But
Function:
(defun vl-parse-cycledelayrange-fn (tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (let ((__function__ 'vl-parse-cycledelayrange)) (declare (ignorable __function__)) (seq tokstream (:= (vl-match-token :vl-poundpound)) (unless (vl-is-token? :vl-lbrack) (left := (vl-parse-primary)) (return (make-vl-range :msb left :lsb left))) (:= (vl-match)) (when (vl-is-token? :vl-times) (:= (vl-match)) (:= (vl-match-token :vl-rbrack)) (return (make-vl-range :msb (vl-make-index 0) :lsb *vl-end-of-sequence-$*))) (when (vl-is-token? :vl-plus) (:= (vl-match)) (:= (vl-match-token :vl-rbrack)) (return (make-vl-range :msb (vl-make-index 1) :lsb *vl-end-of-sequence-$*))) (left := (vl-parse-expression)) (:= (vl-match-token :vl-colon)) (right := (vl-parse-expression)) (:= (vl-match-token :vl-rbrack)) (return (make-vl-range :msb left :lsb right)))))
Theorem:
(defthm vl-parse-cycledelayrange-fails-gracefully (implies (mv-nth 0 (vl-parse-cycledelayrange)) (not (mv-nth 1 (vl-parse-cycledelayrange)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-cycledelayrange (iff (vl-warning-p (mv-nth 0 (vl-parse-cycledelayrange))) (mv-nth 0 (vl-parse-cycledelayrange))))
Theorem:
(defthm vl-parse-cycledelayrange-result (implies (and t) (equal (vl-range-p (mv-nth 1 (vl-parse-cycledelayrange))) (not (mv-nth 0 (vl-parse-cycledelayrange))))))
Theorem:
(defthm vl-parse-cycledelayrange-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-cycledelayrange))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-cycledelayrange))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-cycledelayrange))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))