Can u help generate pattern 10110111011110111110 using SV constraint.
class A;
rand bit [19:0] pattern;
constraint c { pattern == 20'b10110111011110111110;}
endclass
Next question?
Amazing. Thanks.
Next question is if there is any generic way to write this for extending this pattern.?
class pattern;
rand bit [19:0] data;
constraint c{
foreach(data[i]) {
if(i inside {1,4,8,13,19})
data[19-i] == 1'b0;
else
data[19-i] == 1'b1;
}
}
endclass