diff --git a/src/actions.c b/src/actions.c index dfd87d9b..886e0afa 100644 --- a/src/actions.c +++ b/src/actions.c @@ -253,17 +253,20 @@ const char *add_ext(const char *f, const char *ext) int i; dbg(1, "add_ext(): f=%s ext=%s\n", f, ext); - if((p=strrchr(f,'.'))) { - my_strncpy(ff, f, (p-f) + 1); - p = ff + (p-f); - dbg(1, "add_ext(): 1: ff=%s\n", ff); - } else { - i = my_strncpy(ff, f, S(ff)); - p = ff+i; - dbg(1, "add_ext(): 2: ff=%s\n", ff); + if(strchr(f,'(')) my_strncpy(ff, f, S(ff)); /* generator: return as is */ + else { + if((p=strrchr(f,'.'))) { + my_strncpy(ff, f, (p-f) + 1); + p = ff + (p-f); + dbg(1, "add_ext(): 1: ff=%s\n", ff); + } else { + i = my_strncpy(ff, f, S(ff)); + p = ff+i; + dbg(1, "add_ext(): 2: ff=%s\n", ff); + } + my_strncpy(p, ext, S(ff)-(p-ff)); + dbg(1, "add_ext(): 3: ff=%s\n", ff); } - my_strncpy(p, ext, S(ff)-(p-ff)); - dbg(1, "add_ext(): 3: ff=%s\n", ff); return ff; } diff --git a/src/spice_netlist.c b/src/spice_netlist.c index a3f4eef8..09b457c3 100644 --- a/src/spice_netlist.c +++ b/src/spice_netlist.c @@ -208,7 +208,8 @@ static int spice_netlist(FILE *fd, int spice_stop ) } else { const char *m; if(print_spice_element(fd, i)) { - int_hash_lookup(&used_symbols, get_sym_name(i, 9999, 1), 1, XINSERT); /* symbol is used */ + /* symbol is used */ + int_hash_lookup(&used_symbols, translate(i, get_sym_name(i, 9999, 1)), 1, XINSERT); fprintf(fd, "**** end_element\n"); } /* hash device_model attribute if any */ @@ -415,7 +416,8 @@ int global_spice_netlist(int global) /* netlister driver */ get_additional_symbols(1); for(i=0;isymbols; ++i) { - if(int_hash_lookup(&used_symbols, xctx->sym[i].name, 0, XLOOKUP) == NULL) continue; + if(int_hash_lookup(&used_symbols, + get_trailing_path(xctx->sym[i].name, 9999, 0), 0, XLOOKUP) == NULL) continue; if( strcmp(get_tok_value(xctx->sym[i].prop_ptr,"spice_ignore",0),"true")==0 ) continue; if(!xctx->sym[i].type) continue; my_strdup(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, "")); diff --git a/src/tedax_netlist.c b/src/tedax_netlist.c index 6975fe00..482515ed 100644 --- a/src/tedax_netlist.c +++ b/src/tedax_netlist.c @@ -66,7 +66,9 @@ static int tedax_netlist(FILE *fd, int tedax_stop ) fprintf(fd,"#**** end user architecture code\n"); } else { print_tedax_element(fd, i) ; /* this is the element line */ - int_hash_lookup(&used_symbols, get_sym_name(i, 9999, 1), 1, XINSERT); /* symbol is used */ + /* symbol is used */ + int_hash_lookup(&used_symbols, translate(i, get_sym_name(i, 9999, 1)), 1, XINSERT); + } } @@ -209,7 +211,8 @@ int global_tedax_netlist(int global) /* netlister driver */ get_additional_symbols(1); for(i=0;isymbols; ++i) { - if(int_hash_lookup(&used_symbols, xctx->sym[i].name, 0, XLOOKUP) == NULL) continue; + if(int_hash_lookup(&used_symbols, + get_trailing_path(xctx->sym[i].name, 9999, 0), 0, XLOOKUP) == NULL) continue; if( strcmp(get_tok_value(xctx->sym[i].prop_ptr,"tedax_ignore",0),"true")==0 ) continue; if(!xctx->sym[i].type) continue; my_strdup2(_ALLOC_ID_, &abs_path, abs_sym_path(tcl_hook2(xctx->sym[i].name), "")); diff --git a/src/verilog_netlist.c b/src/verilog_netlist.c index ae9ca2b2..a47772a5 100644 --- a/src/verilog_netlist.c +++ b/src/verilog_netlist.c @@ -63,12 +63,16 @@ static int verilog_netlist(FILE *fd , int verilog_stop) { if(xctx->inst[i].sel==SELECTED) { print_verilog_element(fd, i) ; - int_hash_lookup(&used_symbols, get_sym_name(i, 9999, 1), 1, XINSERT); /* symbol is used */ + /* symbol is used */ + int_hash_lookup(&used_symbols, translate(i, get_sym_name(i, 9999, 1)), 1, XINSERT); + } } else { print_verilog_element(fd, i) ; /* this is the element line */ - int_hash_lookup(&used_symbols, get_sym_name(i, 9999, 1), 1, XINSERT); /* symbol is used */ + /* symbol is used */ + int_hash_lookup(&used_symbols, translate(i, get_sym_name(i, 9999, 1)), 1, XINSERT); + } } } @@ -362,7 +366,8 @@ int global_verilog_netlist(int global) /* netlister driver */ get_additional_symbols(1); for(i=0;isymbols; ++i) { - if(int_hash_lookup(&used_symbols, xctx->sym[i].name, 0, XLOOKUP) == NULL) continue; + if(int_hash_lookup(&used_symbols, + get_trailing_path(xctx->sym[i].name, 9999, 0), 0, XLOOKUP) == NULL) continue; if( strcmp(get_tok_value(xctx->sym[i].prop_ptr,"verilog_ignore",0),"true")==0 ) continue; if(!xctx->sym[i].type) continue; my_strdup2(_ALLOC_ID_, &abs_path, abs_sym_path(tcl_hook2(xctx->sym[i].name), ""));