task task1();
while(size < 10000) begin
register_write(XXXX); <== this register_write() is also a task
end
endtask
task task2();
… // some other things to do
endtask
and in my test, I’d like to trigger task1 firstly and then task2. but I want to make sure all stuff in task1 is finished before task2 begins. How to handle this ? Thank you!
Tasks are blocking. If you call the tasks sequentially, the second task won’t start until the first task is complete. This changes if you use fork statements.