(vl-parse-udp-initial-statement regname &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
Requires that the ID matches the regname, which will be the name of the output port.
Function:
(defun vl-parse-udp-initial-statement-fn (regname tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (declare (xargs :guard (and (stringp regname) (vl-is-token? :vl-kwd-initial)))) (let ((__function__ 'vl-parse-udp-initial-statement)) (declare (ignorable __function__)) (seq tokstream (:= (vl-match)) (id := (vl-match-token :vl-idtoken)) (unless (equal (vl-idtoken->name id) regname) (return-raw (vl-parse-error "UDP initial statement must assign to its register."))) (:= (vl-match-token :vl-equalsign)) (val := (vl-parse-udp-init-val)) (:= (vl-match-token :vl-semi)) (return val))))
Theorem:
(defthm vl-parse-udp-initial-statement-fails-gracefully (implies (mv-nth 0 (vl-parse-udp-initial-statement regname)) (not (mv-nth 1 (vl-parse-udp-initial-statement regname)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-udp-initial-statement (iff (vl-warning-p (mv-nth 0 (vl-parse-udp-initial-statement regname))) (mv-nth 0 (vl-parse-udp-initial-statement regname))))
Theorem:
(defthm vl-parse-udp-initial-statement-result (implies (and (and (force (stringp regname)) (force (vl-is-token? :vl-kwd-initial)))) (equal (vl-expr-p (mv-nth 1 (vl-parse-udp-initial-statement regname))) (not (mv-nth 0 (vl-parse-udp-initial-statement regname))))))
Theorem:
(defthm vl-parse-udp-initial-statement-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-udp-initial-statement regname))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-udp-initial-statement regname))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-udp-initial-statement regname))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))