mrforever Posted April 18, 2013 Report Posted April 18, 2013 Hi all, Usually we use uvm_config_db::set from the higher hierarchy module and uvm_config_db::get in the lower hierarchy module, Can we use uvm_config_db::set and uvm_config_db::get from the opposite direction? Regards mrforever Quote
dave_59 Posted April 18, 2013 Report Posted April 18, 2013 Sure, Instead of using this for the context of the uvm_config_db#()::set(this,...), you can use null, uvm_root::get(), or use find() to get a higher level context. As long as the get() call is in a later phase than the set() call, this should work. Quote
mrforever Posted April 18, 2013 Author Report Posted April 18, 2013 Sure, Instead of using this for the context of the uvm_config_db#()::set(this,...), you can use null, uvm_root::get(), or use find() to get a higher level context. As long as the get() call is in a later phase than the set() call, this should work. Hi dave, Thanks for your reply. I have other two questions: 1. If it is workable as you saying, then how can i use find() to get a higher level context? 2. I think uvm_config_db#()::set() and uvm_config_db#()::get() are static functions. If i want to use them to pass uvm_event type, can it work when the context where the uvm_config_db#()::get() is receives one triggered uvm_event object in the run time? Quote
uwes Posted April 18, 2013 Report Posted April 18, 2013 uvm_config_db is just a typed key-value store. the key is made from (context,path,field). context is a reference to a uvm_component (any method will do (this,null, find_component(),get_parent(),get_parent_sequencer() but also just a path like my_parent.some_subcomponent.somesubsubcomponent). you can share the handle to a uvm_event via the config db. everyone would see the same uvm_event object and therefore any event raised in there would be visible in all other places. /uwe Quote
mrforever Posted April 18, 2013 Author Report Posted April 18, 2013 uvm_config_db is just a typed key-value store. the key is made from (context,path,field). context is a reference to a uvm_component (any method will do (this,null, find_component(),get_parent(),get_parent_sequencer() but also just a path like my_parent.some_subcomponent.somesubsubcomponent). you can share the handle to a uvm_event via the config db. everyone would see the same uvm_event object and therefore any event raised in there would be visible in all other places. /uwe Hi uwe, Thanks for your reply, I will have a try. I have two questions to ask you. 1. Can it use uvm_config_db#()::set() or uvm_config_db#()::get() in uvm_object? 2. How can i check or debug the uvm_config_db mechanism if it doesn't work correctly? Thanks in advance! Quote
uwes Posted April 18, 2013 Report Posted April 18, 2013 Hi uwe, Thanks for your reply, I will have a try. I have two questions to ask you. 1. Can it use uvm_config_db#()::set() or uvm_config_db#()::get() in uvm_object? 2. How can i check or debug the uvm_config_db mechanism if it doesn't work correctly? Thanks in advance! #1 you can use a static call anywhere (in contrast non-static calls have to be invoked on an object) #2 you can enable read/write trace and audit, you can dump the whole database, you can trace via +UVM_CONFIG_DB_TRACE, you can find written-but-not-read data in the config-db. all of this should help to figure out where the issue is (mismatching key issues, mismatching type issues, ordering/prio/precedence issue) Quote
mrforever Posted April 19, 2013 Author Report Posted April 19, 2013 #1 you can use a static call anywhere (in contrast non-static calls have to be invoked on an object) #2 you can enable read/write trace and audit, you can dump the whole database, you can trace via +UVM_CONFIG_DB_TRACE, you can find written-but-not-read data in the config-db. all of this should help to figure out where the issue is (mismatching key issues, mismatching type issues, ordering/prio/precedence issue) Hi uwes, Thanks very much. I will have a try. 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.