Method

In reply to chr_sue:

See, I have taken int pclk in my configuration class and realtime polling (it is a timer). Now I have to change this timer into a counter and then scaledown. So for this i need to write a methode in which i will multiply timer value (0.6us) with pclk (500Mhz, 250Mhz, 125Mhz) and then divide it by scaledown value. I have also taken a variable in configuration class (int polling_cnt) for the counter.

This was your code: class scaling;
bit pclk;

function realtime pri(int scaledown);
realtime polling = 0.6us;
$display("scaledown = %d ", scaledown);
pri = polling / scaledown;
$display("pri = %f ", pri);
return pri;
endfunction
endclass

module priyanka();
int scaledown = 1;;
realtime polling_cnt;
scaling s=new();
initial begin
scaledown = 200;
repeat (3) begin
polling_cnt = s.pri(scaledown);
$display("%f ",polling_cnt);
scaledown = 10 * scaledown;
end
end
endmodule

-so, please help me in writing that method.