Event Synchronization Issue in SystemVerilog D Flip-Flop (DFF) Testbench

If all of your run methods have a definitive termination, then the simple fork join construct works. But in most testbenches the driver and monitor processes run indefinitely. So it’s only when some of the processes finish that you want to end the test. You can do that using a semaphore as described here.

The UVM has objection and barrier classes that help you out when to know the test is done.