Ostensibly match a
(vl-parse-parameter-value-assignment-hack &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
In Verilog-2005, parameter value assignments could only occur in module instances (e.g., you might instantiate an adder with #(.width(16)) or just #(16)). But in SystemVerilog-2012, they can now be embedded within certain kinds of casting and streaming concatenation expressions.
We don't see a very good way to support this in our current expression format. So, for now, if we actually encounter a parameter value assignment in one of these contexts, we'll just cause a parse error. If some day we actually need to support this, we might be able to add some new kind of fancy operator(s), e.g., a namedarg operator with an alternating list of name/value expressions.
Function:
(defun vl-parse-parameter-value-assignment-hack-fn (tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (let ((__function__ 'vl-parse-parameter-value-assignment-hack)) (declare (ignorable __function__)) (seq tokstream (:= (vl-match-token :vl-pound)) (:= (vl-match-token :vl-lparen)) (return-raw (vl-parse-error "Embedded parameter value assignments #(...) aren't implemented yet.")))))
Theorem:
(defthm vl-parse-parameter-value-assignment-hack-fails-gracefully (implies (mv-nth 0 (vl-parse-parameter-value-assignment-hack)) (not (mv-nth 1 (vl-parse-parameter-value-assignment-hack)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-parameter-value-assignment-hack (iff (vl-warning-p (mv-nth 0 (vl-parse-parameter-value-assignment-hack))) (mv-nth 0 (vl-parse-parameter-value-assignment-hack))))
Theorem:
(defthm vl-parse-parameter-value-assignment-hack-result (implies (and t) (not (mv-nth 1 (vl-parse-parameter-value-assignment-hack)))))
Theorem:
(defthm vl-parse-parameter-value-assignment-hack-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-parameter-value-assignment-hack))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-parameter-value-assignment-hack))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-parameter-value-assignment-hack))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))