From f9ab6e147a2c70eb826119235ee34fbe713624d8 Mon Sep 17 00:00:00 2001 From: "N. Engelhardt" Date: Mon, 30 Oct 2023 16:30:34 +0100 Subject: [PATCH] mem: only import attributes from ports if the memory doesn't have them yet --- kernel/mem.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/mem.cc b/kernel/mem.cc index 40345b81d..01c866770 100644 --- a/kernel/mem.cc +++ b/kernel/mem.cc @@ -149,7 +149,8 @@ void Mem::emit() { wr_port_xlat.push_back(i); for (auto &port : rd_ports) { for (auto attr: port.attributes) - cell->attributes.insert(attr); + if (!cell->has_attribute(attr.first)) + cell->attributes.insert(attr); if (port.cell) { module->remove(port.cell); port.cell = nullptr; @@ -213,7 +214,8 @@ void Mem::emit() { cell->setPort(ID::RD_DATA, rd_data); for (auto &port : wr_ports) { for (auto attr: port.attributes) - cell->attributes.insert(attr); + if (!cell->has_attribute(attr.first)) + cell->attributes.insert(attr); if (port.cell) { module->remove(port.cell); port.cell = nullptr; @@ -251,7 +253,8 @@ void Mem::emit() { cell->setPort(ID::WR_DATA, wr_data); for (auto &init : inits) { for (auto attr: init.attributes) - cell->attributes.insert(attr); + if (!cell->has_attribute(attr.first)) + cell->attributes.insert(attr); if (init.cell) { module->remove(init.cell); init.cell = nullptr;