Hi,
can i use uvm_config_db::get function from inside a module?
i want to create a configuration object in the test, set it at the config_db and get it in a VIP written as a module.
something like this:
module vip();
initial begin
// Wait for first clock - this means we are in the main phase
@(posedge if.clk);
if (!uvm_config_db#(vip_config)::get(null, "uvm_test_top","cfg", cfg)) begin
`uvm_fatal("CFGERR", "%m vip cfg not set")
end
...
end
endmodule
i tried this and got the fatal error, meaning the cfg wasn't found.
i tried instead to create a typedef struct and pass it from the test to the module using set and get but the simulation crashed - "--- Stack trace follows".
Any help would be much appreciated.
Thx,
Assaf