Hi All,
Is there a way to get the UVM to list all tests compiled into the factory?
Ray
Hi All,
Is there a way to get the UVM to list all tests compiled into the factory?
Ray
In reply to raysalemi:
Hi Ray, you can print out all objects/components with the factories print method:
factory.print
I do this normally in the end_of_elaboration_phase.
Christoph
In reply to chr_sue:
Thanks!
Is there any way to filter by type so as to just get uvm_tests and extensions?
In reply to chr_sue:
The factory.print() method returns all components registered with the factory. If you want a list of all components derived from a particualr type, you can use this pair of list classes.
virtual class list_registry_base #(type T);
typedef string qs[$];
local static qs list;
static function qs get_list;
return list;
endfunction
endclass
virtual class list_registry#(type T, string S) extends list_registry_base#(T);
local static function push_onto_list();
list.push_back(S);
return 0;
endfunction
local static int foo = push_onto_list();
endclass // list_registry
module test;
class A;
endclass
class B extends A;
typedef list_registry#(A,"B") id;
endclass
class C extends A;
typedef list_registry#(A,"C") id;
endclass
class D;
endclass
class E extends D;
typedef list_registry#(D,"E") id;
endclass
class F extends D;
typedef list_registry#(D,"F") id;
endclass
initial begin
$display("%p", list_registry_base#(A)::get_list);
$display("%p", list_registry_base#(D)::get_list);
end
endmodule