Skip to content

Commit

Permalink
mac: Allow configuring usage of FullMemoryWE (fixes enjoy-digital#70)
Browse files Browse the repository at this point in the history
On ecp5 `FullMemoryWE` leads to an increase of DP16KD block mem, while
it works better on Intel/Altera devices according to
6c3af74.

Simple solution: Allow it to be toggled
  • Loading branch information
david-sawatzke committed Aug 8, 2021
1 parent 947ed03 commit 5a3be4e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions liteeth/mac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def __init__(self, phy, dw,
nrxslots = 2,
ntxslots = 2,
hw_mac = None,
timestamp = None):
timestamp = None,
full_mem_we = False):
assert interface in ["crossbar", "wishbone", "hybrid"]
self.submodules.core = LiteEthMACCore(phy, dw, endianness, with_preamble_crc)
self.csrs = []
Expand All @@ -38,13 +39,17 @@ def __init__(self, phy, dw,
self.rx_slots = CSRConstant(nrxslots)
self.tx_slots = CSRConstant(ntxslots)
self.slot_size = CSRConstant(2**bits_for(eth_mtu))
self.submodules.interface = FullMemoryWE()(LiteEthMACWishboneInterface(
wishbone_interface = LiteEthMACWishboneInterface(
dw = 32,
nrxslots = nrxslots,
ntxslots = ntxslots,
endianness = endianness,
timestamp = timestamp,
))
)
if full_mem_we:
self.submodules.interface = FullMemoryWE()(wishbone_interface)
else:
self.submodules.interface = wishbone_interface
self.ev, self.bus = self.interface.sram.ev, self.interface.bus
self.csrs = self.interface.get_csrs() + self.core.get_csrs()
if interface == "hybrid":
Expand Down

0 comments on commit 5a3be4e

Please sign in to comment.