Skip to content

Commit faf185d

Browse files
committedMar 16, 2015
liteeth: make gmii phy generic
1 parent d8b59c0 commit faf185d

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed
 

‎misoclib/com/liteeth/phy/gmii.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from migen.genlib.io import DDROutput
2+
13
from misoclib.com.liteeth.common import *
24
from misoclib.com.liteeth.generic import *
35

@@ -32,23 +34,17 @@ def __init__(self, pads):
3234
]
3335
self.comb += source.eop.eq(eop)
3436

35-
# CRG is the only Xilinx specific module.
36-
# TODO: use generic code or add support for others vendors
3737
class LiteEthPHYGMIICRG(Module, AutoCSR):
3838
def __init__(self, clock_pads, pads, with_hw_init_reset):
3939
self._reset = CSRStorage()
4040
###
4141
self.clock_domains.cd_eth_rx = ClockDomain()
4242
self.clock_domains.cd_eth_tx = ClockDomain()
43-
self.specials += [
44-
Instance("ODDR",
45-
p_DDR_CLK_EDGE="SAME_EDGE",
46-
i_C=ClockSignal("eth_tx"), i_CE=1, i_S=0, i_R=0,
47-
i_D1=1, i_D2=0, o_Q=clock_pads.gtx,
48-
),
49-
Instance("BUFG", i_I=clock_pads.rx, o_O=self.cd_eth_rx.clk),
43+
self.specials += DDROutput(1, 0, clock_pads.gtx, ClockSignal("eth_tx"))
44+
self.comb += [
45+
self.cd_eth_rx.clk.eq(clock_pads.rx), # Let the synthesis tool insert
46+
self.cd_eth_tx.clk.eq(self.cd_eth_rx.clk) # the appropriate clock buffer
5047
]
51-
self.comb += self.cd_eth_tx.clk.eq(self.cd_eth_rx.clk)
5248

5349
if with_hw_init_reset:
5450
reset = Signal()

0 commit comments

Comments
 (0)
Please sign in to comment.