Issue in generation of Clock

Hi,

I’m trying to generate a clock in my tb_top as following

always #20.830000ns REFCLK_24 = (REFCLK_24===1'bx)?1'b0: ~REFCLK_24 ;

On looking at the dump I’m able to find the periods as 20.83 and 20.83

When I’ve written assertion

property detect_flash_glitch;
realtime leading;
realtime diff;
@(flash_clk)
(1,leading = $realtime) |=> (1,diff=($realtime-leading))|->((diff >= duration_flash),$display(" FLASH : leading = %f diff= %f duration =%f ",leading,diff,duration_flash,$realtime));
endproperty

---- ISSUE ----
When the assertion is checking the clock, we are getting the duration as either 20.8299 or 20.8301
and assertion is failing.

Here why the REFCLK generated is not as expected (20.83) ?

FYI: I’ve maintained time scale as 1ns/1ps

In reply to santosh_kumar_vangala:
See http://floating-point-gui.de/