Jump to content

Config db insequence item


Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...