I want a while loop to enter on a posedge of a trigger.
Below options are giving syntax error.
task mytask()
while( posedge(my_if.trigger)) begin
:
:
end //while
endtask
task mytask()
while( posedge(my_if.trigger)==1) begin
:
:
end //while
endtask
It should be pretty simple. I tried using while(@ posedge (my_if.trigger))
All are giving syntax error. I tried searching and didn’t find any code that I needed. Any clue what am I doing wrong?
Thanks Dave!
I think, your first example would work in my case.
I want to wait for this variable to be triggered before executing the rest of the task. I don’t want to do a level check.
I have used this several times in the past. But was thinking to use a while loop. I think the above solves the purpose. Thank you!