Skip to content

Commit 5eec386

Browse files
committed
est: check if containers are empty
Signed-off-by: Eder Monteiro <[email protected]>
1 parent 13732c5 commit 5eec386

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/est/src/EstimateParasitics.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,10 @@ odb::dbTechLayer* EstimateParasitics::getPinLayer(const Pin* pin)
854854

855855
double EstimateParasitics::computeAverageCutResistance(Corner* corner)
856856
{
857+
if (layer_res_.empty()) {
858+
return 0.0;
859+
}
860+
857861
double total_resistance = 0.0;
858862
int count = 0;
859863

@@ -895,7 +899,13 @@ void EstimateParasitics::parasiticNodeConnectPins(
895899
{
896900
const PinSeq* pins = tree->pins(pt);
897901
if (pins) {
898-
odb::dbTechLayer* tree_layer = is_clk ? clk_layers_[0] : signal_layers_[0];
902+
odb::dbTechLayer* tree_layer;
903+
if (is_clk) {
904+
tree_layer = clk_layers_.empty() ? nullptr : clk_layers_[0];
905+
} else {
906+
tree_layer = signal_layers_.empty() ? nullptr : signal_layers_[0];
907+
}
908+
899909
for (const Pin* pin : *pins) {
900910
ParasiticNode* pin_node
901911
= parasitics_->ensureParasiticNode(parasitic, pin, network_);

0 commit comments

Comments
 (0)