Bala Posted January 20, 2012 Report Posted January 20, 2012 I have extended my_test_config from uvm_ojbect. I then use my_test_config = my_test_config::type_id::create("my_test_config); set_config_object("*.my_env", "cfg", my_test_config); But when I print_topology() I get the following Name Type Size Value my_env top_env - @505 cfg object - <null> Could someone help me sort this out. The problem my_test_config is supposed to override my default configuration in my_env So when I use uvm_config_db#(my_test_config)::get(this, "", "cfg", cfg); It fails and hits uvm_fatal Thanks in advance. Quote
KathleenMeade Posted January 20, 2012 Report Posted January 20, 2012 Hello Bala, If you use set_config_object in your testbench, the type associated with my_test_config is uvm_object. So when you do the get() with my_test_config type it can't find it. I suggest that you use the following instead. Use uvm_config_object::set() in your test or testbench. I believe this syntax is new in UVM1.1a and replaces set_config_object. Then in your component, if you have used the UVM automation macros, the cfg will automatically get applied during the build_phase() method when apply_config_settings() is executed. The advantage here is that you get() the config automatically if you use uvm_config_object::set() Optionally you can to use uvm_config_object::get() directly in the env. The disadvantage of using uvm_config_object::set() is that it is not checked during compile/elaboration time. The failure would occur during run-time instead. I hope this helps! Kathleen Quote
dave_59 Posted January 20, 2012 Report Posted January 20, 2012 Why didn't you use uvm_config_db#(test_config)::set(this,"*.my_env","cfg",my_test_config); Quote
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.