Jump to content

Illegal assignment to class type uvm_component [...]from class type [...]


vvs3693
 Share

Recommended Posts

Hi,

I have a variable (int) in my sequence. How can I set the value to it in my test case ??

My sequence looks like this:

class my_seq extends uvm_sequence#(my_txn);
int N; 
  `uvm_object_utils_begin(my_seqI) // register with factory
    `uvm_field_int (N,UVM_DEFAULT)
  `uvm_object_utils_end
  function new(string name);
    super.new(name);
  endfunction

  task body();   
    repeat (N)
      begin
	....
      end
  endtask:body  
 
endclass:my_seq

I have an handle for sequence in test. From My test case I want to control the value of N, Is there any other method other than assigning the value directly ?

Link to comment
Share on other sites

Don't understand the title of your post in relation to the question being asked.

For classes not derived from uvm_component, you must explicitly get the value from the config db.

if (!uvm_config_db#(int)(context,"",N)) `uvm_error("code","message);

You context could be m_sequencer or it could be null if this is a global setting.

Link to comment
Share on other sites

Don't understand the title of your post in relation to the question being asked.

For classes not derived from uvm_component, you must explicitly get the value from the config db.

if (!uvm_config_db#(int)(context,"",N)) `uvm_error("code","message);

You context could be m_sequencer or it could be null if this is a global setting.

Hi Dave,

Thanks a lot... That solved my problem...

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.

 Share

×
×
  • Create New...