write a constraint for upper bit is equal to lower bit
module test();
class packet;
rand bit {31:0] a;
constraint c1 { foreach(a[i)
{
a[i]==a[31-i]}};}
endclass
packet p1=new();
initial begin
p1.randomize();
$display("the value is =%p", p1.a);
end
endmodule
Comments
Post a Comment