This is to know whether there is an easier method to do this.
There is a packet
class A
{
rand int a;
rand int b;
rand int c;
rand int d;
rand int e;
rand int f;
constraint a_c{b==0->a==0;}
.
.
.
.
.
}
I have a task which randomizes A and does some operation on its members
task operate_on_A();
A obj_a;
assert(obj_a.randomize() with a==10;b==3;c==9;} // few values would be fixed, few random
endtask
From a test, i would like to call this task
d,e and f get random values as of now.
i would like to control from the test whether d,e,f would get random values or fixed values passed from the test when calling the task. If am passing fixed values, it should get the fixed values, else it should be randomized.
How can this be done in a generic manner and what is the best possible way in uvm ?