Update gen.py to work with latest LiteX in wishbone mode

Previously, it would fail with:

$ liteeth/gen.py examples/wishbone_mii.yml
[snip]
Traceback (most recent call last):
  File "liteeth/gen.py", line 346, in <module>
    main()
  File "liteeth/gen.py", line 331, in main
    soc = MACCore(platform, core_config)
  File "liteeth/gen.py", line 244, in __init__
    self.add_wb_master(bridge.wishbone)
  File "[...]/litex/soc/integration/soc_core.py", line 202, in add_wb_master
    self.bus.add_master(master=wbm)
  File "[...]/litex/soc/integration/soc.py", line 347, in add_master
    master = self.add_adapter(name, master, "m2s")
  File "[...]/litex/soc/integration/soc.py", line 316, in add_adapter
    bridge_cls = {
KeyError: (<class 'migen.genlib.record.Record'>, <class 'litex.soc.interconnect.wishbone.Interface'>)
This commit is contained in:
Xiretza 2020-08-22 10:57:35 +02:00
parent 792013a175
commit 6a9a5132f6
No known key found for this signature in database
GPG Key ID: 17B78226F7139993
1 changed files with 3 additions and 8 deletions

View File

@ -234,14 +234,9 @@ class MACCore(PHYCore):
self.add_csr("ethmac")
# Wishbone Interface -----------------------------------------------------------------------
class _WishboneBridge(Module):
def __init__(self, interface):
self.wishbone = interface
self.wishbone.data_width = 32
bridge = _WishboneBridge(self.platform.request("wishbone"))
self.submodules += bridge
self.add_wb_master(bridge.wishbone)
wb_bus = wishbone.Interface()
self.add_wb_master(wb_bus)
self.comb += wb_bus.connect_to_pads(self.platform.request("wishbone"), mode="slave")
# Interrupt Interface ----------------------------------------------------------------------
self.comb += self.platform.request("interrupt").eq(self.ethmac.ev.irq)