I have an ovm env with 2 added phases that occur prior to pre_run. One phase applies to all classes derived from company_threaded_component (extends ovm_threaded_component). The other phase applies to prj_env (extends company_env [extends ovm_env]).

Following the example on page 64 of the reference manual that comes with 1.0.1, I've instantiated and inserted 1 phases in company_threaded_component and 1 phase in prj_env. I've inserted them in the constructor of the class definitions as the example shows.

My problem/concern... they are inserted in two different locations so if I'm inserting them in the same position relative to the default phases (ie. before pre_run), phase ordering is dependant on instance ordering. I'd like to be able to the phase insertion from the same place and preferably in the env (not the individual threaded components).

This is what I have:

Code:
class company_threaded_component extends ovm_threaded_component
   static new_phase_1 new1_ph = new;
   function new(); insert_phase("pre_run", new1_ph); endfunction
   virtual task new1;
endclass
class prj_env extends _env;
    new_phase_2 new2_ph = new;
    function new();
      //...threaded components instances here...
       insert_phase("pre_run", new2_ph);
    endfunction
   virtual task new2;
endclass
What I want is this:

Code:
class company_threaded_component extends ovm_threaded_component
   static new_phase_1 new1_ph = new;
   virtual task new1;
endclass
class prj_env extends _env;
   new_phase_2 new2_ph = new;
    function new();
         //...threaded components instances here...
         company_threaded_component::insert_phase("pre_run", new1_ph);
          insert_phase("pre_run", new2_ph); 
   endfunction
   virtual task new2;
endclass
Ideas?

And why am I doing this... I have 1 generic time consuming phase that I want added to the company implementation of ovm. For this project however, ovm_env is not the sim master so I also have a "hack" phase inserted in the prj_env to sync to the existing code. The generic phase is invoked in all the threaded components. The "hack" is invoked only in the env.

Neil