memory_libmap: Fix params emitted for unused ports for consistency.
authorMarcelina Kościelnicka <mwk@0x04.net>
Thu, 16 Jun 2022 04:04:04 +0000 (06:04 +0200)
committerMarcelina Kościelnicka <mwk@0x04.net>
Thu, 16 Jun 2022 06:14:08 +0000 (08:14 +0200)
passes/memory/memory_libmap.cc

index 898e0af85d6db36f5ba5ec2b6cc1c15f03c91753..d77e4be3002f74b8f4bf2d7e4ecfd9796741a939 100644 (file)
@@ -1706,10 +1706,11 @@ void MemMapping::emit_port(const MemConfig &cfg, std::vector<Cell*> &cells, cons
                                if (pdef.wrbe_separate) {
                                        cell->setPort(stringf("\\PORT_%s_WR_EN", name), State::S0);
                                        cell->setPort(stringf("\\PORT_%s_WR_BE", name), hw_wren);
-                                       cell->setParam(stringf("\\PORT_%s_WR_BE_WIDTH", name), GetSize(hw_wren));
+                                       if (cfg.def->width_mode != WidthMode::Single)
+                                               cell->setParam(stringf("\\PORT_%s_WR_BE_WIDTH", name), GetSize(hw_wren));
                                } else {
                                        cell->setPort(stringf("\\PORT_%s_WR_EN", name), hw_wren);
-                                       if (cfg.def->byte != 0)
+                                       if (cfg.def->byte != 0 && cfg.def->width_mode != WidthMode::Single)
                                                cell->setParam(stringf("\\PORT_%s_WR_EN_WIDTH", name), GetSize(hw_wren));
                                }
                        }