From aa4c5e9ee5061366db51da61dfcf330d4929f7f4 Mon Sep 17 00:00:00 2001 From: Alain Dargelas Date: Fri, 28 Feb 2025 21:54:28 -0800 Subject: [PATCH] working splinets --- passes/silimate/annotate_cell_fanout.cc | 29 ++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/passes/silimate/annotate_cell_fanout.cc b/passes/silimate/annotate_cell_fanout.cc index 7f6e91e09..c03a4d084 100644 --- a/passes/silimate/annotate_cell_fanout.cc +++ b/passes/silimate/annotate_cell_fanout.cc @@ -328,6 +328,15 @@ void calculateFanout(RTLIL::Module *module, SigMap &sigmap, dict netsToSplitS; std::string netsToSplit; + std::string portsToSplit; for (Cell* cell : cellsToFixFanout) { RTLIL::SigSpec cellOutSig; for (auto &conn : cell->connections()) { @@ -384,11 +394,20 @@ struct AnnotateCellFanout : public ScriptPass { break; } } - netsToSplit += std::string(" w:") + getParentWire(cellOutSig)->name.c_str(); - netsToSplit += std::string(" x:") + getParentWire(cellOutSig)->name.c_str(); + std::string parent = getParentWire(cellOutSig)->name.c_str(); + parent = substringUntil(parent, '['); + if (netsToSplitS.find(parent) == netsToSplitS.end()) { + netsToSplit += std::string(" w:") + parent; // Wire + portsToSplit += std::string(" o:") + parent; // Port + netsToSplitS.insert(parent); + std::string splitnets = std::string("splitnets ") + netsToSplit; + Pass::call(design, splitnets); + splitnets = std::string("splitnets -ports_only ") + portsToSplit; + Pass::call(design, splitnets); + netsToSplit = ""; + portsToSplit = ""; + } } - std::string splitnets = std::string("splitnets ") + netsToSplit; - Pass::call(design, splitnets); } {