@@ -174,12 +174,16 @@ void Checker::checkFloatingChips(dbMarkerCategory* top_cat,
174174 auto * cat = dbMarkerCategory::createOrReplace (top_cat, " Floating chips" );
175175 logger_->warn (utl::ODB , 151 , " Found {} floating chip sets" , groups.size ());
176176 for (const auto & group : groups | std::views::reverse) {
177- auto * marker = dbMarker::create (cat);
178- for (auto * chip : group) {
179- marker->addShape (chip->cuboid );
180- marker->addSource (chip->chip_inst_path .back ());
177+ // dbMarker::create returns nullptr once the category hits its
178+ // max_markers_ limit; skip silently in that case to avoid a
179+ // null-deref crash.
180+ if (auto * marker = dbMarker::create (cat)) {
181+ for (auto * chip : group) {
182+ marker->addShape (chip->cuboid );
183+ marker->addSource (chip->chip_inst_path .back ());
184+ }
185+ marker->setComment (" Isolated chip set starting with " + group[0 ]->name );
181186 }
182- marker->setComment (" Isolated chip set starting with " + group[0 ]->name );
183187 }
184188 }
185189}
@@ -212,13 +216,14 @@ void Checker::checkOverlappingChips(dbMarkerCategory* top_cat,
212216 auto * cat = dbMarkerCategory::createOrReplace (top_cat, " Overlapping chips" );
213217 logger_->warn (utl::ODB , 156 , " Found {} overlapping chips" , overlaps.size ());
214218 for (const auto & [inst1, inst2] : overlaps) {
215- auto * marker = dbMarker::create (cat);
216- auto intersection = inst1->cuboid .intersect (inst2->cuboid );
217- marker->addShape (intersection);
218- marker->addSource (inst1->chip_inst_path .back ());
219- marker->addSource (inst2->chip_inst_path .back ());
220- marker->setComment (
221- fmt::format (" Chips {} and {} overlap" , inst1->name , inst2->name ));
219+ if (auto * marker = dbMarker::create (cat)) {
220+ auto intersection = inst1->cuboid .intersect (inst2->cuboid );
221+ marker->addShape (intersection);
222+ marker->addSource (inst1->chip_inst_path .back ());
223+ marker->addSource (inst2->chip_inst_path .back ());
224+ marker->setComment (
225+ fmt::format (" Chips {} and {} overlap" , inst1->name , inst2->name ));
226+ }
222227 }
223228 }
224229}
@@ -238,12 +243,13 @@ void Checker::checkInternalExtUsage(dbMarkerCategory* top_cat,
238243 464 ,
239244 " Region {} is internal_ext but unused" ,
240245 region.region_inst ->getChipRegion ()->getName ());
241- auto * marker = dbMarker::create (cat);
242- marker->addSource (region.region_inst );
243- marker->addShape (region.cuboid );
244- marker->setComment (
245- fmt::format (" Unused internal_ext region: {}" ,
246- region.region_inst ->getChipRegion ()->getName ()));
246+ if (auto * marker = dbMarker::create (cat)) {
247+ marker->addSource (region.region_inst );
248+ marker->addShape (region.cuboid );
249+ marker->setComment (
250+ fmt::format (" Unused internal_ext region: {}" ,
251+ region.region_inst ->getChipRegion ()->getName ()));
252+ }
247253 }
248254 }
249255 }
@@ -270,14 +276,15 @@ void Checker::checkConnectionRegions(dbMarkerCategory* top_cat,
270276 if (!cat) {
271277 cat = dbMarkerCategory::createOrReplace (top_cat, " Connection regions" );
272278 }
273- auto * marker = dbMarker::create (cat);
274- marker->addSource (conn.connection );
275- std::string msg = fmt::format (" Invalid connection {}: {} to {}" ,
276- conn.connection ->getName (),
277- describe (conn.top_region , marker),
278- describe (conn.bottom_region , marker));
279- marker->setComment (msg);
280- logger_->warn (utl::ODB , 207 , msg);
279+ if (auto * marker = dbMarker::create (cat)) {
280+ marker->addSource (conn.connection );
281+ std::string msg = fmt::format (" Invalid connection {}: {} to {}" ,
282+ conn.connection ->getName (),
283+ describe (conn.top_region , marker),
284+ describe (conn.bottom_region , marker));
285+ marker->setComment (msg);
286+ logger_->warn (utl::ODB , 207 , msg);
287+ }
281288 count++;
282289 }
283290 }
@@ -300,15 +307,19 @@ void Checker::checkBumpPhysicalAlignment(dbMarkerCategory* top_cat,
300307 if (!cat) {
301308 cat = dbMarkerCategory::createOrReplace (top_cat, " Bump Alignment" );
302309 }
303- auto * marker = dbMarker::create (cat);
304- marker->addSource (bump.bump_inst );
305- marker->addShape (Rect (p.x () - kBumpMarkerHalfSize ,
306- p.y () - kBumpMarkerHalfSize ,
307- p.x () + kBumpMarkerHalfSize ,
308- p.y () + kBumpMarkerHalfSize ));
309- marker->setComment (
310- fmt::format (" Bump is outside its parent region {}" ,
311- region.region_inst ->getChipRegion ()->getName ()));
310+ // dbMarker::create returns nullptr once the category hits its
311+ // max_markers_ limit; skip the addSource/addShape/setComment
312+ // chain to avoid a null-deref crash in that case.
313+ if (auto * marker = dbMarker::create (cat)) {
314+ marker->addSource (bump.bump_inst );
315+ marker->addShape (Rect (p.x () - kBumpMarkerHalfSize ,
316+ p.y () - kBumpMarkerHalfSize ,
317+ p.x () + kBumpMarkerHalfSize ,
318+ p.y () + kBumpMarkerHalfSize ));
319+ marker->setComment (
320+ fmt::format (" Bump is outside its parent region {}" ,
321+ region.region_inst ->getChipRegion ()->getName ()));
322+ }
312323 }
313324 }
314325 }
@@ -379,21 +390,22 @@ void Checker::checkLogicalConnectivity(dbMarkerCategory* top_cat,
379390 cat = dbMarkerCategory::createOrReplace (top_cat,
380391 " Logical Connectivity" );
381392 }
382- auto * marker = dbMarker::create (cat);
383- marker->addSource (top_bump.bump_inst );
384- marker->addSource (bot_bump->bump_inst );
385- marker->addShape (conn.top_region ->cuboid .intersect (
386- conn.bottom_region ->cuboid )); // Mark overlap region
387-
388- std::string msg = fmt::format (
389- " Bumps at ({}, {}) align physically but logical connectivity "
390- " mismatch: Top bump {} vs Bottom bump {}" ,
391- p.x (),
392- p.y (),
393- get_net_name (&top_bump),
394- get_net_name (bot_bump));
395- marker->setComment (msg);
396- logger_->warn (utl::ODB , 208 , msg);
393+ if (auto * marker = dbMarker::create (cat)) {
394+ marker->addSource (top_bump.bump_inst );
395+ marker->addSource (bot_bump->bump_inst );
396+ marker->addShape (conn.top_region ->cuboid .intersect (
397+ conn.bottom_region ->cuboid )); // Mark overlap region
398+
399+ std::string msg = fmt::format (
400+ " Bumps at ({}, {}) align physically but logical connectivity "
401+ " mismatch: Top bump {} vs Bottom bump {}" ,
402+ p.x (),
403+ p.y (),
404+ get_net_name (&top_bump),
405+ get_net_name (bot_bump));
406+ marker->setComment (msg);
407+ logger_->warn (utl::ODB , 208 , msg);
408+ }
397409 }
398410 }
399411 }
0 commit comments