kamboj Posted November 5, 2012 Report Share Posted November 5, 2012 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 Quote Link to comment Share on other sites More sharing options...
uwes Posted November 5, 2012 Report Share Posted November 5, 2012 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 Quote Link to comment Share on other sites More sharing options...
kamboj Posted November 5, 2012 Author Report Share Posted November 5, 2012 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 Quote Link to comment Share on other sites More sharing options...
uwes Posted November 5, 2012 Report Share Posted November 5, 2012 No, I said use as type "uvm_bitstream_t". All integral type for set-config-int are mapped to this one. Quote Link to comment Share on other sites More sharing options...
kamboj Posted November 5, 2012 Author Report Share Posted November 5, 2012 Thanks.. i am able to set to correct value now. Just want to ask if this ("uvm_bitstream_t") applies for +uvm_set_config_string also ? Quote Link to comment Share on other sites More sharing options...
uwes Posted November 6, 2012 Report Share Posted November 6, 2012 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 Quote Link to comment Share on other sites More sharing options...
nbalakrishnan Posted March 13, 2013 Report Share Posted March 13, 2013 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. Quote Link to comment Share on other sites More sharing options...
uwes Posted March 18, 2013 Report Share Posted March 18, 2013 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 Quote Link to comment Share on other sites More sharing options...
Ananth Posted June 6, 2019 Report Share Posted June 6, 2019 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] Quote Link to comment Share on other sites More sharing options...
David Black Posted June 6, 2019 Report Share Posted June 6, 2019 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.