Skip to content

Commit

Permalink
integration/soc/bus_addressing_convert: Fix interface<->adapted_inter…
Browse files Browse the repository at this point in the history
…face connection.
  • Loading branch information
enjoy-digital committed Nov 9, 2023
1 parent d2441c6 commit 55bb9b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion litex/soc/integration/soc.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,14 @@ def bus_addressing_convert(interface, direction):
addressing = self.addressing,
)
address_shift = log2_int(interface.data_width//8)
self.comb += adapted_interface.connect(interface, omit={"adr"})
if direction == "m2s":
self.comb += interface.connect(adapted_interface, omit={"adr"})
if (interface.addressing == "word") and (self.addressing == "byte"):
self.comb += adapted_interface.adr[address_shift:].eq(interface.adr)
if (interface.addressing == "byte") and (self.addressing == "word"):
self.comb += adapted_interface.adr.eq(interface.adr[address_shift:])
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"):
Expand Down

0 comments on commit 55bb9b9

Please sign in to comment.