How to exit a fork...join_any or fork...join_none block after N threads complete ? — not all, just a few......
I recently explored some ways to do this, and here’s what I found:
I’ve also included a simple explanation of what a uvm_barrier actually is (UVM for dummies style!) in the attached PPT — and even if you're new to UVM, you'll still be able to understand it.
Bottom line: If you're working in SystemVerilog alone, semaphores are your best bet — clean, safe, and reliable when threads are fighting to update shared data. But if you're in a UVM environment, uvm_barrier gives you a neat, built-in way to handle thread sync — just know what’s under the hood. Either way, understanding when and how to exit after N threads gives you much better control over your testbench behavior.
If you need a PPT on this topic, feel free to ping us! We'd be happy to assist.
vishnu vaishnav | Sukhveer R. | Vadher Chirag | Harsh Bhut | Harsh Patel |Kaushal Narodiya | Janak Dharaiya | Anand Dodiya | Indeeksha Digital Pvt. Ltd. | IndEeksha Innovative Semiforce (ActivEdge)