1 from migen
.fhdl
.std
import *
2 from migen
.bus
import wishbone
4 from misoclib
.soc
import SoC
, mem_decoder
5 from misoclib
.com
.liteeth
.phy
import LiteEthPHY
6 from misoclib
.com
.liteeth
.mac
import LiteEthMAC
9 def __init__(self
, platform
, **kwargs
):
10 SoC
.__init
__(self
, platform
,
11 clk_freq
=int((1/(platform
.default_clk_period
))*1000000000),
13 with_sdram
=True, sdram_size
=16*1024,
16 class MiniSoC(BaseSoC
):
21 csr_map
.update(BaseSoC
.csr_map
)
26 interrupt_map
.update(BaseSoC
.interrupt_map
)
29 "ethmac": 0x30000000, # (shadow @0xb0000000)
31 mem_map
.update(BaseSoC
.mem_map
)
33 def __init__(self
, platform
, **kwargs
):
34 BaseSoC
.__init
__(self
, platform
, **kwargs
)
36 self
.submodules
.ethphy
= LiteEthPHY(platform
.request("eth_clocks"), platform
.request("eth"))
37 self
.submodules
.ethmac
= LiteEthMAC(phy
=self
.ethphy
, dw
=32, interface
="wishbone", with_hw_preamble_crc
=False)
38 self
.add_wb_slave(mem_decoder(self
.mem_map
["ethmac"]), self
.ethmac
.bus
)
39 self
.add_memory_region("ethmac", self
.mem_map
["ethmac"]+0x80000000, 0x2000)
41 default_subtarget
= BaseSoC