Verilog-2005 only. Match
(vl-parse-taskport-declaration atts &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
Relevant grammar rules:
tf_input_declaration ::= 'input' [ 'reg' ] [ 'signed' ] [ range ] list_of_port_identifiers | 'input' task_port_type list_of_port_identifiers tf_output_declaration ::= 'output' [ 'reg' ] [ 'signed' ] [ range ] list_of_port_identifiers | 'input' task_port_type list_of_port_identifiers tf_inout_declaration ::= 'inout' [ 'reg' ] [ 'signed' ] [ range ] list_of_port_identifiers | 'input' task_port_type list_of_port_identifiers task_port_type ::= 'integer' | 'real' | 'realtime' | 'time' list_of_port_identifiers ::= identifier { ',' identifier }
Function:
(defun vl-parse-taskport-declaration-fn (atts tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (declare (xargs :guard (vl-atts-p atts))) (let ((__function__ 'vl-parse-taskport-declaration)) (declare (ignorable __function__)) (seq tokstream (dir := (vl-match-some-token '(:vl-kwd-input :vl-kwd-output :vl-kwd-inout))) (when (vl-is-token? :vl-kwd-reg) (reg := (vl-match-token :vl-kwd-reg))) (when (vl-is-token? :vl-kwd-signed) (signed := (vl-match-token :vl-kwd-signed))) (when (vl-is-token? :vl-lbrack) (range := (vl-parse-range))) (when (vl-is-some-token? '(:vl-kwd-integer :vl-kwd-real :vl-kwd-realtime :vl-kwd-time)) (type := (vl-match))) (names := (vl-parse-1+-identifiers-separated-by-commas)) (return-raw (b* (((when (and type (or reg signed range))) (vl-parse-error "Task/function port declarations cannot ~ combine reg/signed keyword with variable ~ types (integer, real, realtime, time).")) (dir (case (vl-token->type dir) (:vl-kwd-input :vl-input) (:vl-kwd-output :vl-output) (:vl-kwd-inout :vl-inout))) (type (if type (case (vl-token->type type) (:vl-kwd-integer *vl-plain-old-integer-type*) (:vl-kwd-real *vl-plain-old-real-type*) (:vl-kwd-realtime *vl-plain-old-realtime-type*) (:vl-kwd-time *vl-plain-old-time-type*)) (make-vl-coretype :name :vl-logic :signedp (if signed t nil) :pdims (and range (list (vl-range->dimension range)))))) (ret (vl-build-taskports atts dir type names))) (mv nil ret tokstream))))))
Theorem:
(defthm vl-parse-taskport-declaration-fails-gracefully (implies (mv-nth 0 (vl-parse-taskport-declaration atts)) (not (mv-nth 1 (vl-parse-taskport-declaration atts)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-taskport-declaration (iff (vl-warning-p (mv-nth 0 (vl-parse-taskport-declaration atts))) (mv-nth 0 (vl-parse-taskport-declaration atts))))
Theorem:
(defthm vl-parse-taskport-declaration-result (implies (and (force (vl-atts-p atts))) (vl-portdecllist-p (mv-nth 1 (vl-parse-taskport-declaration atts)))))
Theorem:
(defthm vl-parse-taskport-declaration-true-listp (true-listp (mv-nth 1 (vl-parse-taskport-declaration atts))) :rule-classes :type-prescription)
Theorem:
(defthm vl-parse-taskport-declaration-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-taskport-declaration atts))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-taskport-declaration atts))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-taskport-declaration atts))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))