Skip to content

Commit

Permalink
soc/bus_addressing_convert: Fix s2m adaptation case, the 2 adaptation…
Browse files Browse the repository at this point in the history
… cases were swapped.
  • Loading branch information
enjoy-digital committed Dec 8, 2023
1 parent 8d6120c commit acd66f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions litex/soc/integration/soc.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,9 @@ def bus_addressing_convert(interface, direction):
if direction == "s2m":
self.comb += adapted_interface.connect(interface, omit={"adr"})
if (interface.addressing == "word") and (self.addressing == "byte"):
self.comb += interface.adr[address_shift:].eq(adapted_interface.adr)
if (interface.addressing == "byte") and (self.addressing == "word"):
self.comb += interface.adr.eq(adapted_interface.adr[address_shift:])
if (interface.addressing == "byte") and (self.addressing == "word"):
self.comb += interface.adr[address_shift:].eq(adapted_interface.adr)
return adapted_interface

# Bus-Standard conversion helper.
Expand Down Expand Up @@ -1756,6 +1756,7 @@ def add_ethernet(self, name="ethmac", phy=None, phy_cd="eth", dynamic_ip=False,
ethmac_region_size = (ethmac.rx_slots.constant + ethmac.tx_slots.constant)*ethmac.slot_size.constant
ethmac_region = SoCRegion(origin=self.mem_map.get(name, None), size=ethmac_region_size, cached=False)
self.bus.add_slave(name=name, slave=ethmac.bus, region=ethmac_region)

# Add IRQs (if enabled).
if self.irq.enabled:
self.irq.add(name, use_loc_if_exists=True)
Expand Down

0 comments on commit acd66f1

Please sign in to comment.