|
| 1 | +from migen.genlib.io import DDROutput |
| 2 | + |
1 | 3 | from misoclib.com.liteeth.common import *
|
2 | 4 | from misoclib.com.liteeth.generic import *
|
3 | 5 |
|
@@ -32,23 +34,17 @@ def __init__(self, pads):
|
32 | 34 | ]
|
33 | 35 | self.comb += source.eop.eq(eop)
|
34 | 36 |
|
35 |
| -# CRG is the only Xilinx specific module. |
36 |
| -# TODO: use generic code or add support for others vendors |
37 | 37 | class LiteEthPHYGMIICRG(Module, AutoCSR):
|
38 | 38 | def __init__(self, clock_pads, pads, with_hw_init_reset):
|
39 | 39 | self._reset = CSRStorage()
|
40 | 40 | ###
|
41 | 41 | self.clock_domains.cd_eth_rx = ClockDomain()
|
42 | 42 | 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 |
50 | 47 | ]
|
51 |
| - self.comb += self.cd_eth_tx.clk.eq(self.cd_eth_rx.clk) |
52 | 48 |
|
53 | 49 | if with_hw_init_reset:
|
54 | 50 | reset = Signal()
|
|
0 commit comments