Match
(vl-parse-drive-strength &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
Function:
(defun vl-parse-drive-strength-fn (tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (let ((__function__ 'vl-parse-drive-strength)) (declare (ignorable __function__)) (seq tokstream (:= (vl-match-token :vl-lparen)) (first := (vl-match-some-token *vl-ds0/1-keywords*)) (:= (vl-match-token :vl-comma)) (second := (vl-match-some-token *vl-ds0/1-keywords*)) (:= (vl-match-token :vl-rparen)) (return-raw (b* (((mv s-zero s-one) (if (member-eq (vl-token->type first) *vl-ds0-keywords*) (mv (vl-token->type first) (vl-token->type second)) (mv (vl-token->type second) (vl-token->type first)))) ((when (and (member-eq s-zero *vl-ds0-keywords*) (member-eq s-one *vl-ds1-keywords*) (or (not (eq s-zero :vl-kwd-highz0)) (not (eq s-one :vl-kwd-highz1))))) (mv nil (make-vl-gatestrength :zero (cdr (assoc-eq s-zero *vl-ds0-alist*)) :one (cdr (assoc-eq s-one *vl-ds1-alist*))) tokstream))) (vl-parse-error "Invalid drive strength."))))))
Theorem:
(defthm vl-parse-drive-strength-fails-gracefully (implies (mv-nth 0 (vl-parse-drive-strength)) (not (mv-nth 1 (vl-parse-drive-strength)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-drive-strength (iff (vl-warning-p (mv-nth 0 (vl-parse-drive-strength))) (mv-nth 0 (vl-parse-drive-strength))))
Theorem:
(defthm vl-parse-drive-strength-result (implies (and t) (equal (vl-gatestrength-p (mv-nth 1 (vl-parse-drive-strength))) (not (mv-nth 0 (vl-parse-drive-strength))))))
Theorem:
(defthm vl-parse-drive-strength-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-drive-strength))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-drive-strength))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-drive-strength))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))