(vl-parse-param-assignment atts localp type &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
Function:
(defun vl-parse-param-assignment-fn (atts localp type tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (declare (xargs :guard (and (vl-atts-p atts) (booleanp localp) (vl-paramtype-p type) (member (vl-paramtype-kind type) '(:vl-implicitvalueparam :vl-explicitvalueparam))))) (let ((__function__ 'vl-parse-param-assignment)) (declare (ignorable __function__)) (seq tokstream (id := (vl-match-token :vl-idtoken)) (when (not (eq (vl-loadconfig->edition config) :verilog-2005)) (udims := (vl-parse-0+-unpacked-dimensions))) (when (and (not (vl-is-token? :vl-equalsign)) (not (eq (vl-loadconfig->edition config) :verilog-2005)) (not localp)) (return (let ((type (if (atom udims) type (vl-update-paramtype-udims udims type)))) (make-vl-paramdecl :loc (vl-token->loc id) :name (vl-idtoken->name id) :atts atts :localp localp :type type)))) (:= (vl-match-token :vl-equalsign)) (default := (vl-parse-mintypmax-expression)) (return (let* ((type (if (eq (vl-paramtype-kind type) :vl-implicitvalueparam) (change-vl-implicitvalueparam type :default default) (change-vl-explicitvalueparam type :default default))) (type (if (atom udims) type (vl-update-paramtype-udims udims type)))) (make-vl-paramdecl :loc (vl-token->loc id) :name (vl-idtoken->name id) :atts atts :localp localp :type type))))))
Theorem:
(defthm vl-parse-param-assignment-fails-gracefully (implies (mv-nth 0 (vl-parse-param-assignment atts localp type)) (not (mv-nth 1 (vl-parse-param-assignment atts localp type)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-param-assignment (iff (vl-warning-p (mv-nth 0 (vl-parse-param-assignment atts localp type))) (mv-nth 0 (vl-parse-param-assignment atts localp type))))
Theorem:
(defthm vl-parse-param-assignment-result (implies (and (and (force (vl-atts-p atts)) (force (booleanp localp)) (force (vl-paramtype-p type)) (force (member (vl-paramtype-kind type) '(:vl-implicitvalueparam :vl-explicitvalueparam))))) (equal (vl-paramdecl-p (mv-nth 1 (vl-parse-param-assignment atts localp type))) (not (mv-nth 0 (vl-parse-param-assignment atts localp type))))))
Theorem:
(defthm vl-parse-param-assignment-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-param-assignment atts localp type))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-param-assignment atts localp type))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-param-assignment atts localp type))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))