File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -421,6 +421,40 @@ async def run_test(dut):
421
421
assert abs (mean (rel_diffs )) < 5
422
422
assert abs (mean (tod_diffs )) < 5
423
423
424
+ await RisingEdge (dut .clk )
425
+ tb .log .info ("Coherent tracking (250 MHz +0/-0.5%)" )
426
+
427
+ tb .set_ptp_clock_period (6.4 )
428
+ tb .set_clock_period (4.0 )
429
+
430
+ await RisingEdge (dut .clk )
431
+
432
+ period = 4.000
433
+ step = 0.0002
434
+ period_min = 4.0
435
+ period_max = 4.0 * (1 + 0.005 )
436
+
437
+ for i in range (5000 ):
438
+ period += step
439
+
440
+ if period <= period_min :
441
+ step = abs (step )
442
+ if period >= period_max :
443
+ step = - abs (step )
444
+
445
+ tb .set_clock_period (period )
446
+
447
+ for i in range (20 ):
448
+ await RisingEdge (dut .clk )
449
+
450
+ assert tb .dut .locked .value .integer
451
+
452
+ rel_diffs , tod_diffs = await tb .measure_ts_diff ()
453
+ tb .log .info (f"Difference (rel): { mean (rel_diffs )} ns (stdev: { stdev (rel_diffs )} )" )
454
+ tb .log .info (f"Difference (ToD): { mean (tod_diffs )} ns (stdev: { stdev (tod_diffs )} )" )
455
+ assert abs (mean (rel_diffs )) < 5
456
+ assert abs (mean (tod_diffs )) < 5
457
+
424
458
await RisingEdge (dut .clk )
425
459
tb .log .info ("Significantly slower (100 MHz)" )
426
460
You can’t perform that action at this time.
0 commit comments