From 5295a6281c64882114747b34d0b2ce91b000aa26 Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Sat, 26 Dec 2020 23:53:26 +0100 Subject: [PATCH] fix a regression in sort_labels.awk after moving tmpfile to /tmp; added oldvalue (for simulation) in hilight hash table --- src/hilight.c | 11 ++--------- src/sort_labels.awk | 4 ++-- src/xschem.h | 1 + 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/hilight.c b/src/hilight.c index ed3043a0..0b6c4c40 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -217,6 +217,7 @@ struct hilight_hashentry *hilight_lookup(const char *token, int value, int what) my_strdup(138, &(entry->token),token); entry->path = NULL; my_strdup(139, &(entry->path),xctx->sch_path[xctx->currsch]); + entry->oldvalue=value; /* just created. There is no oldvalue */ entry->value=value; entry->hash=hashcode; *preventry=entry; @@ -233,6 +234,7 @@ struct hilight_hashentry *hilight_lookup(const char *token, int value, int what) my_free(764, &entry); *preventry=saveptr; } else if(what == XINSERT ) { + entry->oldvalue=entry->value; entry->value = value; } return entry; /* found matching entry, return the address */ @@ -1353,17 +1355,9 @@ void print_hilight_net(int show) my_free(780, &filetmp2); return; } -#ifdef __unix__ - my_snprintf(cmd, S(cmd), "\"%s/order_labels.awk\"", tclgetvar("XSCHEM_SHAREDIR")); -#else my_snprintf(cmd, S(cmd), "awk -f \"%s/order_labels.awk\"", tclgetvar("XSCHEM_SHAREDIR")); -#endif my_snprintf(cmd2, S(cmd2), "%s %s > %s", cmd, filetmp1, filetmp2); -#ifdef __unix__ - my_snprintf(cmd3, S(cmd3), "\"%s/sort_labels.awk\" %s", tclgetvar("XSCHEM_SHAREDIR"), filetmp1); -#else my_snprintf(cmd3, S(cmd3), "awk -f \"%s/sort_labels.awk\" %s", tclgetvar("XSCHEM_SHAREDIR"), filetmp1); -#endif for(i=0;ihilight_table[i]; while(entry) { @@ -1433,7 +1427,6 @@ void print_hilight_net(int show) xctx->prep_hi_structs=0; xctx->prep_net_structs=0; - /* delete_netlist_structs(); */ my_free(781, &filetmp1); my_free(782, &filetmp2); } diff --git a/src/sort_labels.awk b/src/sort_labels.awk index a8a11601..38a57df6 100755 --- a/src/sort_labels.awk +++ b/src/sort_labels.awk @@ -22,8 +22,8 @@ END{ print line[i] > FILENAME } close(FILENAME) - system("sort -k 2 " FILENAME " | awk '{$NF=\"\"; print $0}' > " "." FILENAME ".xxxxx") - system("mv ." FILENAME ".xxxxx " FILENAME) + system("sort -k 2 " FILENAME " | awk '{$NF=\"\"; print $0}' > " FILENAME ".xxxxx") + system("mv " FILENAME ".xxxxx " FILENAME) } diff --git a/src/xschem.h b/src/xschem.h index 842f5454..497c04e4 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -642,6 +642,7 @@ struct hilight_hashentry { char *token; char *path; /* hierarchy path */ int value; /* hilight color */ + int oldvalue; /* previous hilight color */ }; /* for netlist.c */