Skip to content

Commit

Permalink
integration/soc/bus_addresing_convert: Simplify and skip on AXI/AXI-L…
Browse files Browse the repository at this point in the history
…ite interface since already handled in bridges.
  • Loading branch information
enjoy-digital committed Nov 9, 2023
1 parent 03a0739 commit 4b9c866
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions litex/soc/integration/soc.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,24 +350,22 @@ def bus_addressing_convert(interface, direction):
# Same Addressing, return un-modified interface.
if interface.addressing == self.addressing:
return interface
# AXI/AXI-Lite interface, Bus-Addressing conversion already handled in Bus-Standard conversion.
elif isinstance(interface, (axi.AXIInterface, axi.AXILiteInterface)):
return interface
# Different Addressing: Return adapted interface.
else:
interface_cls = type(interface)
assert interface_cls == wishbone.Interface # FIXME: Remove limitation.
adapted_interface = interface_cls(
data_width = self.data_width,
address_width = self.address_width,
addressing = self.addressing,
)
address_shift = log2_int(interface.data_width//8)
print(adapted_interface)
print(adapted_interface.addressing)
print(address_shift)
self.comb += adapted_interface.connect(interface, omit={"adr"})
if direction == "m2s":
self.comb += interface.connect(adapted_interface, omit={"adr"})
self.comb += adapted_interface.adr.eq(interface.adr[address_shift:])
elif direction == "s2m":
self.comb += adapted_interface.connect(interface, omit={"adr"})
if direction == "s2m":
self.comb += interface.adr.eq(adapted_interface.adr[address_shift:])
return adapted_interface

Expand Down

0 comments on commit 4b9c866

Please sign in to comment.