build/sim: use a real timebase in the simulation
[litex.git] / litex / tools / litex_sim.py
index 4c33dbb72208669517e6df5c0274b4a2a20aca18..24c8b91444edf6e4253e6e2e7fd6d26d4d66a8d6 100755 (executable)
@@ -343,7 +343,9 @@ def main():
     soc_kwargs     = soc_sdram_argdict(args)
     builder_kwargs = builder_argdict(args)
 
-    sim_config = SimConfig(default_clk="sys_clk")
+    # timebase is half of the period of main simulation clock
+    sys_clk_freq = int(1e6)
+    sim_config = SimConfig(default_clk="sys_clk", timebase_ps=(1/sys_clk_freq / 2) * 1e12)
 
     # Configuration --------------------------------------------------------------------------------