From df1ba66c09ab0eb16e4d420a9a04b591be661c46 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 14 Oct 2022 10:10:43 +0200 Subject: [PATCH] Fix a crash in PowerRails when a terminal is not connected. * Bug: In Katana::GlobalNetTable::getRootNet(), when tracking up the net through the plug (to look if it's connected to a top level clock), we may encounter an *unconnected* plug. We where not checking that case, and went crashing. Now issue a warning and return NULL. This indicates that, up until now, we didn't encounter any unconnected Plug in our netlists. This did show up due to a building error in the SRAM Standard Cell generator. --- katana/src/PowerRails.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/katana/src/PowerRails.cpp b/katana/src/PowerRails.cpp index 4f577d37..e122db92 100644 --- a/katana/src/PowerRails.cpp +++ b/katana/src/PowerRails.cpp @@ -231,12 +231,12 @@ namespace { DeepNet* deepNet = getTopCell()->getDeepNet( path, net ); if (deepNet) { cdebug_log(159,0) << " Deep Clock Net:" << deepNet - << " state:" << NetRoutingExtension::getFlags(deepNet) << endl; + << " state:" << NetRoutingExtension::getFlags(deepNet) << endl; return NetRoutingExtension::isFixed(deepNet) ? _blockage : NULL; } else { cdebug_log(159,0) << " Top DeepNet:" << net - << " state:" << NetRoutingExtension::getFlags(net) << endl; + << " state:" << NetRoutingExtension::getFlags(net) << endl; } Path upPath = path; @@ -255,6 +255,12 @@ namespace { upNet = plug->getNet(); path = path.getHeadPath(); + + if (not upNet) { + cerr << Warning( "GlobalNetTable::getRootNet(): Unconnected %s." + , getString(plug).c_str() ) << endl; + return NULL; + } } }