print the inside values 1.30 to 2.39 by using constraint
module test();
class packet;
rand bit [7:0] a;
int real b;
constraint a {a inside {[130:239];}
function void post_randomize();
b=a/10.00;
endfunction
endclass
packet p1=new();
assert(p1.randomize());
$display(the value is =%p", p1.a);
endmodule
Comments
Post a Comment