From 9ec5e8e747c328e7f932fa8c3c3bba89d5832ab9 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 19 Jul 2019 22:58:45 -0400 Subject: [PATCH] Modified DEF reads to avoid instance names with brackets. Not sure if this is the best policy. The brackets should be okay but interfere with ext2spice when it reads them from the .ext file and decides that they refer to arrays. May be a better way to handle this. --- lef/Depend | 7 ++++--- lef/defRead.c | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lef/Depend b/lef/Depend index 37ec5a4f..9b997139 100644 --- a/lef/Depend +++ b/lef/Depend @@ -17,9 +17,10 @@ defWrite.o: defWrite.c ../tcltk/tclmagic.h ../utils/magic.h \ ../cif/cif.h ../extflat/extflat.h ../lef/lefInt.h ../drc/drc.h lefRead.o: lefRead.c ../tcltk/tclmagic.h ../utils/magic.h \ ../utils/geometry.h ../tiles/tile.h ../utils/hash.h ../utils/undo.h \ - ../database/database.h ../windows/windows.h ../graphics/graphics.h \ - ../dbwind/dbwind.h ../utils/malloc.h ../textio/textio.h ../cif/cif.h \ - ../cif/CIFint.h ../cif/CIFread.h ../lef/lefInt.h + ../utils/utils.h ../database/database.h ../windows/windows.h \ + ../graphics/graphics.h ../dbwind/dbwind.h ../utils/malloc.h \ + ../textio/textio.h ../cif/cif.h ../cif/CIFint.h ../cif/CIFread.h \ + ../lef/lefInt.h defRead.o: defRead.c ../tcltk/tclmagic.h ../utils/magic.h \ ../utils/geometry.h ../tiles/tile.h ../utils/hash.h ../utils/undo.h \ ../database/database.h ../windows/windows.h ../dbwind/dbwind.h \ diff --git a/lef/defRead.c b/lef/defRead.c index ab8cdfda..afe49a2a 100644 --- a/lef/defRead.c +++ b/lef/defRead.c @@ -1392,7 +1392,7 @@ DefReadComponents(f, rootDef, sname, oscale, total) CellDef *defMacro; CellUse *defUse; Transform t; - char *token; + char *token, *dptr; char usename[512]; int keyword, subkey, values; int processed = 0; @@ -1447,6 +1447,22 @@ DefReadComponents(f, rootDef, sname, oscale, total) LefEndStatement(f); break; } + + /* Does use name contain brackets? If so, this can */ + /* interfere with magic's use of arrays. */ + + /* NOTE: It is not clear that this needs to be */ + /* done during DEF read. The only confusion comes */ + /* from the arrays being parsed by ExtFlat when */ + /* doing ext2spice. */ + + dptr = strchr(usename, '['); + if (dptr != NULL) { + *dptr = '_'; + dptr = strchr(dptr + 1, ']'); + if (dptr != NULL) *dptr = '_'; + } + token = LefNextToken(f, TRUE); /* Find the corresponding macro definition */