I am trying the following code ::
module tb;
bit clk , req , gnt ;
event evnt;
always #5 clk = !clk;
sequence seq;
@(posedge clk) req ##1 gnt ##0 -> evnt ; // Is this legal ?
endsequence
cover property( seq );
always@(evnt) $display("Event triggered at T:%0t",$time);
initial begin
#14; req = 1;
#10; gnt = 1;
#2 $finish();
end
endmodule
I currently observe a compilation error for the event trigger.
I am aware that a boolean expression is legal as part of sequence_expression,
not sure on triggering an event as sequence_expression.
For now the following 2 alternatives work ::
- Trigger the event from pass action block
cover property( seq ) -> evnt;
- Trigger the event from subroutine
function void event_trigger();
-> evnt;
endfunction
sequence seq;
@(posedge clk) req ##1 ( gnt , event_trigger ) ;
endsequence