From f2af32636879af5a801c14fcd7fa0cdac7389b6e Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Wed, 24 Feb 2021 14:41:35 -0500 Subject: [PATCH] Gave up on attempting to separate out slashes in instance names from slashes in hierarchical names. Magic does not allow slashes in names when using "identify", so the simplest solution is just to prohibit them in names being read from GDS files, and replace them with underscores to make them magic-compatible. Changing GDS names always has repercussions on things like back-annotating delays, so it should probably be revisited in the future. --- calma/CalmaRdcl.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/calma/CalmaRdcl.c b/calma/CalmaRdcl.c index b3568a49..7d0734c6 100644 --- a/calma/CalmaRdcl.c +++ b/calma/CalmaRdcl.c @@ -48,6 +48,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/ int calmaNonManhattan; int CalmaFlattenLimit = 10; +int NameConvertErrors = 0; extern HashTable calmaDefInitHash; @@ -836,8 +837,24 @@ calmaElementSref(filename) READI2(propAttrType); if (propAttrType == CALMA_PROP_USENAME) { + char *s; + if (!calmaReadStringRecord(CALMA_PROPVALUE, &useid)) return -1; + + /* Magic prohibits comma and slash from use names */ + for (s = useid; *s; s++) + if (*s == '/' || *s == ',') + { + if (NameConvertErrors < 100) + TxPrintf("\"%c\" character cannot be used in instance name; " + "converting to underscore\n", *s); + else if (NameConvertErrors == 100) + TxPrintf("More than 100 character changes; not reporting" + " further errors.\n"); + *s = '_'; + NameConvertErrors++; + } } else if (propAttrType == CALMA_PROP_ARRAY_LIMITS) {