mirror of
https://github.com/fpganinja/taxi.git
synced 2025-12-09 00:48:40 -08:00
eth: Avoid hardcoding clock period
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
@@ -144,7 +144,7 @@ async def run_test(dut, gbx_cfg=None, payload_lengths=None, payload_data=None, i
|
|||||||
|
|
||||||
if tx_frame.start_lane == 4:
|
if tx_frame.start_lane == 4:
|
||||||
# start in lane 4 reports 1 full cycle delay, so subtract half clock period
|
# start in lane 4 reports 1 full cycle delay, so subtract half clock period
|
||||||
tx_frame_sfd_ns -= 3.2
|
tx_frame_sfd_ns -= tb.clk_period/2
|
||||||
|
|
||||||
tb.log.info("RX frame PTP TS: %f ns", ptp_ts_ns)
|
tb.log.info("RX frame PTP TS: %f ns", ptp_ts_ns)
|
||||||
tb.log.info("TX frame SFD sim time: %f ns", tx_frame_sfd_ns)
|
tb.log.info("TX frame SFD sim time: %f ns", tx_frame_sfd_ns)
|
||||||
@@ -153,7 +153,7 @@ async def run_test(dut, gbx_cfg=None, payload_lengths=None, payload_data=None, i
|
|||||||
assert rx_frame.tdata == test_data
|
assert rx_frame.tdata == test_data
|
||||||
assert frame_error == 0
|
assert frame_error == 0
|
||||||
if gbx_cfg is None:
|
if gbx_cfg is None:
|
||||||
assert abs(ptp_ts_ns - tx_frame_sfd_ns - 6.4) < 0.01
|
assert abs(ptp_ts_ns - tx_frame_sfd_ns - tb.clk_period) < 0.01
|
||||||
|
|
||||||
assert tb.sink.empty()
|
assert tb.sink.empty()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user