From 0159376cda9c03cac63dbccbca3ad02d9516f8e7 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Sat, 10 Nov 2018 17:35:31 -0800 Subject: [PATCH] Simplify IFG count handling --- tb/xgmii_ep.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tb/xgmii_ep.py b/tb/xgmii_ep.py index 741544a3..7ec9585a 100644 --- a/tb/xgmii_ep.py +++ b/tb/xgmii_ep.py @@ -186,12 +186,6 @@ class XGMIISource(object): if name is not None: print("[%s] Sending frame %s" % (name, repr(frame))) - if ifg_cnt >= 4: - deficit_idle_cnt = ifg_cnt - 4 - else: - deficit_idle_cnt = ifg_cnt - ifg_cnt = 0 - assert len(dl) > 0 assert dl[0] == 0x55 dl[0] = 0xfb @@ -201,11 +195,15 @@ class XGMIISource(object): d = 0 c = 0 - if ifg_cnt > 0: + if bw == 8 and ifg_cnt >= 4: + ifg_cnt = max(ifg_cnt-4, 0) k = 4 d = 0x07070707 c = 0xf + deficit_idle_cnt = ifg_cnt + ifg_cnt = 0 + for i in range(k,bw): if len(dl) > 0: d |= dl.pop(0) << (8*i)