Parse an
(vl-parse-event-trigger atts &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
Verilog-2005 Syntax:
event_trigger ::= '->' hierarchical_identifier { '[' expression ']' } ';'
SystemVerilog-2012 Syntax:
event_trigger ::= '->' hierarchical_identifier ';' | '->>' [delay_or_event_control] hierarchical_identifier ';'
Interestingly it seems that SystemVerilog doesn't permit the bracketed expressions after the event trigger. What did they mean? I am not sure. There is virtually no discussion of what these bracketed expressions mean in the Verilog-2005 standard...
Function:
(defun vl-parse-event-trigger-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-event-trigger)) (declare (ignorable __function__)) (if (eq (vl-loadconfig->edition config) :verilog-2005) (seq tokstream (:= (vl-match-token :vl-arrow)) (hid := (vl-parse-hierarchical-identifier nil)) (bexprs := (vl-parse-0+-bracketed-expressions)) (:= (vl-match-token :vl-semi)) (return (make-vl-eventtriggerstmt :id (make-vl-index :scope (make-vl-scopeexpr-end :hid hid) :part (make-vl-partselect-none) :indices bexprs) :atts atts))) (seq tokstream (when (vl-is-token? :vl-arrowgt) (return-raw (vl-parse-error "BOZO not yet implemented: '->>' style event trigger"))) (:= (vl-match-token :vl-arrow)) (hid := (vl-parse-hierarchical-identifier nil)) (:= (vl-match-token :vl-semi)) (return (make-vl-eventtriggerstmt :id (make-vl-index :scope (make-vl-scopeexpr-end :hid hid) :part (make-vl-partselect-none)) :atts atts))))))
Theorem:
(defthm vl-parse-event-trigger-fails-gracefully (implies (mv-nth 0 (vl-parse-event-trigger atts)) (not (mv-nth 1 (vl-parse-event-trigger atts)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-event-trigger (iff (vl-warning-p (mv-nth 0 (vl-parse-event-trigger atts))) (mv-nth 0 (vl-parse-event-trigger atts))))
Theorem:
(defthm vl-parse-event-trigger-result (implies (and (force (vl-atts-p atts))) (equal (vl-stmt-p (mv-nth 1 (vl-parse-event-trigger atts))) (not (mv-nth 0 (vl-parse-event-trigger atts))))))
Theorem:
(defthm vl-parse-event-trigger-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-event-trigger atts))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-event-trigger atts))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-event-trigger atts))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))