Hi
I am observing that I cannot turn off randomization for individual elements of an associative array of int indexed by string
I have the following code
class example_cfg_obj extends uvm_object;
`uvm_object_utils(example_cfg_obj)
rand int aaInt_String[string];
constraint default_c {
foreach(aaInt_String[sIdx]){
soft aaInt_String[sIdx] == 2;
}
};
function new(string name = "name");
super.new(name);
aaInt_String["x"] = 5;
aaInt_String["y"] = 6;
endfunction : new
function void pre_randomize();
string tmp;
super.pre_randomize();
//some procedural code
//The following statement works.i.e
//aaInt_String["x"] is not randomised and gets value 5
aaInt_String["x"].rand_mode(0);
//The following doesnt work
//aaInt_String["x"] is randomized and gets value of 2
tmp = "x";
aaInt_String[tmp].rand_mode(0);
endfunction : pre_randomize
endclass
Requesting some help with this behavior
Thanks
Venkatesh