I have a 2D array:: bit[31:0] reg_a [24], I want to randomise reg_a in a way that all reg_a[i] is mutually exclusive. none of the bits of any two reg_a[i] should be overlapping.
rand bit [31:0] reg_a [24];
if the array was just 2 deep this would be the solution.
foreach(reg_a[i]) begin
std::randomize (reg_a[i]) with {
foreach(reg_a[i][j]){
if(i!=0){
reg_a[i][j] != reg_a[i-1][j];
}
}
};
if we could somehow also add another constraint which is on a counter, which counts $countones(reg_a[i]). like valid = valid+$countones[i] and on this valid if we put a constraint like, valid <32, will it work?
Any other solution is also welcome. Thanks.