print the values 34,24,[23:40], 50, 30 by using constraint
module test();
class packet;
rand bit [7:0] a;
constraint a1 { a inside {[ 34, [23:40], 50, 30]};}
endclass
packet p1=new();
assert(p1.randomize());
$display("the value is =%p", p1.a);
endmodule
Comments
Post a Comment