From f37de50a49620384c0c85838b5bc66d4c87ff334 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 23 Jun 2025 11:13:26 +0200 Subject: [PATCH] Cleanup --- himbaechel/uarch/gatemate/cells.cc | 2 +- himbaechel/uarch/gatemate/constids.inc | 1 + himbaechel/uarch/gatemate/gatemate.cc | 6 +++--- himbaechel/uarch/gatemate/pack.cc | 12 ++++++------ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/himbaechel/uarch/gatemate/cells.cc b/himbaechel/uarch/gatemate/cells.cc index 40d7dbfd..98f743b4 100644 --- a/himbaechel/uarch/gatemate/cells.cc +++ b/himbaechel/uarch/gatemate/cells.cc @@ -33,7 +33,7 @@ CellInfo *GateMatePacker::create_cell_ptr(IdString type, IdString name) cell->ports[id].name = id; cell->ports[id].type = dir; }; - if (type.in(id_CPE_LT, id_CPE_LT_U, id_CPE_LT_L, id_CPE_L2T4, id_CPE_L2T5_U, id_CPE_L2T5_L, id_CPE_CI)) { + if (type.in(id_CPE_LT, id_CPE_LT_U, id_CPE_LT_L, id_CPE_L2T4, id_CPE_L2T5_U, id_CPE_L2T5_L, id_CPE_CI, id_CPE_DUMMY)) { add_port(id_IN1, PORT_IN); add_port(id_IN2, PORT_IN); add_port(id_IN3, PORT_IN); diff --git a/himbaechel/uarch/gatemate/constids.inc b/himbaechel/uarch/gatemate/constids.inc index aa1024dd..5f47bea3 100644 --- a/himbaechel/uarch/gatemate/constids.inc +++ b/himbaechel/uarch/gatemate/constids.inc @@ -2236,3 +2236,4 @@ X(CPE_EN_CIN) X(CPE_CONCAT) X(CPE_ADDCIN) X(CPE_CI) +X(CPE_DUMMY) diff --git a/himbaechel/uarch/gatemate/gatemate.cc b/himbaechel/uarch/gatemate/gatemate.cc index 14174c8f..8ce9902c 100644 --- a/himbaechel/uarch/gatemate/gatemate.cc +++ b/himbaechel/uarch/gatemate/gatemate.cc @@ -255,7 +255,7 @@ void GateMateImpl::postPlace() } // Mark for deletion - else if (cell.second->type.in(id_CPE_L2T5_U,id_CPE_LT_U)) { + else if (cell.second->type.in(id_CPE_L2T5_U,id_CPE_LT_U, id_CPE_DUMMY)) { delete_cells.push_back(cell.second->name); } } @@ -353,9 +353,9 @@ bool GateMateImpl::isValidBelForCellType(IdString cell_type, BelId bel) const return cell_type.in(id_CPE_IBUF, id_CPE_OBUF, id_CPE_TOBUF, id_CPE_IOBUF, id_CPE_LVDS_IBUF, id_CPE_LVDS_TOBUF, id_CPE_LVDS_OBUF, id_CPE_LVDS_IOBUF); else if (bel_type == id_CPE_LT_U) - return cell_type.in(id_CPE_LT_U, id_CPE_LT, id_CPE_L2T4, id_CPE_L2T5_U); + return cell_type.in(id_CPE_LT_U, id_CPE_LT, id_CPE_L2T4, id_CPE_L2T5_U, id_CPE_DUMMY); else if (bel_type == id_CPE_LT_L) - return cell_type.in(id_CPE_LT_L, id_CPE_LT, id_CPE_L2T4, id_CPE_L2T5_L, id_CPE_CI); + return cell_type.in(id_CPE_LT_L, id_CPE_LT, id_CPE_L2T4, id_CPE_L2T5_L, id_CPE_CI, id_CPE_DUMMY); else if (bel_type == id_CPE_FF_U) return cell_type.in(id_CPE_FF_U, id_CPE_FF); else if (bel_type == id_CPE_FF_L) diff --git a/himbaechel/uarch/gatemate/pack.cc b/himbaechel/uarch/gatemate/pack.cc index f3941b9e..66b864b5 100644 --- a/himbaechel/uarch/gatemate/pack.cc +++ b/himbaechel/uarch/gatemate/pack.cc @@ -53,7 +53,7 @@ std::pair GateMatePacker::move_ram_i(CellInfo *cell, IdStri CellInfo *cpe_ramio = nullptr; NetInfo *net = cell->getPort(origPort); if (net) { - cpe_ramio = create_cell_ptr(id_CPE_RAMI, ctx->idf("%s$%s_cpe_ramio", cell->name.c_str(ctx), origPort.c_str(ctx))); + cpe_ramio = create_cell_ptr(id_CPE_RAMI, ctx->idf("%s$%s_rami", cell->name.c_str(ctx), origPort.c_str(ctx))); if (place) { cell->constr_children.push_back(cpe_ramio); cpe_ramio->cluster = cell->cluster; @@ -63,7 +63,7 @@ std::pair GateMatePacker::move_ram_i(CellInfo *cell, IdStri BelId b = ctx->getBelByLocation(cpe_loc); ctx->bindBel(b, cpe_ramio, PlaceStrength::STRENGTH_FIXED); } - CellInfo * cpe_half = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$%s_cpe_half", cell->name.c_str(ctx), origPort.c_str(ctx))); + CellInfo * cpe_half = create_cell_ptr(id_CPE_DUMMY, ctx->idf("%s$%s_cpe", cell->name.c_str(ctx), origPort.c_str(ctx))); if (place) { cpe_ramio->constr_children.push_back(cpe_half); cpe_half->cluster = cell->cluster; @@ -90,7 +90,7 @@ std::pair GateMatePacker::move_ram_o(CellInfo *cell, IdStri CellInfo *cpe_ramio = nullptr; NetInfo *net = cell->getPort(origPort); if (net) { - cpe_ramio = create_cell_ptr(id_CPE_RAMO, ctx->idf("%s$%s_cpe_ramio", cell->name.c_str(ctx), origPort.c_str(ctx))); + cpe_ramio = create_cell_ptr(id_CPE_RAMO, ctx->idf("%s$%s_ramo", cell->name.c_str(ctx), origPort.c_str(ctx))); if (place) { cell->constr_children.push_back(cpe_ramio); cpe_ramio->cluster = cell->cluster; @@ -100,7 +100,7 @@ std::pair GateMatePacker::move_ram_o(CellInfo *cell, IdStri BelId b = ctx->getBelByLocation(cpe_loc); ctx->bindBel(b, cpe_ramio, PlaceStrength::STRENGTH_FIXED); } - cpe_half = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$%s_cpe_half", cell->name.c_str(ctx), origPort.c_str(ctx))); + cpe_half = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$%s_cpe", cell->name.c_str(ctx), origPort.c_str(ctx))); if (place) { cpe_ramio->constr_children.push_back(cpe_half); cpe_half->cluster = cell->cluster; @@ -141,7 +141,7 @@ std::pair GateMatePacker::move_ram_io(CellInfo *cell, IdStr if (!i_net && !o_net) return std::make_pair(nullptr, nullptr); - CellInfo *cpe_ramio = create_cell_ptr(id_CPE_RAMIO, ctx->idf("%s$%s_cpe_ramio", cell->name.c_str(ctx), oPort.c_str(ctx))); + CellInfo *cpe_ramio = create_cell_ptr(id_CPE_RAMIO, ctx->idf("%s$%s_ramio", cell->name.c_str(ctx), oPort.c_str(ctx))); if (place) { cell->constr_children.push_back(cpe_ramio); cpe_ramio->cluster = cell->cluster; @@ -151,7 +151,7 @@ std::pair GateMatePacker::move_ram_io(CellInfo *cell, IdStr BelId b = ctx->getBelByLocation(cpe_loc); ctx->bindBel(b, cpe_ramio, PlaceStrength::STRENGTH_FIXED); } - CellInfo *cpe_half = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$%s_cpe_half", cell->name.c_str(ctx), oPort.c_str(ctx))); + CellInfo *cpe_half = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$%s_cpe", cell->name.c_str(ctx), oPort.c_str(ctx))); if (place) { cpe_ramio->constr_children.push_back(cpe_half); cpe_half->cluster = cell->cluster;