28b1430ec1b38a5d677e2fce7c62c5e06fbe38e5
3 from misoc
.interconnect
.csr
import *
4 from misoc
.interconnect
.stream
import *
5 from misoc
.cores
.liteeth_mini
.common
import *
6 from misoc
.cores
.liteeth
.mini
.generic
import *
9 class LiteEthPHYLoopbackCRG(Module
, AutoCSR
):
11 self
._reset
= CSRStorage()
15 self
.clock_domains
.cd_eth_rx
= ClockDomain()
16 self
.clock_domains
.cd_eth_tx
= ClockDomain()
18 self
.cd_eth_rx
.clk
.eq(ClockSignal()),
19 self
.cd_eth_tx
.clk
.eq(ClockSignal())
22 reset
= self
._reset
.storage
24 self
.cd_eth_rx
.rst
.eq(reset
),
25 self
.cd_eth_tx
.rst
.eq(reset
)
29 class LiteEthPHYLoopback(Module
, AutoCSR
):
32 self
.submodules
.crg
= LiteEthLoopbackPHYCRG()
33 self
.sink
= Sink(eth_phy_description(8))
34 self
.source
= Source(eth_phy_description(8))
35 self
.comb
+= Record
.connect(self
.sink
, self
.source
)