gaurav7589 Posted January 4, 2012 Report Share Posted January 4, 2012 Hi all, May i please know if we can use get_config in sequence_item class?? I have used set_config in my test. Thanks and Regards, gaurav Quote Link to comment Share on other sites More sharing options...
janick Posted January 4, 2012 Report Share Posted January 4, 2012 Use uvm_config_db#()::get() (and you should similarly use uvm_config_db#()::set) as they do not depend on the component hierarchy. Further, the set/get_config_*() methods are being deprecated. Quote Link to comment Share on other sites More sharing options...
gaurav7589 Posted January 5, 2012 Author Report Share Posted January 5, 2012 Thanks, But I have used the same. In my test I use uvm_set_config_db, in my sequence item use uvm_get_config_db. But the problem is get_config_db only works for components extended from uvm_object , while my sequence item extends from uvm_sequence item. Is there any solution?? Quote Link to comment Share on other sites More sharing options...
dave_59 Posted January 5, 2012 Report Share Posted January 5, 2012 uvm_sequence_item is extended from uvm_object. Unlike the OVM's get_config_* methods, the uvm_config_db#(type)::get() take context and scope arguments. class my_bus_seq extends uvm_sequence #( my_bus_sequence_item ); string scope_name = ""; task body(); my_bus_config m_config; if( scope_name == "" ) begin scope_name = get_full_name(); // this is { sequencer.get_full_name() , get_name() } end if( !uvm_config_db #( my_bus_config )::get( null , scope_name , "my_bus_config" , m_config ) ) begin `uvm_error(...) end endtask endclass See http://verificationacademy.com/uvm-ovm/Config/ConfiguringSequences Quote Link to comment Share on other sites More sharing options...
gaurav7589 Posted January 5, 2012 Author Report Share Posted January 5, 2012 Thank you very much , got your point. Another question is can I do the same in my transaction item itself?? I mean in my_bus_sequence_item ?? Quote Link to comment Share on other sites More sharing options...
dave_59 Posted January 5, 2012 Report Share Posted January 5, 2012 I think you are confusing the set_config/get_config methods from ovm_component with the class uvm_config_db. You can use uvm_config_db anywhere, even outside any class. The key thing is understanding how the first two arguments are used to build a string name. As the end of the article points out, you can use any arbitrary string for the scope name, it doesn't have to be related to any UVM naming scheme. But it is a very good idea to use whatever naming scheme the UVM uses. 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.