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.
This commit is contained in:
Tim Edwards 2019-07-19 22:58:45 -04:00
parent 8183f72b00
commit 9ec5e8e747
2 changed files with 21 additions and 4 deletions

View File

@ -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 \

View File

@ -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 */