assafgedalia Posted September 20, 2015 Report Share Posted September 20, 2015 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 Quote Link to comment Share on other sites More sharing options...
uwes Posted September 21, 2015 Report Share Posted September 21, 2015 hi, of course you can use the config_db from within a module. if the element cannot be found it means - it has never been put into the config_db (code not executed, module missing, set-after-get or similar) - the combination of scope,path,field,type during ::get doesn't match the one used during ::set switch on +UVM_CONFIG_DB_TRACE and see what is being stored and retrieved /uwe Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.