I am trying to write a SV checker to check for req ack protocol.
after seeing a req, i should see ack within 4 cycles.
To do this, i am using forever loops inside fork...join_any.
always @ (posedge req) begin
begin : label_1
forever @ (posedge clk)
count = count + 1;
$display("clk count is %0d", count);
if (count == 4) begin
$display("timeout for ack");
begin : label_2
forever @ (posedge ack)
//disable label_1 ;
req = 1;
ack = 1;
initial clk = 0;
always #5 clk = ~clk;
I see that this does not give expected results.
After hitting timeout, the disable fork does not kill the forever loops.
I tried using disable label which works fine but it is not a recommended approach.