Constraint for 32 bit address, to generate continuous 10 bits as 0 and remaining bits as 1.
Solution:
rand bit[31:0] addr;
rand bit[4:0] i;
constraint c1{
addr = 32'b1;
i<22;
foreach(addr[i])
addr[i+:9] = 0;
}
I wanted to ask, is there any other way to achieve this without using the slicing operator?