From 73bd27b506211f12f8c515ad93a3cc65a3624dc3 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 16 Jan 2020 15:29:49 +0100 Subject: [PATCH] phy/s7rgmii: add 2ns delay on ctl/data --- liteeth/phy/s7rgmii.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/liteeth/phy/s7rgmii.py b/liteeth/phy/s7rgmii.py index cdc34bb..6a562d1 100644 --- a/liteeth/phy/s7rgmii.py +++ b/liteeth/phy/s7rgmii.py @@ -43,11 +43,14 @@ class LiteEthPHYRGMIITX(Module): class LiteEthPHYRGMIIRX(Module): - def __init__(self, pads): + def __init__(self, pads, delay=2.0e-9): self.source = source = stream.Endpoint(eth_phy_description(8)) # # # + delay_taps = int(delay/78e-12) # (78ps per tap) + assert delay_taps < 32 + rx_ctl_ibuf = Signal() rx_ctl_idelay = Signal() rx_ctl = Signal() @@ -58,7 +61,7 @@ class LiteEthPHYRGMIIRX(Module): self.specials += [ Instance("IBUF", i_I=pads.rx_ctl, o_O=rx_ctl_ibuf), Instance("IDELAYE2", - p_IDELAY_TYPE="FIXED", #p_IDELAY_VALUE=0, + p_IDELAY_TYPE="FIXED", p_IDELAY_VALUE=delay_taps, i_C=0, i_LD=0, i_CE=0, i_LDPIPEEN=0, i_INC=0, i_IDATAIN=rx_ctl_ibuf, o_DATAOUT=rx_ctl_idelay ), @@ -72,7 +75,7 @@ class LiteEthPHYRGMIIRX(Module): self.specials += [ Instance("IBUF", i_I=pads.rx_data[i], o_O=rx_data_ibuf[i]), Instance("IDELAYE2", - p_IDELAY_TYPE="FIXED", #p_IDELAY_VALUE=0, + p_IDELAY_TYPE="FIXED", p_IDELAY_VALUE=delay_taps, i_C=0, i_LD=0, i_CE=0, i_LDPIPEEN=0, i_INC=0, i_IDATAIN=rx_data_ibuf[i], o_DATAOUT=rx_data_idelay[i] ),