Hi,
I wanted to run a timer for “X” duration . For this iam using the below code…
fork //{
forever
begin :label //{
wait(flag==1);
ovm_report_info(get_type_name,$psprintf("Timer is starting at3t...",$realtime));
#(X);
expired=1;
flag=0;
end //}
forever
begin //{
@(flag);
if(flag==0)
disable label;
end //}
join //}
When i start the timer i will set flag to 1.And iam disabling the “label” thread only after flag becomes zero. That will be done only after expired bit become 1.
But in my condition, once after entering into fork ,Iam seeing the message statement “timer is starting at …” continuosly and after the completion of X duration also my expired bit is not going high.
Can you plz tell whats the problem with this piece of code.