Domanda

After browsing a bit through the UVM source code, I noticed that singletons for each phase exist. For the run phase this can be accessed by calling uvm_run_phase::get().

I tried calling uvm_run_phase::get() from both the run_phase and the end_of_elaboration phase and as expected both calls returned a handle to the same object. I am a bit puzzled as the object returned by this method is not the same object that is passed to the run_phase(...) task as it's phase argument.

I've created an example on EDA Playground: http://www.edaplayground.com/x/2PL

Does anyone know exactly what the phase argument getting passed to phase methods is and why it's not the singleton?

È stato utile?

Soluzione

After asking the question on the UVM forum, I've found out that there are multiple instances of uvm_phase for each phase that get created, one being used for scheduling and the other being used as the actual implementation.

Calling uvm_run_phase::get() will return the implementation node for the run phase, whereas the argument being past to run_phase(...) is the scheduling node. To get the scheduling node from any other phase, one can use phase.find_by_name("run",0).

Here is the link to the original thread in the UVM forum: http://forums.accellera.org/topic/1769-uvm-phase-singletons/

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top