class sample;
randc bit[2:0]count;
endclass
module top;
sample sample_test;
initial begin
sample_inst=new();
repeat(20) begin
sample_inst.randomize();
sample.print();// this is assumed to be written in class
end
end
endmodule
I understood what rand and randc are, but I don't understand how we are able to use randomize() without writing a function in SystemVerilog class. I assume it is an inbuilt function. I have seen many codes online which don't have randomize function written in the class.