Hi. I have 2 DUT registers(R1,R2) of 16 bit size. If 16th bit of r1 is high then i should read from R2
I have written a task as below
virtual task poll();
read_the_register(R1,r1_data); //assume the task that reads from DUT register
if(r1_data[15]) begin
read_the_register(R2,r2_data);
end
else begin
while(~r1_data[15]) begin
read_the_register(R1,r1_data);
if(r1_data[15]) begin
read_the_register(R2,r2_data);
return;
end
end
end
endtask
The above task is working good but its hanging sometimes. could you please help me in this context