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:
parent
0bf4fb5c1b
commit
5595c7d113
27
gateware/eth.py
Normal file
27
gateware/eth.py
Normal 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
3
gateware/gen_liteeth.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
liteeth_gen --output-dir liteeth liteeth_config.yaml
|
9
gateware/liteeth_config.yaml
Normal file
9
gateware/liteeth_config.yaml
Normal 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
|
Loading…
Reference in New Issue
Block a user