I have a very smilar code as given below in an UVM testbench. A named event gets triggered from a uvm_component and there is an asserted property which should start evaluation. Unfortunately SVA doesn’t get triggered even though event seems triggered within assertion thread. Is it due to event regions somehow its sampled value never gets triggered? But below code successfully runs as expected when I tested in edaplayground.
module tb;
bit clk=0;
initial begin
clk = 0;
forever begin
#10; clk=!clk;
end
end
event e;
property event_prop();
@(e) ##0 1 |-> @(posedge clk) ##1 1;
endproperty
assert property(event_prop) $display("Passed %0t", $realtime);
class A;
task trig();
#5;
->e;
endtask
endclass
initial begin
static A a = new();
a.trig();
#5;
->e;
#20;
->e;
#50;
$display("end");
end
Ok looks like I’ve found the problem. The more I added the implementation closer to the actual one, tools started to complain about event assignments. Luckily other options available in edaplayground revealed the bug,
interface event_if;
event if_e;
endinterface
class A;
virtual interface event_if intf;
task trig();
#5;
->intf.if_e;
endtask
endclass
module tb;
bit clk=0;
initial begin
clk = 0;
forever begin
#10; clk=!clk;
end
end
event_if event_if();
event e[5];
assign e[0] = event_if.if_e; // bug here
property event_prop();
@(e[0]) ##0 1 |-> @(posedge clk) ##1 1;
endproperty
assert property(event_prop) $display("Passed %0t", $realtime);
initial begin
static A a = new();
a.intf = event_if;
a.trig();
#20;
->e[0];
#50;
$display("end");
$finish;
end
endmodule