Jump to content
kamboj

Not able to configure thru +uvm_set_config_int:

Recommended Posts

Hi,

I want to configure a variable thru command line interface +uvm_set_config_int=uvm_test_top.env,test_variable,7

In my env. i have declared test variable as

int test_variable;

I am able to get UVM_CMDLINE_PROC calling in test.log

UVM_INFO @ 0: reporter [uVM_CMDLINE_PROC] Applying config setting from the command line: +uvm_set_config_int=uvm_test_top.env,test_variable,7

but when i print value of test_variable it's coming 0.

By configuring thru command line +uvm_set_config_int, it calls set_config_int(), which call uvm_config_db.

My question is i need do get the value of test_variable by uvm_config_db#(int), then i will be able to get the correct value as 7 or I am missing something here?

I am using UVM-1.1a and VCS compiler F-2011.12-SP1-1_Full64

Thanks

Pankaj

Share this post


Link to post
Share on other sites

Hi,

I want to configure a variable thru command line interface +uvm_set_config_int=uvm_test_top.env,test_variable,7

In my env. i have declared test variable as

int test_variable;

I am able to get UVM_CMDLINE_PROC calling in test.log

UVM_INFO @ 0: reporter [uVM_CMDLINE_PROC] Applying config setting from the command line: +uvm_set_config_int=uvm_test_top.env,test_variable,7

but when i print value of test_variable it's coming 0.

By configuring thru command line +uvm_set_config_int, it calls set_config_int(), which call uvm_config_db.

My question is i need do get the value of test_variable by uvm_config_db#(int), then i will be able to get the correct value as 7 or I am missing something here?

I am using UVM-1.1a and VCS compiler F-2011.12-SP1-1_Full64

Thanks

Pankaj

Set-config-int corresponds to uvm_config_db#(uvm_bitstream_t).

/uwe

Share this post


Link to post
Share on other sites

Thanks for response.

So you mean to say after +uvm_set_config_int=uvm_test_top.env,test_variable,7.

I need to get the value by

uvm_config_db#(bit[3:0])::get(this,"","test_variable",test_variable_i);

I tried this also, but didn't work, still getting value as 0.

--Pankaj

Share this post


Link to post
Share on other sites

no, uvm_bitstream_t applies only to all integral types accessed via set_config_int. set_config_string uses "string" as type for the config_db and set_config_object uses "uvm_object" as type.

/uwe

Share this post


Link to post
Share on other sites

I have exactly the same problem. This a legacy code.

int var_size=4096;

setting from cmd line as follows , didnt overwrite the default value and reflect the new value 512.

+uvm_set_config_int=*,var_size,512

even after changing the type to uvm_bitstream_t also , it didnt work.

The code also has other int type variables that get set thru +uvm_set_config_int. So I am guessing

probaly there is some localparam that has the same name var_size. but didnt find anything yet. Since noticed this post , thought of reposting the question.. any clues on how else I can debug this? Thanks.

Share this post


Link to post
Share on other sites

hi,

to have +uvm_set_config_int=*,var_size,512

work the following needs to be in place:

1. it needs to be a uvm_field_int (if you use autoconfiguration)

2. it have to be a field of a component

3. there should be no other overrides

/uwe

Share this post


Link to post
Share on other sites

Hi,

I want to randomize the value here.

+uvm_set_config_int=*,var_size,<randomized value>

can we pass the randomized value here?

example:

+uvm_set_config_int=*,var_size,inside [100:500]

Share this post


Link to post
Share on other sites

Not directly, but you could create two knobs and use them in a constraint.

+uvm_set_config.int=*,minsize,100 +uvm_set_config_int,*,max_size,500

then internally

class MySeq extends uvm_sequence #(MyTrans);
  `uvm_object_utils(MySeq)
  rand  int var_size;
  rand int min_size, max_size;
  constraint Size { min_size <= var_size; var_size <= max_size; }
  ....
endclass: MySeq

 

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.


×
×
  • Create New...