diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f9421d0..002d069d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - `use_standard_clicking` - `use_standard_trace_select` - `use_toolbutton_interface` + - `vcd_explicit_zero_subscripts` ### Fixed diff --git a/examples/gtkwaverc b/examples/gtkwaverc index 8a2aa6f3..01342f76 100644 --- a/examples/gtkwaverc +++ b/examples/gtkwaverc @@ -71,8 +71,6 @@ constant_marker_update yes show_grid yes show_base_symbols no -vcd_explicit_zero_subscripts no - disable_mouseover no clipboard_mouseover yes diff --git a/man/gtkwaverc.5 b/man/gtkwaverc.5 index 4f2e963f..1e99dac1 100644 --- a/man/gtkwaverc.5 +++ b/man/gtkwaverc.5 @@ -344,9 +344,6 @@ Uses anti-aliased pango fonts (GTK2) rather than bitmapped X11 ones. Default is \fBuse_roundcaps\fR <\fIvalue\fP> A nonzero value indicates that vector traces should be drawn with rounded caps rather than perpendicular ones. The default for this is zero. .TP -\fBvcd_explicit_zero_subscripts\fR <\fIvalue\fP> -indicates that signal names should be stored internally as name.bitnumber when enabled. When disabled, a more "normal" ordering of name[bitnumber] is used. Note that when disabled, the Bundle Up and Bundle Down options are disabled in the Signal Search Regexp, Signal Search Hierarchy, and Signal Search Tree options. This is necessary as the internal data structures for signals are represented with one "less" level of hierarchy than when enabled and those functions would not work properly. This should not be an issue if atomic_vectors are enabled. Default for vcd_explicit_zero_subscripts is disabled. -.TP \fBvcd_preserve_glitches\fR <\fIvalue\fP> indicates that any repeat equal values for a net spanning different time values in the VCD/FST file are not to be compressed into a single value change but should remain in order to allow glitches to be present for this case. Default for vcd_preserve_glitches is disabled. .TP diff --git a/src/bitvec.c b/src/bitvec.c index d0fe8b51..94c30da0 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -893,31 +893,6 @@ struct Bits *makevec_selected(char *vec, int numrows, char direction) return (b); } -/* - * add vector made in previous function - */ -int add_vector_selected(char *alias, int numrows, char direction) -{ - bvptr v = NULL; - bptr b = NULL; - - if ((b = makevec_selected(alias, numrows, direction))) { - if ((v = bits2vector(b))) { - v->bits = b; /* only needed for savefile function */ - AddVector(v, NULL); - free_2(b->name); - b->name = NULL; - return (v != NULL); - } else { - free_2(b->name); - if (b->attribs) - free_2(b->attribs); - free_2(b); - } - } - return (v != NULL); -} - /***********************************************************************************/ /* @@ -932,14 +907,7 @@ struct Bits *makevec_chain(char *vec, struct symbol *sym, int len) struct Node **n; struct Bits *b = NULL; struct symbol *symhi = NULL, *symlo = NULL; - char hier_delimeter2; - - if (!GLOBALS->vcd_explicit_zero_subscripts) /* 0==yes, -1==no */ - { - hier_delimeter2 = GLOBALS->hier_delimeter; - } else { - hier_delimeter2 = '['; - } + char hier_delimeter2 = '['; n = (struct Node **)g_alloca(len * sizeof(struct Node *)); memset(n, 0, len * sizeof(struct Node *)); /* scan-build */ @@ -1032,12 +1000,8 @@ struct Bits *makevec_chain(char *vec, struct symbol *sym, int len) } else { int add1, add2, totallen; - add1 = l1 - root1len; - add2 = l2 - root2len; - if (GLOBALS->vcd_explicit_zero_subscripts == -1) { - add1--; - add2--; - } + add1 = l1 - root1len - 1; + add2 = l2 - root2len - 1; if (symlo != symhi) { unsigned char fixup1 = 0, fixup2 = 0; @@ -1051,21 +1015,17 @@ struct Bits *makevec_chain(char *vec, struct symbol *sym, int len) + 1 /* add 0x00 */ ; - if (GLOBALS->vcd_explicit_zero_subscripts == -1) { - fixup1 = *(s1 + l1 - 1); - *(s1 + l1 - 1) = 0; - fixup2 = *(s2 + l2 - 1); - *(s2 + l2 - 1) = 0; - } + fixup1 = *(s1 + l1 - 1); + *(s1 + l1 - 1) = 0; + fixup2 = *(s2 + l2 - 1); + *(s2 + l2 - 1) = 0; b->name = (char *)malloc_2(totallen); strncpy(b->name, s1, root1len - 1); sprintf(b->name + root1len - 1, "[%s:%s]", s1 + root1len, s2 + root2len); - if (GLOBALS->vcd_explicit_zero_subscripts == -1) { - *(s1 + l1 - 1) = fixup1; - *(s2 + l2 - 1) = fixup2; - } + *(s1 + l1 - 1) = fixup1; + *(s2 + l2 - 1) = fixup2; } else { unsigned char fixup1 = 0; @@ -1076,18 +1036,14 @@ struct Bits *makevec_chain(char *vec, struct symbol *sym, int len) + 1 /* add 0x00 */ ; - if (GLOBALS->vcd_explicit_zero_subscripts == -1) { - fixup1 = *(s1 + l1 - 1); - *(s1 + l1 - 1) = 0; - } + fixup1 = *(s1 + l1 - 1); + *(s1 + l1 - 1) = 0; b->name = (char *)malloc_2(totallen); strncpy(b->name, s1, root1len - 1); sprintf(b->name + root1len - 1, "[%s]", s1 + root1len); - if (GLOBALS->vcd_explicit_zero_subscripts == -1) { - *(s1 + l1 - 1) = fixup1; - } + *(s1 + l1 - 1) = fixup1; } } @@ -1563,7 +1519,7 @@ char *makename_chain(struct symbol *sym) { int i; struct symbol *symhi = NULL, *symlo = NULL; - char hier_delimeter2; + char hier_delimeter2 = '['; char *name = NULL; char *s1, *s2; int s1_was_packed = HIER_DEPACK_ALLOC, s2_was_packed = HIER_DEPACK_ALLOC; @@ -1575,13 +1531,6 @@ char *makename_chain(struct symbol *sym) exit(255); } - if (!GLOBALS->vcd_explicit_zero_subscripts) /* 0==yes, -1==no */ - { - hier_delimeter2 = GLOBALS->hier_delimeter; - } else { - hier_delimeter2 = '['; - } - if (!GLOBALS->autocoalesce_reversal) /* normal case for MTI */ { symhi = sym; @@ -1634,12 +1583,8 @@ char *makename_chain(struct symbol *sym) } else { int add1, add2, totallen; - add1 = l1 - root1len; - add2 = l2 - root2len; - if (GLOBALS->vcd_explicit_zero_subscripts == -1) { - add1--; - add2--; - } + add1 = l1 - root1len - 1; + add2 = l2 - root2len - 1; if (symlo != symhi) { unsigned char fixup1 = 0, fixup2 = 0; @@ -1653,21 +1598,17 @@ char *makename_chain(struct symbol *sym) + 1 /* add 0x00 */ ; - if (GLOBALS->vcd_explicit_zero_subscripts == -1) { - fixup1 = *(s1 + l1 - 1); - *(s1 + l1 - 1) = 0; - fixup2 = *(s2 + l2 - 1); - *(s2 + l2 - 1) = 0; - } + fixup1 = *(s1 + l1 - 1); + *(s1 + l1 - 1) = 0; + fixup2 = *(s2 + l2 - 1); + *(s2 + l2 - 1) = 0; name = (char *)malloc_2(totallen); strncpy(name, s1, root1len - 1); sprintf(name + root1len - 1, "[%s:%s]", s1 + root1len, s2 + root2len); - if (GLOBALS->vcd_explicit_zero_subscripts == -1) { - *(s1 + l1 - 1) = fixup1; - *(s2 + l2 - 1) = fixup2; - } + *(s1 + l1 - 1) = fixup1; + *(s2 + l2 - 1) = fixup2; } else { unsigned char fixup1 = 0; @@ -1678,18 +1619,14 @@ char *makename_chain(struct symbol *sym) + 1 /* add 0x00 */ ; - if (GLOBALS->vcd_explicit_zero_subscripts == -1) { - fixup1 = *(s1 + l1 - 1); - *(s1 + l1 - 1) = 0; - } + fixup1 = *(s1 + l1 - 1); + *(s1 + l1 - 1) = 0; name = (char *)malloc_2(totallen); strncpy(name, s1, root1len - 1); sprintf(name + root1len - 1, "[%s]", s1 + root1len); - if (GLOBALS->vcd_explicit_zero_subscripts == -1) { - *(s1 + l1 - 1) = fixup1; - } + *(s1 + l1 - 1) = fixup1; } } diff --git a/src/globals.c b/src/globals.c index ea4c254e..e2dfb0da 100644 --- a/src/globals.c +++ b/src/globals.c @@ -935,7 +935,6 @@ static const struct Global globals_base_values = { -1, /* vcd_warning_filesize 472 */ 1, /* autocoalesce 473 */ 0, /* autocoalesce_reversal */ - -1, /* vcd_explicit_zero_subscripts 474 */ 0, /* convert_to_reals 475 */ 0, /* make_vcd_save_file 477 */ 0, /* vcd_preserve_glitches 478 */ @@ -1710,7 +1709,6 @@ void reload_into_new_context_2(void) new_globals->use_maxtime_display = GLOBALS->use_maxtime_display; new_globals->use_nonprop_fonts = GLOBALS->use_nonprop_fonts; new_globals->use_roundcaps = GLOBALS->use_roundcaps; - new_globals->vcd_explicit_zero_subscripts = GLOBALS->vcd_explicit_zero_subscripts; new_globals->vcd_preserve_glitches = GLOBALS->vcd_preserve_glitches; new_globals->vcd_preserve_glitches_real = GLOBALS->vcd_preserve_glitches_real; new_globals->vcd_warning_filesize = GLOBALS->vcd_warning_filesize; diff --git a/src/globals.h b/src/globals.h index 57c68acd..2087a0bf 100644 --- a/src/globals.h +++ b/src/globals.h @@ -914,7 +914,6 @@ struct Global int vcd_warning_filesize; /* from vcd.c 502 */ char autocoalesce; /* from vcd.c 503 */ char autocoalesce_reversal; /* from vcd.c 504 */ - int vcd_explicit_zero_subscripts; /* from vcd.c 505 */ char convert_to_reals; /* from vcd.c 506 */ char make_vcd_save_file; /* from vcd.c 508 */ char vcd_preserve_glitches; /* from vcd.c 509 */ diff --git a/src/main.c b/src/main.c index 3f7c07c5..ca870b35 100644 --- a/src/main.c +++ b/src/main.c @@ -841,7 +841,6 @@ int main_2(int opt_vcd, int argc, char *argv[]) GLOBALS->use_maxtime_display = old_g->use_maxtime_display; GLOBALS->use_nonprop_fonts = old_g->use_nonprop_fonts; GLOBALS->use_roundcaps = old_g->use_roundcaps; - GLOBALS->vcd_explicit_zero_subscripts = old_g->vcd_explicit_zero_subscripts; GLOBALS->vcd_preserve_glitches = old_g->vcd_preserve_glitches; GLOBALS->vcd_preserve_glitches_real = old_g->vcd_preserve_glitches_real; GLOBALS->vcd_warning_filesize = old_g->vcd_warning_filesize; diff --git a/src/rc.c b/src/rc.c index bd1411c4..13342800 100644 --- a/src/rc.c +++ b/src/rc.c @@ -642,13 +642,6 @@ int f_ruler_step(const char *str) return (0); } -int f_vcd_explicit_zero_subscripts(const char *str) -{ - DEBUG(printf("f_vcd_explicit_zero_subscripts(\"%s\")\n", str)); - GLOBALS->vcd_explicit_zero_subscripts = atoi_64(str) ? 0 : -1; /* 0==yes, -1==no */ - return (0); -} - int f_vcd_preserve_glitches(const char *str) { DEBUG(printf("f_vcd_preserve_glitches(\"%s\")\n", str)); @@ -924,7 +917,6 @@ static struct rc_entry rcitems[] = { {"use_nonprop_fonts", f_use_nonprop_fonts}, {"use_pango_fonts", f_use_pango_fonts}, {"use_roundcaps", f_use_roundcaps}, - {"vcd_explicit_zero_subscripts", f_vcd_explicit_zero_subscripts}, {"vcd_preserve_glitches", f_vcd_preserve_glitches}, {"vcd_preserve_glitches_real", f_vcd_preserve_glitches_real}, {"vcd_warning_filesize", f_vcd_warning_filesize}, diff --git a/src/rc.h b/src/rc.h index a3d7314d..40758074 100644 --- a/src/rc.h +++ b/src/rc.h @@ -110,7 +110,6 @@ int f_use_full_precision(const char *str); int f_use_maxtime_display(const char *str); int f_use_nonprop_fonts(const char *str); int f_use_roundcaps(const char *str); -int f_vcd_explicit_zero_subscripts(const char *str); int f_vcd_preserve_glitches(const char *str); int f_vcd_warning_filesize(const char *str); int f_vector_padding(const char *str); diff --git a/src/search.c b/src/search.c index 0eb43e1e..73a18e35 100644 --- a/src/search.c +++ b/src/search.c @@ -200,58 +200,6 @@ static void on_changed(GtkComboBox *widget, gpointer user_data) /* call cleanup() on ok/insert functions */ -static void bundle_cleanup(GtkWidget *widget, gpointer data) -{ - (void)widget; - (void)data; - - if (GLOBALS->entrybox_text_local_search_c_2) { - char *efix; - - efix = GLOBALS->entrybox_text_local_search_c_2; - while (*efix) { - if (*efix == ' ') { - *efix = '_'; - } - efix++; - } - - DEBUG(printf("Bundle name is: %s\n", GLOBALS->entrybox_text_local_search_c_2)); - add_vector_selected(GLOBALS->entrybox_text_local_search_c_2, - GLOBALS->selected_rows_search_c_2, - GLOBALS->bundle_direction_search_c_2); - free_2(GLOBALS->entrybox_text_local_search_c_2); - } - - redraw_signals_and_waves(); -} - -static void bundle_callback_generic(void) -{ - DEBUG(printf("Selected_rows: %d\n", GLOBALS->selected_rows_search_c_2)); - if (GLOBALS->selected_rows_search_c_2 > 0) { - entrybox_local("Enter Bundle Name", 300, "", 128, G_CALLBACK(bundle_cleanup)); - } -} - -static void bundle_callback_up(GtkWidget *widget, gpointer data) -{ - (void)widget; - (void)data; - - GLOBALS->bundle_direction_search_c_2 = 0; - bundle_callback_generic(); -} - -static void bundle_callback_down(GtkWidget *widget, gpointer data) -{ - (void)widget; - (void)data; - - GLOBALS->bundle_direction_search_c_2 = 1; - bundle_callback_generic(); -} - static void insert_callback(GtkWidget *widget, GtkWidget *nothing) { (void)nothing; @@ -723,7 +671,6 @@ void search_enter_callback(GtkWidget *widget, GtkWidget *do_warning) int i; char *s, *tmp2; gfloat interval; - int depack_cnt = 0; char *duplicate_row_buffer = NULL; if (GLOBALS->is_searching_running_search_c_1) @@ -789,8 +736,6 @@ void search_enter_callback(GtkWidget *widget, GtkWidget *do_warning) strcpy(duplicate_row_buffer, hfacname); } - depack_cnt += was_packed; - if ((!skiprow) && wave_regex_match(hfacname, WAVE_REGEX_SEARCH)) if ((!GLOBALS->is_ghw) || (strcmp(WAVE_GHW_DUMMYFACNAME, hfacname))) { GtkTreeIter iter; @@ -1072,28 +1017,6 @@ void searchbox(const char *title, GCallback func) "Add selected signals after last highlighted signal on the main window."); gtk_box_pack_start(GTK_BOX(button_box2), insert_button, TRUE, TRUE, 0); - if (GLOBALS->vcd_explicit_zero_subscripts >= 0) { - GtkWidget *bundle_up_button = gtk_button_new_with_label("Bundle Up"); - gtkwave_signal_connect_object(bundle_up_button, - "clicked", - G_CALLBACK(bundle_callback_up), - GLOBALS->window_search_c_7); - gtk_tooltips_set_tip_2(bundle_up_button, - "Bundle selected signals into a single bit vector with the topmost " - "selected signal as the LSB and the lowest as the MSB."); - gtk_box_pack_start(GTK_BOX(button_box2), bundle_up_button, TRUE, TRUE, 0); - - GtkWidget *bundle_down_button = gtk_button_new_with_label("Bundle Down"); - gtkwave_signal_connect_object(bundle_down_button, - "clicked", - G_CALLBACK(bundle_callback_down), - GLOBALS->window_search_c_7); - gtk_tooltips_set_tip_2(bundle_down_button, - "Bundle selected signals into a single bit vector with the topmost " - "selected signal as the MSB and the lowest as the LSB."); - gtk_box_pack_start(GTK_BOX(button_box2), bundle_down_button, TRUE, TRUE, 0); - } - GtkWidget *replace_button = gtk_button_new_with_label("Replace"); gtkwave_signal_connect_object(replace_button, "clicked", diff --git a/src/symbol.h b/src/symbol.h index ecc96e99..fe4a1a88 100644 --- a/src/symbol.h +++ b/src/symbol.h @@ -101,7 +101,6 @@ int maketraces(char *, char *, int); /* additions to bitvec.c because of search.c/menu.c ==> formerly in analyzer.h */ bvptr bits2vector(struct Bits *b); struct Bits *makevec_selected(char *vec, int numrows, char direction); -int add_vector_selected(char *alias, int numrows, char direction); struct Bits *makevec_range(char *vec, int lo, int hi, char direction); int add_vector_range(char *alias, int lo, int hi, char direction); struct Bits *makevec_chain(char *vec, struct symbol *sym, int len); diff --git a/src/vcd.c b/src/vcd.c index cf18324b..e0499e86 100644 --- a/src/vcd.c +++ b/src/vcd.c @@ -1322,8 +1322,7 @@ static void vcd_parse(void) v = (struct vcdsymbol *)calloc_2(1, sizeof(struct vcdsymbol)); v->vartype = vtok; - v->msi = v->lsi = - GLOBALS->vcd_explicit_zero_subscripts; /* indicate [un]subscripted status */ + v->msi = v->lsi = -1; if (vtok == V_PORT) { vtok = get_vartoken(1); @@ -1634,17 +1633,7 @@ static void vcd_parse(void) fprintf(GLOBALS->vcd_save_handle, "%s\n", v->name); } else { if (v->msi >= 0) { - if (!GLOBALS->vcd_explicit_zero_subscripts) - fprintf(GLOBALS->vcd_save_handle, - "%s%c%d\n", - v->name, - GLOBALS->hier_delimeter, - v->msi); - else - fprintf(GLOBALS->vcd_save_handle, - "%s[%d]\n", - v->name, - v->msi); + fprintf(GLOBALS->vcd_save_handle, "%s[%d]\n", v->name, v->msi); } else { fprintf(GLOBALS->vcd_save_handle, "%s\n", v->name); } @@ -2247,10 +2236,7 @@ static void vcd_build_symbols(void) for (j = 0; j < v->size; j++) { if (v->msi >= 0) { - if (!GLOBALS->vcd_explicit_zero_subscripts) - sprintf(str + slen, "%d", msi); - else - sprintf(str + slen - 1, "[%d]", msi); + sprintf(str + slen - 1, "[%d]", msi); } hashdirty = 0; diff --git a/src/vcd_partial.c b/src/vcd_partial.c index 23082ca7..c53c6793 100644 --- a/src/vcd_partial.c +++ b/src/vcd_partial.c @@ -1345,8 +1345,7 @@ static void vcd_parse(void) v = (struct vcdsymbol *)calloc_2(1, sizeof(struct vcdsymbol)); v->vartype = vtok; - v->msi = v->lsi = - GLOBALS->vcd_explicit_zero_subscripts; /* indicate [un]subscripted status */ + v->msi = v->lsi = -1; if (vtok == V_PORT) { vtok = get_vartoken(1); @@ -2158,10 +2157,7 @@ static void vcd_build_symbols(void) for (j = 0; j < v->size; j++) { if (v->msi >= 0) { - if (!GLOBALS->vcd_explicit_zero_subscripts) - sprintf(str + slen, "%d", msi); - else - sprintf(str + slen - 1, "[%d]", msi); + sprintf(str + slen - 1, "[%d]", msi); } hashdirty = 0; diff --git a/src/vcd_recoder.c b/src/vcd_recoder.c index f9d22c0e..170c1128 100644 --- a/src/vcd_recoder.c +++ b/src/vcd_recoder.c @@ -1785,8 +1785,7 @@ static void vcd_parse(void) v = (struct vcdsymbol *)calloc_2(1, sizeof(struct vcdsymbol)); v->vartype = vtok; - v->msi = v->lsi = - GLOBALS->vcd_explicit_zero_subscripts; /* indicate [un]subscripted status */ + v->msi = v->lsi = -1; if (vtok == V_PORT) { vtok = get_vartoken(1); @@ -2096,17 +2095,7 @@ static void vcd_parse(void) fprintf(GLOBALS->vcd_save_handle, "%s\n", v->name); } else { if (v->msi >= 0) { - if (!GLOBALS->vcd_explicit_zero_subscripts) - fprintf(GLOBALS->vcd_save_handle, - "%s%c%d\n", - v->name, - GLOBALS->hier_delimeter, - v->msi); - else - fprintf(GLOBALS->vcd_save_handle, - "%s[%d]\n", - v->name, - v->msi); + fprintf(GLOBALS->vcd_save_handle, "%s[%d]\n", v->name, v->msi); } else { fprintf(GLOBALS->vcd_save_handle, "%s\n", v->name); } @@ -2615,10 +2604,7 @@ static void vcd_build_symbols(void) for (j = 0; j < v->size; j++) { if (v->msi >= 0) { - if (!GLOBALS->vcd_explicit_zero_subscripts) - sprintf(str + slen, "%d", msi); - else - sprintf(str + slen - 1, "[%d]", msi); + sprintf(str + slen - 1, "[%d]", msi); } hashdirty = 0;