File tree Expand file tree Collapse file tree 3 files changed +36
-15
lines changed Expand file tree Collapse file tree 3 files changed +36
-15
lines changed Original file line number Diff line number Diff line change @@ -2504,6 +2504,13 @@ class dbNet : public dbObject
25042504 // /
25052505 void renameWithModNetInHighestHier ();
25062506
2507+ // /
2508+ // / Check if this net is internal to the given module.
2509+ // / A net is internal if all its iterms belong to instances within the module
2510+ // / and it has no bterms.
2511+ // /
2512+ bool isInternalTo (dbModule* module ) const ;
2513+
25072514 // /
25082515 // / Check issues such as multiple drivers, no driver, or dangling net
25092516 // /
Original file line number Diff line number Diff line change @@ -878,23 +878,20 @@ void _dbModule::copyModuleInsts(dbModule* old_module,
878878 // net_name = u0/_001_ <-- External net crossing module
879879 // boundary.
880880 std::string old_net_name = old_net->getName ();
881- if (old_module->getModInst () != nullptr ) {
882- std::string modinst_name = old_module->getHierarchicalName ();
883- if (old_net_name.compare (0 , modinst_name.length (), modinst_name) != 0 ) {
884- // Skip external net crossing module boundary.
885- // It will be connected later.
886- debugPrint (logger,
887- utl::ODB,
888- " replace_design" ,
889- 3 ,
890- " Skip: dbNet '{}'. Hierarchy_prefix='{}'\n " ,
891- old_net_name,
892- modinst_name);
893- continue ;
894- }
881+ if (old_net->isInternalTo (old_module) == false ) {
882+ // Skip external net crossing module boundary.
883+ // It will be connected later.
884+ debugPrint (logger,
885+ utl::ODB,
886+ " replace_design" ,
887+ 3 ,
888+ " Skip: non-internal dbNet '{}' of old_module '{}'.\n " ,
889+ old_net_name,
890+ old_module->getHierarchicalName ());
891+ continue ;
895892 }
896- new_net_name += block->getBaseName (old_net_name.c_str ());
897893
894+ new_net_name += block->getBaseName (old_net_name.c_str ());
898895 auto it = new_net_name_map.find (new_net_name);
899896 if (it != new_net_name_map.end ()) {
900897 // Connect to an existing local net
Original file line number Diff line number Diff line change @@ -2599,4 +2599,21 @@ void dbNet::renameWithModNetInHighestHier()
25992599 }
26002600}
26012601
2602+ bool dbNet::isInternalTo (dbModule* module ) const
2603+ {
2604+ // If it's connected to any top-level ports (BTerms), it's not internal.
2605+ if (!getBTerms ().empty ()) {
2606+ return false ;
2607+ }
2608+
2609+ // Check all instance terminals (ITerms) it's connected to.
2610+ for (dbITerm* iterm : getITerms ()) {
2611+ if (iterm->getInst ()->getModule () != module ) {
2612+ return false ;
2613+ }
2614+ }
2615+
2616+ return true ;
2617+ }
2618+
26022619} // namespace odb
You can’t perform that action at this time.
0 commit comments