Skip to content

Commit

Permalink
mem: only import attributes from ports if the memory doesn't have the…
Browse files Browse the repository at this point in the history
…m yet
  • Loading branch information
nakengelhardt committed Oct 30, 2023
1 parent 080da69 commit 2627631
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/mem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2627631

Please sign in to comment.