gateware: import basic instance of LiteEth

more config to do, need to fully hook everything up, but it's a start
This commit is contained in:
David Lenfesty 2023-02-07 21:00:38 -07:00
parent 0bf4fb5c1b
commit 5595c7d113
3 changed files with 39 additions and 0 deletions

27
gateware/eth.py Normal file
View File

@ -0,0 +1,27 @@
from amaranth import *
from amaranth_soc.wishbone.bus import Interface
# TODO maybe this should just call liteeth_gen to close the loop?
class LiteEth(Elaboratable, Interface):
def __init__(self):
# TODO change ADDR width
Interface.__init__(self, addr_width=32, data_width=32)
self.rgmii_eth_clocks_tx = Signal()
def elaborate(self, platform):
platform.add_file("liteeth_core.v", open("liteeth/gateware/liteeth_core.v", 'r').read())
m = Module()
core = Instance(
"liteeth_core",
i_sys_clock=ClockSignal(),
o_rgmii_eth_clocks_tx=self.rgmii_eth_clocks_tx,
)
m.submodules.core = core
return m

3
gateware/gen_liteeth.sh Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
liteeth_gen --output-dir liteeth liteeth_config.yaml

View File

@ -0,0 +1,9 @@
clk_freq: 10e6
phy: LiteEthECP5PHYRGMII
core: wishbone
endianness: little
# THese shouldn't be needed
device: LFE5U-45F-6BG381C
vendor: lattice
toolchain: trellis