Jump to content
Sign in to follow this  
sathyakiran.p

overriding a registered local variable in a sequence from test

Recommended Posts

Following is the example

 

class my_sequence extends uvm_sequence...

 

string file_name;

`uvm_object_utils_begin(mysequence)

`uvm_field_string(file_name,UVM_DEFAULT)

`uvm_object_utils_end

 

endclass

 

 

class basic_test extends from uvm_test

 

function build_phase(..)

set_config_string("*", "file_name", abc.txt);

endfunction

 

endclass..

 

 

I am passing file_name(abc.txt) from test with set_config_string, but, it is not taking effect.

 

I did the same thing in driver. it worked well. does UVM supports, overriding local variables in sequence.

 

Please let me know...

 

Thanks,

Satya

Share this post


Link to post
Share on other sites

Sequences are uvm_object's; whereas, the driver is a uvm_component. The field automation macros automatic configuration fetching works due to super.build_phase automation. You will need to do two things:

 

  1. Add the following in your sequence: 
    `declare_p_sequencer(SEQR_TYPE)
  2. In function pre_start add: 
    uvm_config_db#(string)::get(p_sequencer,"","file_name",file_name);

Notice that the information is tied to the sequencer that the sequence is running on.

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...