write a constraint such that for a memory of 1kb, 30 to 70 address would not select
module test();
class packet;
rand bit [7:0] a;
constraint c1 { a inside {[0:1023]};}
constraint c2 { ! {[a<30|| a>70]};}
endclass
packet p1=new()
initial
begin
p1.randomize();
$display("the value is = %p", p1.a);
endmodule
Comments
Post a Comment