Skip to content

Commit

Permalink
Remove vcd_explicit_zero_subscripts rcvar
Browse files Browse the repository at this point in the history
  • Loading branch information
rfuest committed Aug 28, 2023
1 parent 5fa7ee4 commit 994b1ab
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 223 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions examples/gtkwaverc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions man/gtkwaverc.5
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
111 changes: 24 additions & 87 deletions src/bitvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/***********************************************************************************/

/*
Expand All @@ -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 */
Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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;
}
}

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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;
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 0 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions src/rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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},
Expand Down
1 change: 0 additions & 1 deletion src/rc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
77 changes: 0 additions & 77 deletions src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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",
Expand Down
Loading

0 comments on commit 994b1ab

Please sign in to comment.