Cleaned up a bit of confusing diagnostic output when reading GDS.

If cells are instanced before being defined, causing the GDS parser
to rewind the cell from the top, then the "already defined" error
messages will be suppressed, since it is to be expected that cells
will be seen twice (and ignored the 2nd time).  When rewinding, an
output message is issued so that it is clear that the file contains
instances that are used before they are defined, and recommends the
"gds ordering on" setting.  Also:  Fixed the "gds ordering" command
code so that the command with no third argument returns the state
of the "gds ordering" setting instead of generating a parser error.
This commit is contained in:
Tim Edwards 2022-01-14 11:07:08 -05:00
parent 91b00a633f
commit 453d276f20
4 changed files with 11 additions and 5 deletions

View File

@ -1 +1 @@
8.3.256
8.3.257

View File

@ -49,6 +49,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
int calmaNonManhattan;
int CalmaFlattenLimit = 10;
int NameConvertErrors = 0;
bool CalmaRewound = FALSE;
extern HashTable calmaDefInitHash;
@ -141,7 +142,11 @@ calmaSetPosition(sname)
if (originalPos != 0)
{
rewind(calmaInputFile);
CalmaRewound = TRUE;
calmaSetPosition(sname);
if (!CalmaPostOrder)
CalmaReadError("Rewinding input. Cells may have been instanced before "
"they were defined. Consider using \"gds ordering on\".\n");
return originalPos;
}
@ -330,7 +335,7 @@ calmaParseStructure(filename)
/* However, if post-ordering is set, then this cell was */
/* probably just read earlier, so don't gripe about it. */
if (!CalmaPostOrder)
if (!CalmaPostOrder && !CalmaRewound)
{
CalmaReadError("Cell \"%s\" was already defined in this file.\n",
strname);

View File

@ -485,8 +485,8 @@ CmdCalma(w, cmd)
else
TxPrintf("GDS parser reads cells in the order "
"encountered in the stream file.\n");
return;
#endif
return;
}
else if (cmd->tx_argc != 3)
goto wrongNumArgs;

View File

@ -1798,9 +1798,10 @@ topVisit(def, doStub)
* and should be removed from the port list.
*/
if (def->def_flags & DEF_ABSTRACT)
heh = HashLookOnly(&efNodeHashTable, nodeName->efnn_hier);
heh = HashLookOnly(&efNodeHashTable, (char *)nodeName->efnn_hier);
else
heh = HashLookOnly(&efNodeHashTable, snode->efnode_name->efnn_hier);
heh = HashLookOnly(&efNodeHashTable,
(char *)snode->efnode_name->efnn_hier);
if (heh == (HashEntry *)NULL)
{
/* Port was optimized out */