but when I am randomizing a variable grater than 32 bit using randc it shows’ error :-
The object ‘vari’, which is 33 bits wide, was declared as randc. This is not
allowed; an object may not be declared randc if it is more than 32 bits in
width.
as per LRM:
To reduce memory requirements, implementations can impose a limit on the maximum size of a randc variable, but it should be no less than 8 bits.
less than 8 bit also working to randc variable
example:
class mypacket;
randc bit [32:0] vari;
endclass
module tb_top;
mypacket pkt;
initial begin
pkt = new ();
repeat(20)begin
pkt.randomize ();
$display ("Mode : %0d", pkt.vari);
end
end
endmodule