From fede9d5c4d6560d3217577a33375a11421d4c7f8 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Wed, 20 Mar 2024 17:19:45 -0400 Subject: [PATCH] Fixed an error when reading a DEF file using generated vias in a non-default rule. The code was first failing to identify the via cut type from the generated via record, and then it was failing to return to the non-default rule width after the route exits the via. Both issues have been fixed. Thanks to Sylvain Munaut for providing a reproducible test case. --- VERSION | 2 +- lef/defRead.c | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index c1992c72..0d8233d7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.465 +8.3.466 diff --git a/lef/defRead.c b/lef/defRead.c index b8a3e9b5..adbb6ff1 100644 --- a/lef/defRead.c +++ b/lef/defRead.c @@ -441,7 +441,11 @@ DefAddRoutes(rootDef, f, oscale, special, netname, ruleset, defLayerMap, annotat routeList = addRoute; } + /* Set paintLayer to the contact cut type */ paintLayer = lefl->type; + if (!DBIsContact(lefl->type)) + if (lefl->info.via.lr != NULL) + paintLayer = lefl->info.via.lr->r_type; newRoute->r_r.r_xbot = refp.p_x + lefl->info.via.area.r_xbot; newRoute->r_r.r_ybot = refp.p_y + lefl->info.via.area.r_ybot; @@ -493,12 +497,26 @@ DefAddRoutes(rootDef, f, oscale, special, netname, ruleset, defLayerMap, annotat DBTypeLongNameTbl[stype]); */ routeLayer = stype; + lefl = defLayerMap[routeLayer].lefInfo; + + /* Get correct rule for nondefault rules */ + if (ruleset) + { + for (rule = ruleset->rule; rule; rule = rule->next) + if (rule->lefInfo == lefl) + break; + } + else + rule = NULL; + if (special) paintWidth = saveWidth; else - paintWidth = (lefl) ? lefl->info.route.width - : DEFAULT_WIDTH * DBLambda[1] / DBLambda[0]; + paintWidth = (rule) ? rule->width : + (lefl) ? lefl->info.route.width : + DEFAULT_WIDTH * DBLambda[1] / DBLambda[0]; + paintExtend = (special) ? 0 : paintWidth; break; }