Let's say we have a class with a bunch of random variables (around 100 rand
variables). Now, I want to randomize only one of the variables from that class and the rest of the variables should be the same. How do I do that?
class rand_var extends vmm_data;
rand bit abc;
rand bit [3:0] cde;
rand bit en;
...
endclass
Now from one of the task, I want to randomize abc
only, not any other variables of rand_var
.
task custom_task();
rand_var rand1;
rand1 = new config
if (config.randomize () with {
})
else $display("randomization failed");