Merge branch 'work' into tomerge

This commit is contained in:
Tim Edwards 2018-12-12 17:25:17 -05:00
commit 3bfc2bd620
2 changed files with 20 additions and 3 deletions

View File

@ -44,6 +44,10 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include "utils/runstats.h"
#include "ext2spice/ext2spice.h"
/* These global values are defined in ext2spice.c */
extern HashTable subcktNameTable;
extern DQueue subcktNameQueue;
// Structure passed to esHierVisit
typedef struct _defflagsdata {
@ -1871,6 +1875,15 @@ esHierVisit(hc, cdata)
esSbckNum = 0;
esNodeNum = 10;
/* Reset the subcircuit hash table, if using HSPICE format */
if (esFormat == HSPICE)
{
HashInit(&subcktNameTable, 32, HT_STRINGKEYS);
#ifndef UNSORTED_SUBCKT
DQInit(&subcktNameQueue, 64);
#endif
}
EFFlatDone();
return 0;
}

View File

@ -1369,6 +1369,10 @@ subcktVisit(use, hierName, is_top)
/* Retain instance name unless esDoRenumber is set, or format is Spice2 */
if (use->use_id == NULL || esDoRenumber == TRUE || esFormat == SPICE2)
{
/* NOTE: This really needs to update subcktNameTable so that */
/* it tracks between instance names and node names, when using */
/* HSPICE format + esDoRenumber. */
fprintf(esSpiceF, "X%d", esSbckNum++);
tchars = 5;
}
@ -3268,10 +3272,10 @@ char *efHNSprintfPrefix(hierName, str)
* nodeHspiceName --
*
* Convert the hierarchical node name used in Berkeley spice
* to a name understodd by hspice and hopefully by the user.
* to a name understood by hspice and hopefully by the user.
*
* Results:
* A somewhat meaningfull node name
* A somewhat meaningful node name
*
* Side effects:
* Mucks with the hash table above.
@ -3306,7 +3310,7 @@ int nodeHspiceName(s)
sf = p + 1;
/*
* look up prefix in the hash table ad create it if doesnt exist
* look up prefix in the hash table and create it if doesn't exist
*/
if ((he = HashLookOnly(&subcktNameTable, s)) == NULL)
{