Skip to content

Commit 5fbd675

Browse files
committed
Clamp ifg_cnt at zero
1 parent 128dc29 commit 5fbd675

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tb/xgmii_ep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def logic():
175175
deficit_idle_cnt = 0
176176
elif enable:
177177
if (ifg_cnt > bw-1 and self.enable_dic) or ifg_cnt > 0:
178-
ifg_cnt -= bw
178+
ifg_cnt = max(ifg_cnt - bw, 0)
179179
txd.next = 0x0707070707070707 if bw == 8 else 0x07070707
180180
txc.next = 0xff if bw == 8 else 0xf
181181
elif dl:

0 commit comments

Comments
 (0)