@@ -285,25 +285,74 @@ void IRSolver::reportUnconnectedNodes() const
285285 tool_category, net_->getName ().c_str ());
286286
287287 if (!results.unconnected_nodes .empty ()) {
288+ if (logger_->debugCheck (utl::PSM, " reportnodes" , 1 )) {
289+ odb::dbMarkerCategory* category
290+ = odb::dbMarkerCategory::create (net_category, " Unconnected node" );
291+ for (auto * node : results.unconnected_nodes ) {
292+ logger_->warn (utl::PSM,
293+ 42 ,
294+ " Unconnected node on net {} at location ({:4.3f}um, "
295+ " {:4.3f}um), layer: {}." ,
296+ net_->getName (),
297+ node->getPoint ().getX () / dbu,
298+ node->getPoint ().getY () / dbu,
299+ node->getLayer ()->getName ());
300+
301+ odb::dbMarker* marker = odb::dbMarker::create (category);
302+ if (marker == nullptr ) {
303+ continue ;
304+ }
305+ marker->addSource (net_);
306+ marker->setTechLayer (node->getLayer ());
307+ marker->addShape (node->getPoint ());
308+ }
309+ }
310+ std::map<odb::dbTechLayer*, IRNetwork::ShapeTree> shapes;
288311 odb::dbMarkerCategory* category
289- = odb::dbMarkerCategory::create (net_category, " Unconnected node" );
290- for (auto * node : results.unconnected_nodes ) {
291- logger_->warn (utl::PSM,
292- 38 ,
293- " Unconnected node on net {} at location ({:4.3f}um, "
294- " {:4.3f}um), layer: {}." ,
295- net_->getName (),
296- node->getPoint ().getX () / dbu,
297- node->getPoint ().getY () / dbu,
298- node->getLayer ()->getName ());
312+ = odb::dbMarkerCategory::create (net_category, " Unconnected shape" );
299313
300- odb::dbMarker* marker = odb::dbMarker::create (category);
314+ std::set<const Shape*> reported_shapes;
315+ odb::dbMarker* marker = nullptr ;
316+ for (auto * node : results.unconnected_nodes ) {
317+ if (shapes.find (node->getLayer ()) == shapes.end ()) {
318+ // get tree is not found
319+ shapes[node->getLayer ()] = network_->getShapeTree (node->getLayer ());
320+ }
321+ const auto & layer_shapes = shapes[node->getLayer ()];
322+ for (auto itr = layer_shapes.qbegin (
323+ boost::geometry::index::intersects (node->getPoint ()));
324+ itr != layer_shapes.qend ();
325+ itr++) {
326+ const Shape* shape = *itr;
327+
328+ if (reported_shapes.find (shape) != reported_shapes.end ()) {
329+ continue ;
330+ }
331+ reported_shapes.insert (shape);
332+
333+ const odb::Rect rect = shape->getShape ();
334+ logger_->warn (utl::PSM,
335+ 38 ,
336+ " Unconnected shape on net {} at ({:4.3f}um, "
337+ " {:4.3f}um) - ({:4.3f}um, {:4.3f}um), layer: {}." ,
338+ net_->getName (),
339+ rect.xMin () / dbu,
340+ rect.yMin () / dbu,
341+ rect.xMax () / dbu,
342+ rect.yMax () / dbu,
343+ shape->getLayer ()->getName ());
344+
345+ marker = odb::dbMarker::create (category);
346+ if (marker == nullptr ) {
347+ break ;
348+ }
349+ marker->addSource (net_);
350+ marker->setTechLayer (shape->getLayer ());
351+ marker->addShape (rect);
352+ }
301353 if (marker == nullptr ) {
302- continue ;
354+ break ;
303355 }
304- marker->addSource (net_);
305- marker->setTechLayer (node->getLayer ());
306- marker->addShape (node->getPoint ());
307356 }
308357 }
309358
0 commit comments