Parallel tasks

In reply to Moein75:

foreach (gen[i])
   fork
     int j = i;
     gen[j].run();
     drv[j].run();
     model[j].run();
   join_none

This assumes the size of the gen/model/drv are all the same, and that int j is delcared with an automatic lifetime (It would be if this code is inside a class method or a task with an explicit automatic lifetime. You also need to come up with a mechanism for when the test ends.

The most basic fundamentals of the UVM takes care of these issues trivially.