From 7905e15ae3b66ed26349fb701b475ef93b566de5 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Wed, 14 Sep 2022 13:02:55 -0400 Subject: [PATCH] Enhanced the "def read -annotate" option to correctly annotate pins with class, use, and shape information from the DEF file PINS record. This is similar to what is done with LEF file annotation, but less sophisticated (only erases an existing pin if it is an exact match for pin name and location). --- VERSION | 2 +- lef/defRead.c | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 770482c0..0fe264b4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.323 +8.3.324 diff --git a/lef/defRead.c b/lef/defRead.c index e326fd6b..4840df29 100644 --- a/lef/defRead.c +++ b/lef/defRead.c @@ -1390,12 +1390,13 @@ enum def_pins_prop_keys { DEF_PINS_PROP_PORT, DEF_PINS_PROP_SPECIAL}; void -DefReadPins(f, rootDef, sname, oscale, total) +DefReadPins(f, rootDef, sname, oscale, total, annotate) FILE *f; CellDef *rootDef; char *sname; float oscale; int total; + bool annotate; { char *token; char pinname[LEF_LINE_MAX]; @@ -1654,6 +1655,15 @@ DefReadPins(f, rootDef, sname, oscale, total) size = DRCGetDefaultLayerWidth(rectList->r_type); while ((size << 1) < height) size <<= 1; size <<= 3; /* Fonts are in 8x units */ + + /* If DEF file is being imported to annotate a + * layout, then remove any existing label in + * the layout that matches the PIN record. + */ + if (annotate) + DBEraseLabelsByContent(rootDef, &topRect, + -1, pinname); + DBPutFontLabel(rootDef, &topRect, 0, size, rot, &GeoOrigin, GEO_CENTER, pinname, @@ -2513,10 +2523,7 @@ DefRead(inName, dolabels, annotate, noblockage) token = LefNextToken(f, TRUE); if (sscanf(token, "%d", &total) != 1) total = 0; LefEndStatement(f); - if (annotate) - LefSkipSection(f, sections[DEF_PINS]); - else - DefReadPins(f, rootDef, sections[DEF_PINS], oscale, total); + DefReadPins(f, rootDef, sections[DEF_PINS], oscale, total, annotate); break; case DEF_PINPROPERTIES: LefSkipSection(f, sections[DEF_PINPROPERTIES]);