From af94e8497a4fa50f6d7df1b38295fdb2412c4ba1 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 28 Feb 2022 18:52:32 +0100 Subject: [PATCH] litedram_gen: Enable Read-Modify-Write support with ECC. --- litedram/gen.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/litedram/gen.py b/litedram/gen.py index a9bb794..fc5e266 100755 --- a/litedram/gen.py +++ b/litedram/gen.py @@ -673,9 +673,9 @@ class LiteDRAMCore(SoCCore): assert port.get("data_width", None) is not None ecc_port = self.sdram.crossbar.get_port() user_port = LiteDRAMNativePort( - mode = ecc_port.mode, + mode = ecc_port.mode, address_width = ecc_port.address_width, - data_width = port.get("data_width") + data_width = port.get("data_width") ) ecc = LiteDRAMNativePortECC(user_port, ecc_port, with_error_injection=False) setattr(self.submodules, f"ecc_{name}", ecc) @@ -735,7 +735,11 @@ class LiteDRAMCore(SoCCore): data_width = user_port.data_width, address_width = user_port.address_width + log2_int(user_port.data_width//8), id_width = port["id_width"]) - axi2native = LiteDRAMAXI2Native(axi_port, user_port) + axi2native = LiteDRAMAXI2Native( + axi = axi_port, + port = user_port, + with_read_modify_write = port.get("ecc", False) + ) self.submodules += axi2native platform.add_extension(get_axi_user_port_ios(name, axi_port.address_width,