Skip to content

Commit

Permalink
mac/wishbone: Fix ntxslots/nrxslots == 1 case.
Browse files Browse the repository at this point in the history
Previously, a common decoder was used for TX and RX slots, so there were at least
two interfaces connected. With the TX/RX decoupling, we now only have on interface
per decoder when ntxslots/nrxslots == 1.
  • Loading branch information
enjoy-digital committed Jul 2, 2024
1 parent a00640b commit ec7320f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions liteeth/mac/wishbone.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ def _expose_wishbone_sram_interfaces(self, bus, dw, mems, nslots, read_only, wri
wb_slaves = []
sram_depth = math.ceil(eth_mtu/(dw//8))
decoderoffset = log2_int(sram_depth, need_pow2=False)
decoderbits = log2_int(len(wb_sram_ifs))
decoderbits = max(log2_int(len(wb_sram_ifs)), 1)
for n, wb_sram_if in enumerate(wb_sram_ifs):
def slave_filter(a, v=n):
return a[decoderoffset:decoderoffset+decoderbits] == v
return a[decoderoffset:decoderoffset + decoderbits] == v
wb_slaves.append((slave_filter, wb_sram_if.bus))
self.submodules += wb_sram_if
wb_con = wishbone.Decoder(bus, wb_slaves, register=True)
Expand Down

0 comments on commit ec7320f

Please sign in to comment.