Jump to content
Sign in to follow this  
mrforever

problem about configuring sub-sequencers of virtual sequencer using uvm_config_db

Recommended Posts

Hi, all,

I met one problem when i configure sub-sequencers of virtual sequencer using uvm_config_db. Here are the codes and VCS reports:

-------codes-------

class my_subenv extends uvm_env;

   ...

   function void build_phase(uvm_phase phase);

      ...

      v_sqr = vsequencer::type_id::create($sformatf("v_sqr%0d", subenv_ID), this);
      // configuration, set default_sequence as the virtual sequencer
      uvm_config_db#(uvm_object_wrapper)::set(this, "v_sqr.run_phase", "default_sequence", vsequence::type_id::get());
      ...
   endfunction : build_phase
 
   function void connect_phase(uvm_phase phase);
      ...
      uvm_config_db#(uvm_sequencer)::set(this, "v_sqr", "cfg_sqr", this.cfg_agt.cfg_sqr);
      uvm_config_db#(uvm_sequencer)::set(this, "v_sqr", "str_sqr", this.str_agt.str_sqr);
      ...
   endfunction : connect_phase
   ...
endclass : my_subenv
 
-------VCS reports--------
Error-[iCTTFC] Incompatible complex type usage
../sv/00_top/my_subenv.sv, 101
  Incompatible complex type usage in task or function call.
  The following expression is incompatible with the formal parameter of the  
  function. The type of the actual is 'class my_pkg::my_config_sequencer',
  while the type of the formal is 'class uvm_pkg::uvm_sequencer#(class 
  uvm_pkg::uvm_sequence_item,class uvm_pkg::uvm_sequence_item)'. Expression: 
  this.cfg_agt.cfg_sqr
  Source info: 
  vcs_paramclassrepository::__vcs_dummy_uvm_pkg_uvm_config_db_3133241903_.set(this,  "v_sqr", "cfg_sqr", this.cfg_agt.cfg_sqr)
Error-[iCTTFC] Incompatible complex type usage
../sv/00_top/my_subenv.sv, 102
  Incompatible complex type usage in task or function call.
  The following expression is incompatible with the formal parameter of the
  function. The type of the actual is 'class my_pkg::my_str_sequencer',
  while the type of the formal is 'class uvm_pkg::uvm_sequencer#(class
  uvm_pkg::uvm_sequence_item,class uvm_pkg::uvm_sequence_item)'. Expression:
  this.str_agt.str_sqr
  Source info:
  vcs_paramclassrepository::__vcs_dummy_uvm_pkg_uvm_config_db_3133241903_.set(this,
  "v_sqr", "str_sqr", this.str_agt.str_sqr)
 
By the way, my_config_sequencer and my_str_sequencer are classes derived from uvm_sequencer, so I think the complex type should be compatible. And the codes are wriiten according chapter 4.8 of the uvm_users_guide_1.1.pdf document. Should there be some phrases like uvm_config_db#(uvm_sequencer)::get() in my_subenv or other places?
 
Thanks
 
regards
mrforever

Share this post


Link to post
Share on other sites

Hi,

 

You need to use a type that is compatible with your sequencers for the config_db parameter.

 

If you have created a custom sequencer class, e.g. class my_sequencer extends uvm_sequencer#(my_seq_item_type) you cannot assign a reference to it to a plain uvm_sequencer variable (remember the uvm_sequencer class is parameterised - by default, the parameter type is uvm_sequence_item).

 

I suggest that you create a typedef for each sequencer specialization and use that as the parameter for the config_db

 

 

 

typedef uvm_sequencer #(my_str_sequence_item) str_sequencer;
...

uvm_config_db#(str_sequencer)::set(this, "v_sqr", "cfg_sqr", this.cfg_agt.cfg_sqr);
 

 

 

 

Regards,

Dave

 

===========

David Long

Doulos

http://www.doulos.com

 

 

Share this post


Link to post
Share on other sites

Hi,

 

You need to use a type that is compatible with your sequencers for the config_db parameter.

 

If you have created a custom sequencer class, e.g. class my_sequencer extends uvm_sequencer#(my_seq_item_type) you cannot assign a reference to it to a plain uvm_sequencer variable (remember the uvm_sequencer class is parameterised - by default, the parameter type is uvm_sequence_item).

 

I suggest that you create a typedef for each sequencer specialization and use that as the parameter for the config_db

 

 

 

typedef uvm_sequencer #(my_str_sequence_item) str_sequencer;
...

uvm_config_db#(str_sequencer)::set(this, "v_sqr", "cfg_sqr", this.cfg_agt.cfg_sqr);
 

 

Hi David,

Thanks for your reply, I have solved it using the way like yours. 

 

Regards,

mrforever

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...