From 3c4f840a389b4b6866cbe96f1f29b02291ad0f5f Mon Sep 17 00:00:00 2001 From: Ludovic Jacomme Date: Tue, 7 Sep 2004 21:16:11 +0000 Subject: [PATCH] - bug fix in lax parameter parsing (it may happens that wrong values are computed/introduced under Redhat 9) - bug fix in xsch driver : the VST driver may add intermediate signals and loon has no idea of those signals after driving the resulting optimized netlist. Loon then displayed the message -> "signal foo not found in hash table" and stopped. Now it adds those signals in its internal hash table, and there is no longer error. --- alliance/src/loon/src/lon_lax_param.c | 7 ++++--- alliance/src/loon/src/lon_signal_utils.c | 10 +++++++++- alliance/src/loon/src/lon_signal_utils.h | 1 + alliance/src/loon/src/lon_xsch_driver.c | 1 + 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/alliance/src/loon/src/lon_lax_param.c b/alliance/src/loon/src/lon_lax_param.c index 3c056a5c..d4d8f3b6 100644 --- a/alliance/src/loon/src/lon_lax_param.c +++ b/alliance/src/loon/src/lon_lax_param.c @@ -183,12 +183,11 @@ loc_addnamelist( lax_name_list *head, char *name ) int loc_getdouble( FILE *Pfile, int c, double *PValue ) { - double Value = 0.0; char Buffer[ 32 ]; - int Index = 0; + int Index; - Buffer[ 0 ] = '\0'; *PValue = 0.0; + Index = 0; while ( ( isdigit( c ) ) || ( c == '.' ) || @@ -203,6 +202,8 @@ loc_getdouble( FILE *Pfile, int c, double *PValue ) c = fgetc( Pfile ); } + Buffer[ Index ] = '\0'; + if ( Index > 0 ) *PValue = atof( Buffer ); while( isspace( (int) c )) { c = fgetc( Pfile ); } diff --git a/alliance/src/loon/src/lon_signal_utils.c b/alliance/src/loon/src/lon_signal_utils.c index 9c7a08ec..7be0a57e 100644 --- a/alliance/src/loon/src/lon_signal_utils.c +++ b/alliance/src/loon/src/lon_signal_utils.c @@ -137,7 +137,7 @@ static void putsignal(signal_list* signal, char* name) /* search a signal in hash table */ /*if doesn't exist, create the signal if create param is 1 */ /***************************************************************************/ -static signal_list* getsignal(char *name, int create) +signal_list* getsignal(char *name, int create) { authelem* elem; signal_list* signal; @@ -270,5 +270,13 @@ extern void putcapacitance(char* name, double capacitance) if (signal->C<0) signal->C=0; } +/* LUDO */ + +int +addsignalifnotexist( char *name ) +{ + return ( getsignal( name, 1 ) != (signal_list *)0 ); +} + diff --git a/alliance/src/loon/src/lon_signal_utils.h b/alliance/src/loon/src/lon_signal_utils.h index 3a786d3e..c0403020 100644 --- a/alliance/src/loon/src/lon_signal_utils.h +++ b/alliance/src/loon/src/lon_signal_utils.h @@ -77,5 +77,6 @@ extern void inccapacitance __P ((char* name, double capacitance)); /***************************************************************************/ extern void putcapacitance __P ((char* name, double capacitance)); +extern int addsignalifnotexist __P(( char *name )); #endif diff --git a/alliance/src/loon/src/lon_xsch_driver.c b/alliance/src/loon/src/lon_xsch_driver.c index a6ff3e5f..c59f084a 100644 --- a/alliance/src/loon/src/lon_xsch_driver.c +++ b/alliance/src/loon/src/lon_xsch_driver.c @@ -164,6 +164,7 @@ extern void save_xsch(FILE* xsch_stream, lofig_list* lofig, ptype_list* long_pat autexit(1); } signame=losig->NAMECHAIN->DATA; + addsignalifnotexist( signame ); if (isvdd(signame) || isvss(signame)) continue;