From 86cad629eca03f0c66cb49d7499e801b63113eb9 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 6 Mar 2020 09:15:22 -0500 Subject: [PATCH 1/3] Modified the LEF read routine to use the via geometry manipulations from the cifoutput section, NOT the cifinput section. This change underscores the point that LEF and DEF formats define mask data, and therefore all LEF and DEF routines should be using the CIF input/output methods and layers. That is a major code change; meanwhile, getting via layer values from the cifoutput parameters is slightly more reliable than using cifinput, since there is good reason to use templayers to read vias, and that sort of indirection makes it difficult to determine a simple relationship between a LEF cut layer and a magic contact. --- lef/lefRead.c | 48 +++++++++++++++--------------------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/lef/lefRead.c b/lef/lefRead.c index 2a8e8ab4..cbe484ec 100644 --- a/lef/lefRead.c +++ b/lef/lefRead.c @@ -1770,10 +1770,18 @@ origin_error: * * For LEF contact types matching magic contact types, size the * LEF contact cut to cover the minimum rectangle in the other - * layers that satisfies the CIF/GDS contact generation. Use - * the "cifinput" style to determine how much the via layer - * needs to grow to make a contact area. If the "cifinput" - * style is not defined, then determine rules from "cifoutput". + * layers that satisfies the CIF/GDS contact generation. + * + * NOTE: If a "cifinput" style is defined, then the via + * remains the size declared in LEF or DEF file, and the + * magic view of the via is generated by applying "cifinput" + * rules when painting into the magic database. If no input + * style is defined, then the output style rules are used to + * modify the cut size to match the way the via is defined in + * magic, and the result is painted directly. + * + * If a "cifinput" style exists, then this routine does + * nothing and has no side effects. * *------------------------------------------------------------ */ @@ -1783,36 +1791,10 @@ void LefGrowVia(curlayer, currect, lefl) Rect *currect; lefLayer *lefl; { - if (DBIsContact(curlayer) && cifCurReadStyle != NULL) - { - int growSize; + /* To be completed: This should be deprecated by moving the entire */ + /* LEF and DEF read routines to use the cifinput style. */ - /* Get the amount (in magic units) that the layer needs to */ - /* expand according to the "cifinput" style rules to convert */ - /* a contact cut to a magic contact layer. */ - - growSize = CIFReadGetGrowSize(curlayer); - - /* All internal LEF via geometry values are doubled */ - growSize <<= 1; - - if (growSize % cifCurReadStyle->crs_scaleFactor == 0) - growSize /= cifCurReadStyle->crs_scaleFactor; - else - growSize = growSize / cifCurReadStyle->crs_scaleFactor + 1; - - if (growSize > 0) - { - /* cifinput styles expect the cut size to be correct, so */ - /* there is no check for correctness of the layer. */ - - currect->r_xbot = currect->r_xbot - growSize; - currect->r_ybot = currect->r_ybot - growSize; - currect->r_xtop = currect->r_xtop + growSize; - currect->r_ytop = currect->r_ytop + growSize; - } - } - else if (DBIsContact(curlayer) && CIFCurStyle != NULL) + if (DBIsContact(curlayer) && CIFCurStyle != NULL) { int edgeSize = 0, contSize, halfSize; From 5a7eb37d6e559ff19481132ad29ca3873d98a175 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 6 Mar 2020 09:19:50 -0500 Subject: [PATCH 2/3] Updated VERSION along with the LEF/DEF input correction. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e3635811..8c913ded 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.2.192 +8.2.193 From 12833170848452bf0410ac8eb967c66683107772 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 6 Mar 2020 13:46:40 -0500 Subject: [PATCH 3/3] Corrected the improper use of the variable DRCErrorTable twice, which results in conflicting hash tables and a crash, if a DRC section is reloaded when doing an error count. --- drc/DRCtech.c | 13 +++++++------ drc/drc.h | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drc/DRCtech.c b/drc/DRCtech.c index d56bdaaf..19a906dc 100644 --- a/drc/DRCtech.c +++ b/drc/DRCtech.c @@ -40,6 +40,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/ CIFStyle *drcCifStyle = NULL; bool DRCForceReload = FALSE; +HashTable DRCWhyErrorTable; /* Table of DRC errors */ /* * DRC interaction radius being used (not necessarily the same as @@ -339,7 +340,7 @@ drcTechNewStyle() * Adds to the DRCWhyList if whystring has not been used before. * Calls StrDup() and increments DRCWhySize. DRCWhyList is allocated * in blocks of 50 at a time and only expands when filled. - * Temporary hash table DRCErrorTable is used to determine if a + * Temporary hash table DRCWhyErrorTable is used to determine if a * string entry is unique. It is cleared after the technology file * has been processed. * ---------------------------------------------------------------------------- @@ -351,7 +352,7 @@ drcWhyCreate(whystring) { HashEntry *he; - he = HashLookOnly(&DRCErrorTable, whystring); + he = HashLookOnly(&DRCWhyErrorTable, whystring); if (he != NULL) return (int)((pointertype)HashGetValue(he)); @@ -370,7 +371,7 @@ drcWhyCreate(whystring) } DRCCurStyle->DRCWhySize++; - he = HashFind(&DRCErrorTable, whystring); + he = HashFind(&DRCWhyErrorTable, whystring); HashSetValue(he, (char *)((pointertype)DRCCurStyle->DRCWhySize)); DRCCurStyle->DRCWhyList[DRCCurStyle->DRCWhySize] = StrDup((char **)NULL, whystring); @@ -564,7 +565,7 @@ DRCTechStyleInit() DRCCurStyle->DRCFlags = (char)0; DRCCurStyle->DRCWhySize = 0; - HashInit(&DRCErrorTable, 16, HT_STRINGKEYS); + HashInit(&DRCWhyErrorTable, 16, HT_STRINGKEYS); /* First DRC entry is associated with the statically-allocated */ /* drcArrayCookie and has a tag of DRC_ARRAY_OVERLAP_TAG = 1 */ @@ -3505,8 +3506,8 @@ drcTechFinalStyle(style) DRCCookie **dpp, **dp2back; TileType i, j; - /* Done with DRCErrorTable */ - HashKill(&DRCErrorTable); + /* Done with DRCWhyErrorTable */ + HashKill(&DRCWhyErrorTable); /* If the scale factor is not 1, then divide all distances by */ /* the scale factor, take the ceiling, and save the (negative) */ diff --git a/drc/drc.h b/drc/drc.h index 69f6ff35..aa3c5def 100644 --- a/drc/drc.h +++ b/drc/drc.h @@ -219,7 +219,6 @@ extern DRCKeep *DRCStyleList; /* List of available DRC styles */ extern DRCStyle *DRCCurStyle; /* Current DRC style in effect */ extern CellDef *DRCdef; /* Current cell being checked for DRC */ extern CellUse *DRCuse, *DRCDummyUse; -extern HashTable DRCErrorTable; /* DRC errors, hashed by name */ /* * Internal procedures