Codebase list gtkwave / 55f6f8e
Merge branch 'upstream' أحمد المحمودي (Ahmed El-Mahmoudy) 14 years ago
58 changed file(s) with 2251 addition(s) and 270 deletion(s). Raw diff Collapse all Expand all
437437 combined vector. (Cut and paste typo from strace.c.)
438438 Added support for DND from regex search window to the
439439 signal/waveareas.
440 3.1.11 18jun08 Compile fix for tla2vcd in MinGW.
441 Added #ifdef for HAVE_BZERO for MinGW.
442 Compiler warning fixes.
443 Added time = -1 endcaps in LXT2+VZT+AET loaders.
444 3.1.12 14jul08 Compiler warning fixes.
445 Fixed crash in vcd recoder for b vs 01xz mixups in
446 malformed VCD files.
447 Fixed abort on VCD load for malformed size vs
448 [msi:lsi] syntax. NC does this on arrays of wires.
449 Fix to vlist reader with --giga enabled in order to
450 handle reads which go off the end of the file.
451 (Possible due to how only the amount used in a block
452 is actually written to the file in order to save
453 space, so the vlist blocks can be overlapping yet
454 usable.)
455 3.1.13 20aug08 Adding compressed hierarchy handling in order to
456 reduce memory usage on large bitblasted models.
457 This is currently only enabled for the VCD recoder,
458 LXT, LXT2, and VZT loaders.
459 Fixed some buffer overflows in vectorization code
460 (and when vectorization is enabled) in vzt_read.c.
461 Modification to autoconf handling for rpc.h.
462 Fix for DnD to directly under an expanded comment
463 trace.
464 Make step_increment equal to 1/10 page_increment
465 for the horizontal scroller in the wavewindow.
466 Added sticky click semantics for clicks in signal
467 window. To do this in the treesearch_gtk2 file
468 will require some additional future work with
469 view_selection_func() and/or signal handling and
470 trapping.
00 ##########################################################################
11
2 GTKWave 3.1.8 Wave Viewer is Copyright (C) 1999-2008 Tony Bybell.
2 GTKWave 3.1.13 Wave Viewer is Copyright (C) 1999-2008 Tony Bybell.
33 Portions of GTKWave are Copyright (C) 1999-2008 Udi Finkelstein.
44 Context support is Copyright (C) 2007-2008 Kermin Elliott Fleming.
55 GHW and additional GUI support is Copyright (C) 2005-2008 Tristan Gingold.
118118
119119 /* Define to 1 if you have the `re_comp' function. */
120120 #undef HAVE_RE_COMP
121
122 /* Define to 1 if you have the <rpc/types.h> header file. */
123 #undef HAVE_RPC_TYPES_H
121124
122125 /* Define to 1 if you have the <rpc/xdr.h> header file. */
123126 #undef HAVE_RPC_XDR_H
55595559
55605560
55615561
5562
5563 for ac_header in fcntl.h inttypes.h libintl.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h strings.h sys/time.h unistd.h wchar.h wctype.h rpc/xdr.h getopt.h
5562 for ac_header in fcntl.h inttypes.h libintl.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h strings.h sys/time.h unistd.h wchar.h wctype.h getopt.h
55645563 do
55655564 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
55665565 if eval "test \"\${$as_ac_Header+set}\" = set"; then
57085707 fi
57095708
57105709 done
5710
5711
5712 # rpc workaround for cygwin
5713
5714
5715 for ac_header in rpc/types.h rpc/xdr.h
5716 do
5717 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5718 echo "$as_me:$LINENO: checking for $ac_header" >&5
5719 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5720 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5721 echo $ECHO_N "(cached) $ECHO_C" >&6
5722 else
5723 cat >conftest.$ac_ext <<_ACEOF
5724 /* confdefs.h. */
5725 _ACEOF
5726 cat confdefs.h >>conftest.$ac_ext
5727 cat >>conftest.$ac_ext <<_ACEOF
5728 /* end confdefs.h. */
5729 #ifdef HAVE_RPC_TYPES_H
5730 # include <rpc/types.h>
5731 #endif
5732
5733
5734 #include <$ac_header>
5735 _ACEOF
5736 rm -f conftest.$ac_objext
5737 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
5738 (eval $ac_compile) 2>conftest.er1
5739 ac_status=$?
5740 grep -v '^ *+' conftest.er1 >conftest.err
5741 rm -f conftest.er1
5742 cat conftest.err >&5
5743 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5744 (exit $ac_status); } &&
5745 { ac_try='test -z "$ac_c_werror_flag"
5746 || test ! -s conftest.err'
5747 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5748 (eval $ac_try) 2>&5
5749 ac_status=$?
5750 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5751 (exit $ac_status); }; } &&
5752 { ac_try='test -s conftest.$ac_objext'
5753 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5754 (eval $ac_try) 2>&5
5755 ac_status=$?
5756 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5757 (exit $ac_status); }; }; then
5758 eval "$as_ac_Header=yes"
5759 else
5760 echo "$as_me: failed program was:" >&5
5761 sed 's/^/| /' conftest.$ac_ext >&5
5762
5763 eval "$as_ac_Header=no"
5764 fi
5765 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
5766 fi
5767 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
5768 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5769 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5770 cat >>confdefs.h <<_ACEOF
5771 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5772 _ACEOF
5773
5774 fi
5775
5776 done
5777
57115778
57125779
57135780 # Checks for typedefs, structures, and compiler characteristics.
234234 AC_HEADER_DIRENT
235235 AC_HEADER_STDC
236236 AC_HEADER_SYS_WAIT
237 AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h strings.h sys/time.h unistd.h wchar.h wctype.h rpc/xdr.h getopt.h])
237 AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h strings.h sys/time.h unistd.h wchar.h wctype.h getopt.h])
238
239 # rpc workaround for cygwin
240 AC_CHECK_HEADERS([rpc/types.h rpc/xdr.h], [], [],
241 [[#ifdef HAVE_RPC_TYPES_H
242 # include <rpc/types.h>
243 #endif
244 ]])
245
238246
239247 # Checks for typedefs, structures, and compiler characteristics.
240248 AC_C_CONST
641641 GtkWidget *ctext;
642642 GtkWidget *text;
643643 FILE *handle;
644 int lx;
645 int lx_module_line = 0;
646 int lx_module_line_locked = 0;
647 int lx_endmodule_line_locked = 0;
648
649 struct wave_logfile_lines_t *wlog_head=NULL, *wlog_curr=NULL;
650 int wlog_size = 0;
651 int line_no;
652 int s_line_find = -1, e_line_find = -1;
653644 struct logfile_context_t *ctx;
654 struct text_find_t *text_curr;
655
656645 char *default_text = t->filename;
657 char *design_unit = t->item;
658 int s_line = t->s_line;
659 int e_line = t->e_line;
660646
661647 handle = fopen(default_text, "rb");
662648 if(!handle)
14671453 }
14681454
14691455 /*
1470 * $Id: logfile.c,v 1.4 2008/02/05 07:20:24 gtkwave Exp $
1456 * $Id: logfile.c,v 1.5 2008/06/11 08:01:40 gtkwave Exp $
14711457 * $Log: logfile.c,v $
1458 * Revision 1.5 2008/06/11 08:01:40 gtkwave
1459 * gcc 4.3.x compiler warning fixes
1460 *
14721461 * Revision 1.4 2008/02/05 07:20:24 gtkwave
14731462 * added realtime rtlbrowse updates (follows marker at 100ms intervals)
14741463 *
0 .TH "GTKWAVE" "1" "3.1.5" "Anthony Bybell" "Simulation Wave Viewer"
0 .TH "GTKWAVE" "1" "3.1.13" "Anthony Bybell" "Simulation Wave Viewer"
11 .SH "NAME"
22 .LP
33 gtkwave \- Visualization tool for VCD, LXT, and VZT files
9696 specifies that the viewer should use gigabyte mempacking when recoding (possibly slower). This is equivalent to setting
9797 the vlist_spill and vlist_prepack flags in the rc file.
9898 .TP
99 \fB\-C\fR,\fB\-\-comphier\fR
100 specifies that the viewer should use compressed hierarchy names when loading the dumpfile (available for VCD recoder, LXT, LXT2, and VZT).
101 This will use less memory at the expense of compression/decompression delay.
102 .TP
99103 \fB\-v\fR,\fB\-\-vcd\fR
100104 Use stdin as a VCD dumpfile.
101105 .TP
2020 debug.c debug.h discardbuttons.c edgebuttons.c \
2121 entry.c fetchbuttons.c fgetdynamic.c fgetdynamic.h file.c fonts.c fonts.h getopt.c \
2222 getopt1.c ghw.c ghw.h ghwlib.c ghwlib.h gnu-getopt.h gnu_regex.h gtk12compat.h \
23 help.c helpers/lxt2_read.c \
23 hierpack.c hierpack.h jrb.c jrb.h help.c helpers/lxt2_read.c \
2424 helpers/lxt_write.c helpers/vzt_read.c hiersearch.c interp.c \
2525 logfile.c lx2.c lx2.h lxt.c lxt.h main.c main.h markerbox.c menu.c menu.h mouseover.c \
2626 pagebuttons.c pipeio.c pipeio.h pixmaps.c pixmaps.h print.c print.h \
5353 discardbuttons.$(OBJEXT) edgebuttons.$(OBJEXT) entry.$(OBJEXT) \
5454 fetchbuttons.$(OBJEXT) fgetdynamic.$(OBJEXT) file.$(OBJEXT) \
5555 fonts.$(OBJEXT) getopt.$(OBJEXT) getopt1.$(OBJEXT) \
56 ghw.$(OBJEXT) ghwlib.$(OBJEXT) help.$(OBJEXT) \
57 lxt2_read.$(OBJEXT) lxt_write.$(OBJEXT) vzt_read.$(OBJEXT) \
58 hiersearch.$(OBJEXT) interp.$(OBJEXT) logfile.$(OBJEXT) \
59 lx2.$(OBJEXT) lxt.$(OBJEXT) main.$(OBJEXT) markerbox.$(OBJEXT) \
60 menu.$(OBJEXT) mouseover.$(OBJEXT) pagebuttons.$(OBJEXT) \
61 pipeio.$(OBJEXT) pixmaps.$(OBJEXT) print.$(OBJEXT) \
62 ptranslate.$(OBJEXT) rc.$(OBJEXT) regex.$(OBJEXT) \
63 renderopt.$(OBJEXT) rgb.$(OBJEXT) search.$(OBJEXT) \
64 shiftbuttons.$(OBJEXT) showchange.$(OBJEXT) \
56 ghw.$(OBJEXT) ghwlib.$(OBJEXT) hierpack.$(OBJEXT) \
57 jrb.$(OBJEXT) help.$(OBJEXT) lxt2_read.$(OBJEXT) \
58 lxt_write.$(OBJEXT) vzt_read.$(OBJEXT) hiersearch.$(OBJEXT) \
59 interp.$(OBJEXT) logfile.$(OBJEXT) lx2.$(OBJEXT) lxt.$(OBJEXT) \
60 main.$(OBJEXT) markerbox.$(OBJEXT) menu.$(OBJEXT) \
61 mouseover.$(OBJEXT) pagebuttons.$(OBJEXT) pipeio.$(OBJEXT) \
62 pixmaps.$(OBJEXT) print.$(OBJEXT) ptranslate.$(OBJEXT) \
63 rc.$(OBJEXT) regex.$(OBJEXT) renderopt.$(OBJEXT) rgb.$(OBJEXT) \
64 search.$(OBJEXT) shiftbuttons.$(OBJEXT) showchange.$(OBJEXT) \
6565 signalwindow.$(OBJEXT) simplereq.$(OBJEXT) splash.$(OBJEXT) \
6666 status.$(OBJEXT) strace.$(OBJEXT) symbol.$(OBJEXT) \
6767 timeentry.$(OBJEXT) translate.$(OBJEXT) tree.$(OBJEXT) \
201201 debug.c debug.h discardbuttons.c edgebuttons.c \
202202 entry.c fetchbuttons.c fgetdynamic.c fgetdynamic.h file.c fonts.c fonts.h getopt.c \
203203 getopt1.c ghw.c ghw.h ghwlib.c ghwlib.h gnu-getopt.h gnu_regex.h gtk12compat.h \
204 help.c helpers/lxt2_read.c \
204 hierpack.c hierpack.h jrb.c jrb.h help.c helpers/lxt2_read.c \
205205 helpers/lxt_write.c helpers/vzt_read.c hiersearch.c interp.c \
206206 logfile.c lx2.c lx2.h lxt.c lxt.h main.c main.h markerbox.c menu.c menu.h mouseover.c \
207207 pagebuttons.c pipeio.c pipeio.h pixmaps.c pixmaps.h print.c print.h \
313313 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghwlib.Po@am__quote@
314314 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Po@am__quote@
315315 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help.Po@am__quote@
316 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hierpack.Po@am__quote@
316317 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hiersearch.Po@am__quote@
317318 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interp.Po@am__quote@
319 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jrb.Po@am__quote@
318320 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logfile.Po@am__quote@
319321 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx2.Po@am__quote@
320322 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxt.Po@am__quote@
10301030 if((1)||(f->row <= 1)) /* sorry, arrays not supported yet in the viewer */
10311031 {
10321032 fprintf(stderr, "Import: %s\n", np->nname);
1033 if(nr<1) nr=1;
1034 if(!GLOBALS->ae2_lx2_table[txidx])
1035 {
1036 GLOBALS->ae2_lx2_table[txidx] = calloc_2(nr, sizeof(struct lx2_entry));
1037 for(r=0;r<nr;r++)
1038 {
1039 GLOBALS->ae2_lx2_table[txidx][r].np = &np[r];
1040 }
1041 }
10331042
10341043 aet2_rd_set_fac_process_mask(txidx);
10351044 ae2_iterator(GLOBALS->ae2_start_limit_cyc, GLOBALS->ae2_end_limit_cyc);
10411050 }
10421051
10431052
1044 if(nr<1) nr=1;
10451053 for(r = 0; r < nr; r++)
10461054 {
1055
10471056 histent_tail = htemp = histent_calloc();
10481057 if(len>1)
10491058 {
10841093 {
10851094 np[r].head.v.h_val = AN_X; /* x */
10861095 }
1096
1097
1098 {
1099 struct HistEnt *htemp2 = calloc_2(1, sizeof(struct HistEnt));
1100 htemp2->time = -1;
1101 if(len>1)
1102 {
1103 htemp2->v.h_vector = htemp->v.h_vector;
1104 }
1105 else
1106 {
1107 htemp2->v.h_val = htemp->v.h_val;
1108 }
1109 htemp2->next = htemp;
1110 htemp = htemp2;
1111 GLOBALS->ae2_lx2_table[txidx][r].numtrans++;
1112 }
10871113
10881114 np[r].head.time = -2;
10891115 np[r].head.next = htemp;
11931219 htemp = GLOBALS->ae2_lx2_table[txidx][r].histent_head;
11941220 }
11951221
1222
1223 {
1224 struct HistEnt *htemp2 = calloc_2(1, sizeof(struct HistEnt));
1225 htemp2->time = -1;
1226 if(len>1)
1227 {
1228 htemp2->v.h_vector = htemp->v.h_vector;
1229 }
1230 else
1231 {
1232 htemp2->v.h_val = htemp->v.h_val;
1233 }
1234 htemp2->next = htemp;
1235 htemp = htemp2;
1236 GLOBALS->ae2_lx2_table[txidx][r].numtrans++;
1237 }
1238
11961239 if(len>1)
11971240 {
11981241 np->head.v.h_vector = (char *)malloc_2(len);
12211264 /* ...of AET2_IS_PRESENT */
12221265
12231266 /*
1224 * $Id: ae2.c,v 1.6 2008/02/19 22:00:28 gtkwave Exp $
1267 * $Id: ae2.c,v 1.7 2008/06/17 18:03:45 gtkwave Exp $
12251268 * $Log: ae2.c,v $
1269 * Revision 1.7 2008/06/17 18:03:45 gtkwave
1270 * added time = -1 endcaps
1271 *
12261272 * Revision 1.6 2008/02/19 22:00:28 gtkwave
12271273 * added aetinfo support
12281274 *
2323 #include "strace.h"
2424 #include "translate.h"
2525 #include "ptranslate.h"
26 #include "hierpack.h"
2627
2728 #ifdef _MSC_VER
2829 #define strcasecmp _stricmp
305306 {
306307 if(!GLOBALS->hier_max_level)
307308 {
308 t->name = nd->nname;
309 int flagged;
310
311 t->name = hier_decompress_flagged(nd->nname, &flagged);
312 t->is_depacked = (flagged != 0);
309313 }
310314 else
311315 {
312 t->name = hier_extract(nd->nname, GLOBALS->hier_max_level);
316 int flagged;
317 char *tbuff = hier_decompress_flagged(nd->nname, &flagged);
318 if(!flagged)
319 {
320 t->name = hier_extract(nd->nname, GLOBALS->hier_max_level);
321 }
322 else
323 {
324 t->name = strdup_2(hier_extract(tbuff, GLOBALS->hier_max_level));
325 free_2(tbuff);
326 t->is_depacked = 1;
327 }
313328 }
314329 }
315330
454469 }
455470
456471 if(t->asciivalue) free_2(t->asciivalue);
457 if((t->is_alias)&&(t->name)) free_2(t->name);
472 if(((t->is_alias)||(t->is_depacked))&&(t->name)) free_2(t->name);
458473
459474 free_2( t );
460475 }
636651 {
637652 if(t->flags&TR_HIGHLIGHT)
638653 {
639 if((t->flags & (TR_BLANK|TR_COLLAPSED)) && (t->name))
654 if(((t->flags & TR_ISCOLLAPSED)==(TR_ISCOLLAPSED)) && (t->name))
640655 {
641656 tinsert=t;
642657 t=t->t_next;
687702 */
688703 Trptr PrependBuffer(void)
689704 {
690 Trptr t, prev;
705 Trptr t, prev = NULL;
691706
692707 if(!GLOBALS->traces.buffer) return(NULL);
693708
10871102 }
10881103
10891104 /*
1090 * $Id: analyzer.c,v 1.3 2008/01/02 18:17:26 gtkwave Exp $
1105 * $Id: analyzer.c,v 1.6 2008/08/05 17:49:39 gtkwave Exp $
10911106 * $Log: analyzer.c,v $
1107 * Revision 1.6 2008/08/05 17:49:39 gtkwave
1108 * comment trace dnd fix
1109 *
1110 * Revision 1.5 2008/07/18 17:27:00 gtkwave
1111 * adding hierpack code
1112 *
1113 * Revision 1.4 2008/06/11 08:01:40 gtkwave
1114 * gcc 4.3.x compiler warning fixes
1115 *
10921116 * Revision 1.3 2008/01/02 18:17:26 gtkwave
10931117 * added standard click semantics with user_standard_clicking rc variable
10941118 *
232232 double d_minval, d_maxval; /* cached value for when auto scaling is turned off */
233233
234234 unsigned is_alias : 1; /* set when it's an alias (safe to free t->name then) */
235 unsigned is_depacked : 1; /* set when it's been depacked from a compressed entry (safe to free t->name then) */
235236 unsigned vector : 1; /* 1 if bit vector, 0 if node */
236237 unsigned shift_drag_valid : 1; /* qualifies shift_drag above */
237238 unsigned interactive_vector_needs_regeneration : 1; /* for interactive VCDs */
327328 #endif
328329
329330 /*
330 * $Id: analyzer.h,v 1.7 2008/03/25 03:22:05 gtkwave Exp $
331 * $Id: analyzer.h,v 1.8 2008/07/18 17:27:00 gtkwave Exp $
331332 * $Log: analyzer.h,v $
333 * Revision 1.8 2008/07/18 17:27:00 gtkwave
334 * adding hierpack code
335 *
332336 * Revision 1.7 2008/03/25 03:22:05 gtkwave
333337 * expanded zero fill to include also a one fill (for pre-inverted nets)
334338 *
9090 pnt[i]=whichfill;
9191 }
9292
93 bits = pnt;
93 bits = (unsigned char *)pnt;
9494 nbits = msi + 1;
9595 }
9696 }
107107
108108 memcpy(pnt+i, bits, nbits);
109109
110 bits = pnt;
110 bits = (unsigned char *)pnt;
111111 nbits = lsi + 1;
112112 }
113113 }
15251525 }
15261526
15271527 /*
1528 * $Id: baseconvert.c,v 1.7 2008/03/25 03:22:06 gtkwave Exp $
1528 * $Id: baseconvert.c,v 1.8 2008/06/11 08:01:42 gtkwave Exp $
15291529 * $Log: baseconvert.c,v $
1530 * Revision 1.8 2008/06/11 08:01:42 gtkwave
1531 * gcc 4.3.x compiler warning fixes
1532 *
15301533 * Revision 1.7 2008/03/25 03:22:06 gtkwave
15311534 * expanded zero fill to include also a one fill (for pre-inverted nets)
15321535 *
2727 #include "main.h"
2828 #include "menu.h"
2929 #include "busy.h"
30 #include "hierpack.h"
3031 #include <stdlib.h>
3132
3233 /*
3334 * attempt to match top vs bottom rather than emit <Vector>
3435 */
35 char *attempt_vecmatch(char *s1, char *s2)
36 char *attempt_vecmatch_2(char *s1, char *s2)
3637 {
3738 char *s;
3839 char *p1, *p2;
4647 int totlen;
4748 int idx;
4849
49 if((!s1)||(!*s1)||(!s2)||(!*s2)) return(NULL);
50
5150 if(!strcmp(s1, s2)) { s = malloc_2(strlen(s1)+1); strcpy(s, s1); return(s); }
5251
5352 p1 = s1; p2 = s2;
146145 s = malloc_2(totlen);
147146 memcpy(s, s1, pfxlen);
148147 idx = pfxlen;
149 s[idx] = '[';
150 idx++;
148 if(!(pfxlen && (s1[pfxlen-1]=='[')))
149 {
150 s[idx] = '[';
151 idx++;
152 }
151153 memcpy(s+idx, n1, n1len);
152154 idx += n1len;
153155 s[idx] = ':';
154156 idx++;
155157 memcpy(s+idx, n2, n2len);
156158 idx += n2len;
157 s[idx] = ']';
158 idx++;
159 if(*sfx != ']')
160 {
161 s[idx] = ']';
162 idx++;
163 }
159164 if(sfxlen) { memcpy(s+idx, sfx, sfxlen); idx+=sfxlen; }
160165 s[idx] = 0;
161166
162167 return(s);
168 }
169
170
171 char *attempt_vecmatch(char *s1, char *s2)
172 {
173 char *pnt;
174
175 if((!s1)||(!*s1)||(!s2)||(!*s2))
176 {
177 return(NULL);
178 }
179 else
180 {
181 int ns1_was_decompressed;
182 char *ns1 = hier_decompress_flagged(s1, &ns1_was_decompressed);
183 int ns2_was_decompressed;
184 char *ns2 = hier_decompress_flagged(s2, &ns2_was_decompressed);
185
186 pnt = attempt_vecmatch_2(ns1, ns2);
187
188 if(ns1_was_decompressed) free_2(ns1);
189 if(ns2_was_decompressed) free_2(ns2);
190
191 return(pnt);
192 }
163193 }
164194
165195
14371467 char hier_delimeter2;
14381468 char *name=NULL;
14391469 char *s1, *s2;
1470 int s1_was_packed, s2_was_packed;
14401471 int root1len=0, root2len=0;
14411472 int l1, l2;
14421473
14691500 }
14701501
14711502
1472 s1=symhi->n->nname;
1473 s2=symlo->n->nname;
1503 s1=hier_decompress_flagged(symhi->n->nname, &s1_was_packed);
1504 s2=hier_decompress_flagged(symlo->n->nname, &s2_was_packed);
14741505
14751506 l1=strlen(s1);
14761507
15681599 }
15691600 }
15701601 }
1602
1603 if(s1_was_packed) { free_2(s1); }
1604 if(s2_was_packed) { free_2(s2); }
15711605
15721606 return(name);
15731607 }
28242858 /****************/
28252859
28262860 /*
2827 * $Id: bitvec.c,v 1.4 2007/09/23 18:33:53 gtkwave Exp $
2861 * $Id: bitvec.c,v 1.6 2008/07/18 19:54:56 gtkwave Exp $
28282862 * $Log: bitvec.c,v $
2863 * Revision 1.6 2008/07/18 19:54:56 gtkwave
2864 * hierpack and vecmatch fixes with removal of extra brackets
2865 *
2866 * Revision 1.5 2008/07/18 19:37:00 gtkwave
2867 * hierpack fix for makename
2868 *
28292869 * Revision 1.4 2007/09/23 18:33:53 gtkwave
28302870 * warnings cleanups from sun compile
28312871 *
1313 #include "symbol.h"
1414 #include "bsearch.h"
1515 #include "strace.h"
16 #include "hierpack.h"
1617 #include <ctype.h>
17
1818
1919 static int compar_timechain(const void *s1, const void *s2)
2020 {
212212
213213 s2=*((struct symbol **)v2);
214214 rc=sigcmp((char *)key,s2->name);
215
215216 return(rc);
216217 }
217218
219220 {
220221 struct symbol **rc;
221222 int len;
223 int was_packed = 0;
222224
223225 if ((!ascii)||(!(len=strlen(ascii)))) return(NULL);
224226 if(rows_return)
225227 {
226228 *rows_return = 0;
229 }
230
231 if(GLOBALS->hier_pfx)
232 {
233 ascii = hier_compress(ascii, HIERPACK_DO_NOT_ADD, &was_packed);
234 len = strlen(ascii);
227235 }
228236
229237 if(ascii[len-1]=='}')
246254
247255 if(whichrow <= (*rc)->n->array_height)
248256 {
257 if(was_packed) { free_2(ascii); }
249258 return(*rc);
250259 }
251260 }
256265 }
257266
258267 rc=(struct symbol **)bsearch(ascii, GLOBALS->facs, GLOBALS->numfacs, sizeof(struct symbol *), compar_facs);
268 if(was_packed) { free_2(ascii); }
259269 if(rc) return(*rc); else return(NULL);
260270 }
261271
262272 /*
263 * $Id: bsearch.c,v 1.5 2008/02/19 22:56:11 gtkwave Exp $
273 * $Id: bsearch.c,v 1.6 2008/07/18 17:27:00 gtkwave Exp $
264274 * $Log: bsearch.c,v $
275 * Revision 1.6 2008/07/18 17:27:00 gtkwave
276 * adding hierpack code
277 *
265278 * Revision 1.5 2008/02/19 22:56:11 gtkwave
266279 * rtlbrowse update to handle aet time substitutions
267280 *
1919 #include "regex_wave.h"
2020 #include "translate.h"
2121
22 #define WAVE_VERSION_INFO "GTKWave Analyzer v3.1.10 (w)1999-2008 BSI"
22 #define WAVE_VERSION_INFO "GTKWave Analyzer v3.1.13 (w)1999-2008 BSI"
2323
2424 #define WAVE_INF_SCALING (0.5)
2525
167167 #endif
168168
169169 /*
170 * $Id: currenttime.h,v 1.38 2008/05/14 21:08:19 gtkwave Exp $
170 * $Id: currenttime.h,v 1.45 2008/08/21 03:48:45 gtkwave Exp $
171171 * $Log: currenttime.h,v $
172 * Revision 1.45 2008/08/21 03:48:45 gtkwave
173 * promote to 3.1.13
174 *
175 * Revision 1.44 2008/07/20 01:29:36 gtkwave
176 * added command line option --comphier
177 *
178 * Revision 1.43 2008/07/14 22:39:22 gtkwave
179 * promote to 3.1.12
180 *
181 * Revision 1.42 2008/07/12 22:54:12 gtkwave
182 * array of wires malformed vcd dump load abort fixed
183 *
184 * Revision 1.41 2008/07/01 18:51:06 gtkwave
185 * compiler warning fixes for amd64
186 *
187 * Revision 1.40 2008/06/18 19:56:07 gtkwave
188 * 3.0.11 release building
189 *
190 * Revision 1.39 2008/06/11 08:01:47 gtkwave
191 * gcc 4.3.x compiler warning fixes
192 *
172193 * Revision 1.38 2008/05/14 21:08:19 gtkwave
173194 * revision bump to 3.1.10
174195 *
1313 #include <stdlib.h>
1414 #include <stdio.h>
1515 #include <string.h>
16
17 #ifndef _MSC_VER
18 #ifndef __MINGW32__
19 #include <stdint.h>
20 #endif
21 #endif
1622
1723 #define WAVE_MAX_CLIST_LENGTH 15000
1824
3036 * types...
3137 */
3238 #ifdef G_HAVE_GINT64
33 typedef long long int TimeType;
34 typedef unsigned long long int UTimeType;
35
36 /* typedef gint64 TimeType; */
37 /* typedef guint64 UTimeType; */
39 /* typedef long long int TimeType; */
40 /* typedef unsigned long long int UTimeType; */
41
42 typedef gint64 TimeType;
43 typedef guint64 UTimeType;
3844
3945 #ifndef _MSC_VER
4046 #define LLDescriptor(x) x##LL
4349 #define TTFormat "%I64d"
4450 #define UTTFormat "%I64u"
4551 #else
46 #define TTFormat "%lld"
47 #define UTTFormat "%llu"
52 #if __WORDSIZE == 64
53 #define TTFormat "%ld"
54 #define UTTFormat "%lu"
55 #else
56 #define TTFormat "%lld"
57 #define UTTFormat "%llu"
58 #endif
4859 #endif
4960 #else
5061 #define LLDescriptor(x) x##i64
179190 #endif
180191
181192 /*
182 * $Id: debug.h,v 1.3 2007/08/26 21:35:40 gtkwave Exp $
193 * $Id: debug.h,v 1.4 2008/07/01 18:51:06 gtkwave Exp $
183194 * $Log: debug.h,v $
195 * Revision 1.4 2008/07/01 18:51:06 gtkwave
196 * compiler warning fixes for amd64
197 *
184198 * Revision 1.3 2007/08/26 21:35:40 gtkwave
185199 * integrated global context management from SystemOfCode2007 branch
186200 *
478478 void
479479 service_left_edge(GtkWidget *text, gpointer data)
480480 {
481 GtkAdjustment *hadj;
482 gfloat inc;
483 TimeType ntinc;
484
485481 if(GLOBALS->helpbox_is_active)
486482 {
487483 help_text_bold("\n\nFind Next Edge Left");
500496 void
501497 service_right_edge(GtkWidget *text, gpointer data)
502498 {
503 GtkAdjustment *hadj;
504 gfloat inc;
505 TimeType ntinc, pageinc;
506
507499 if(GLOBALS->helpbox_is_active)
508500 {
509501 help_text_bold("\n\nFind Next Edge Right");
580572 }
581573
582574 /*
583 * $Id: edgebuttons.c,v 1.5 2008/05/01 02:53:37 gtkwave Exp $
575 * $Id: edgebuttons.c,v 1.6 2008/06/11 08:01:48 gtkwave Exp $
584576 * $Log: edgebuttons.c,v $
577 * Revision 1.6 2008/06/11 08:01:48 gtkwave
578 * gcc 4.3.x compiler warning fixes
579 *
585580 * Revision 1.5 2008/05/01 02:53:37 gtkwave
586581 * edgebutton fix (went back two edges on a concat vector instead of one)
587582 *
167167 (struct font_engine_font_t *font,
168168 const gchar *string)
169169 {
170 gint rc;
170 gint rc = 1; /* dummy value */
171171
172172 if(!font->is_pango)
173173 {
335335
336336
337337 /*
338 * $Id: fonts.c,v 1.9 2008/02/20 18:55:14 gtkwave Exp $
338 * $Id: fonts.c,v 1.10 2008/07/01 18:51:06 gtkwave Exp $
339339 * $Log: fonts.c,v $
340 * Revision 1.10 2008/07/01 18:51:06 gtkwave
341 * compiler warning fixes for amd64
342 *
340343 * Revision 1.9 2008/02/20 18:55:14 gtkwave
341344 * strncmp length fix from previous update
342345 *
11601160 return -1;
11611161 h->snap_time = ghw_get_i64 (h, (unsigned char *)&hdr[4]);
11621162 if (h->flag_verbose > 1)
1163 printf ("Time is %lld fs\n", h->snap_time);
1163 printf ("Time is "GHWLLD" fs\n", h->snap_time);
11641164
11651165 for (i = 0; i < h->nbr_sigs; i++)
11661166 {
12931293 printf ("%d", val->i32);
12941294 break;
12951295 case ghdl_rtik_type_p64:
1296 printf ("%lld", val->i64);
1296 printf (GHWLLD, val->i64);
12971297 break;
12981298 case ghdl_rtik_type_f64:
12991299 printf ("%g", val->f64);
13471347 snprintf (buf, len, "%d", val->i32);
13481348 break;
13491349 case ghdl_rtik_type_p64:
1350 snprintf (buf, len, "%lld", val->i64);
1350 snprintf (buf, len, GHWLLD, val->i64);
13511351 break;
13521352 case ghdl_rtik_type_f64:
13531353 snprintf (buf, len, "%g", val->f64);
15041504 break;
15051505 case ghw_sm_cycle:
15061506 if (0)
1507 printf ("Time is %lld fs\n", h->snap_time);
1507 printf ("Time is "GHWLLD" fs\n", h->snap_time);
15081508 if (0)
15091509 ghw_disp_values (h);
15101510
15421542 return res;
15431543
15441544 if (0)
1545 printf ("Time is %lld fs\n", h->snap_time);
1545 printf ("Time is "GHWLLD" fs\n", h->snap_time);
15461546 if (0)
15471547 ghw_disp_values (h);
15481548
16691669 break;
16701670 case ghdl_rtik_type_i64:
16711671 case ghdl_rtik_type_p64:
1672 printf ("%lld %s %lld",
1672 printf (GHWLLD" %s "GHWLLD,
16731673 rng->i64.left, ghw_get_dir (rng->i64.dir), rng->i64.right);
16741674 break;
16751675 case ghdl_rtik_type_f64:
17221722 for (i = 0; i < p->nbr_units; i++)
17231723 {
17241724 struct ghw_unit *u = &p->units[i];
1725 printf (" %s = %lld %s;\n", u->name, u->val, p->units[0].name);
1725 printf (" %s = "GHWLLD" %s;\n", u->name, u->val, p->units[0].name);
17261726 }
17271727 printf ("end units\n");
17281728 }
18031803 }
18041804
18051805 /*
1806 * $Id: ghwlib.c,v 1.2 2007/08/26 21:35:40 gtkwave Exp $
1806 * $Id: ghwlib.c,v 1.3 2008/07/01 18:51:06 gtkwave Exp $
18071807 * $Log: ghwlib.c,v $
1808 * Revision 1.3 2008/07/01 18:51:06 gtkwave
1809 * compiler warning fixes for amd64
1810 *
18081811 * Revision 1.2 2007/08/26 21:35:40 gtkwave
18091812 * integrated global context management from SystemOfCode2007 branch
18101813 *
2525
2626 #if HAVE_STDINT_H
2727 #include <stdint.h>
28 #if __WORDSIZE == 64
29 #define GHWLLD "%ld"
30 #else
31 #define GHWLLD "%lld"
32 #endif
2833 #endif
2934 #if HAVE_INTTYPES_H
3035 #include <inttypes.h>
36 #ifndef GHWLLD
37 #if __WORDSIZE == 64
38 #define GHWLLD "%ld"
39 #else
40 #define GHWLLD "%lld"
41 #endif
42 #endif
3143 #endif
3244
3345 enum ghdl_rtik {
404416 #endif /* _GHWLIB_H_ */
405417
406418 /*
407 * $Id: ghwlib.h,v 1.2 2007/08/26 21:35:41 gtkwave Exp $
419 * $Id: ghwlib.h,v 1.3 2008/07/01 18:51:06 gtkwave Exp $
408420 * $Log: ghwlib.h,v $
421 * Revision 1.3 2008/07/01 18:51:06 gtkwave
422 * compiler warning fixes for amd64
423 *
409424 * Revision 1.2 2007/08/26 21:35:41 gtkwave
410425 * integrated global context management from SystemOfCode2007 branch
411426 *
826826 /*
827827 * vcd.c
828828 */
829 0, /* do_hier_compress */
830 NULL, /* hier_pfx */
831 0, /* hier_pfx_cnt */
832 NULL, /* prev_hier_pfx */
833 0, /* prev_hier_pfx_len */
834 0, /* prev_hier_pfx_cnt */
835 NULL, /* pfx_hier_array */
836 NULL, /* prev_hier_uncompressed_name */
829837 NULL, /* vcd_jmp_buf */
830838 -1, /* vcd_warning_filesize 472 */
831839 1, /* autocoalesce 473 */
11761184 {
11771185 FILE *statefile;
11781186 struct Global *new_globals, *setjmp_globals;
1179 int i;
11801187 gint tree_frame_x = -1, tree_frame_y = -1;
11811188 gdouble tree_vadj_value = 0.0;
11821189 gdouble tree_hadj_value = 0.0;
11831190 int fix_from_time = 0, fix_to_time = 0;
1184 TimeType from_time, to_time;
1191 TimeType from_time = LLDescriptor(0), to_time = LLDescriptor(0);
11851192 char timestr[32];
11861193 struct stringchain_t *hier_head = NULL, *hier_curr = NULL;
11871194 int load_was_success = 0;
14451452 new_globals->convert_to_reals = GLOBALS->convert_to_reals;
14461453 new_globals->disable_mouseover = GLOBALS->disable_mouseover;
14471454 new_globals->disable_tooltips = GLOBALS->disable_tooltips;
1455 new_globals->do_hier_compress = GLOBALS->do_hier_compress;
14481456 new_globals->do_initial_zoom_fit = GLOBALS->do_initial_zoom_fit;
14491457 new_globals->do_resize_signals = GLOBALS->do_resize_signals;
14501458 new_globals->enable_fast_exit = GLOBALS->enable_fast_exit;
14961504 strcpy2_into_new_context(new_globals, &new_globals->fontname_signals, &GLOBALS->fontname_signals);
14971505 strcpy2_into_new_context(new_globals, &new_globals->fontname_waves, &GLOBALS->fontname_waves);
14981506
1507 /* hierarchy handling from vcd.c */
1508 if(GLOBALS->hier_pfx) { jrb_free_tree(GLOBALS->hier_pfx); GLOBALS->hier_pfx = NULL; }
1509
1510
14991511 /* vlist.c */
15001512 if(GLOBALS->vlist_handle)
15011513 {
15901602 #endif
15911603 break;
15921604
1605 case NO_FILE:
15931606 case GHW_FILE:
15941607 case VCD_FILE:
15951608 case VCD_RECODER_FILE: /* do nothing */ break;
17721785 case LXT_FILE: lxt_main(GLOBALS->loaded_file_name); break;
17731786 case VCD_FILE: vcd_main(GLOBALS->loaded_file_name); break;
17741787 case VCD_RECODER_FILE: vcd_recoder_main(GLOBALS->loaded_file_name); break;
1788 default: break;
17751789 }
17761790
17771791 t = (void **)setjmp_globals->alloc2_chain;
18181832 /* now try again, jump through recovery sequence below */
18191833 }
18201834 break;
1835 default:
1836 break;
18211837 }
18221838
18231839 set_window_idle(NULL);
20852101 #endif
20862102 break;
20872103
2104 case NO_FILE:
20882105 case GHW_FILE:
20892106 case VCD_FILE:
20902107 case VCD_RECODER_FILE: /* do nothing */ break;
5151 #include"vlist.h"
5252 #include"vzt.h"
5353 #include"wavealloca.h"
54
54 #include"jrb.h"
5555
5656 struct Global{
5757
821821 /*
822822 * vcd.c
823823 */
824 unsigned char do_hier_compress; /* from vcd.c */
825 JRB hier_pfx; /* from vcd.c */
826 unsigned int hier_pfx_cnt; /* from vcd.c */
827 char *prev_hier_pfx; /* from vcd.c */
828 int prev_hier_pfx_len; /* from vcd.c */
829 unsigned int prev_hier_pfx_cnt; /* from vcd.c */
830 char **pfx_hier_array; /* from vcd.c */
831 char *prev_hier_uncompressed_name; /* from vcd.c */
824832 jmp_buf *vcd_jmp_buf; /* from vcd.c */
825833 int vcd_warning_filesize; /* from vcd.c 502 */
826834 char autocoalesce; /* from vcd.c 503 */
175175 case ghw_res_snapshot:
176176 case ghw_res_cycle:
177177 if (flag_disp_time)
178 printf ("Time is %lld fs\n", hp->snap_time);
178 printf ("Time is "GHWLLD" fs\n", hp->snap_time);
179179 if (flag_disp_signals)
180180 ghw_disp_values (hp);
181181 break;
201201 }
202202
203203 /*
204 * $Id: ghwdump.c,v 1.1.1.1 2007/05/30 04:28:15 gtkwave Exp $
204 * $Id: ghwdump.c,v 1.2 2008/07/01 18:51:07 gtkwave Exp $
205205 * $Log: ghwdump.c,v $
206 * Revision 1.2 2008/07/01 18:51:07 gtkwave
207 * compiler warning fixes for amd64
208 *
206209 * Revision 1.1.1.1 2007/05/30 04:28:15 gtkwave
207210 * Imported sources
208211 *
7272 typedef uint32_t lxtint32_t;
7373 typedef uint64_t lxtint64_t;
7474 #ifndef __MINGW32__
75 #define LXT2_RD_LLD "%lld"
75 #if __WORDSIZE == 64
76 #define LXT2_RD_LLD "%ld"
77 #else
78 #define LXT2_RD_LLD "%lld"
79 #endif
7680 #else
7781 #define LXT2_RD_LLD "%I64d"
7882 #endif
282286 #endif
283287
284288 /*
285 * $Id: lxt2_read.h,v 1.1.1.1 2007/05/30 04:28:18 gtkwave Exp $
289 * $Id: lxt2_read.h,v 1.2 2008/07/01 18:51:07 gtkwave Exp $
286290 * $Log: lxt2_read.h,v $
291 * Revision 1.2 2008/07/01 18:51:07 gtkwave
292 * compiler warning fixes for amd64
293 *
287294 * Revision 1.1.1.1 2007/05/30 04:28:18 gtkwave
288295 * Imported sources
289296 *
4242 {
4343 struct lxt2_rd_geometry *g = lxt2_rd_get_fac_geometry(*lt, *pnt_facidx);
4444
45 /* fprintf(stderr, "%lld %d %s\n", *pnt_time, *pnt_facidx, *pnt_value); */
45 /* fprintf(stderr, LXT2_RD_LLD" %d %s\n", *pnt_time, *pnt_facidx, *pnt_value); */
4646
4747 if(!(*pnt_value)[0])
4848 {
7373 {
7474 if(!names_only)
7575 {
76 printf("#%lld %s[%d:%d] %s\n", *pnt_time, lxt2_rd_get_facname(*lt, *pnt_facidx), g->msb, g->lsb, *pnt_value);
76 printf("#"LXT2_RD_LLD" %s[%d:%d] %s\n", *pnt_time, lxt2_rd_get_facname(*lt, *pnt_facidx), g->msb, g->lsb, *pnt_value);
7777 }
7878 else
7979 {
8686 {
8787 if(!names_only)
8888 {
89 printf("#%lld %s %s\n", *pnt_time, lxt2_rd_get_facname(*lt, *pnt_facidx), *pnt_value);
89 printf("#"LXT2_RD_LLD" %s %s\n", *pnt_time, lxt2_rd_get_facname(*lt, *pnt_facidx), *pnt_value);
9090 }
9191 else
9292 {
9797 {
9898 if(!names_only)
9999 {
100 printf("#%lld %s[%d] %s\n", *pnt_time, lxt2_rd_get_facname(*lt, *pnt_facidx), g->msb, *pnt_value);
100 printf("#"LXT2_RD_LLD" %s[%d] %s\n", *pnt_time, lxt2_rd_get_facname(*lt, *pnt_facidx), g->msb, *pnt_value);
101101 }
102102 else
103103 {
305305 }
306306
307307 /*
308 * $Id: lxt2miner.c,v 1.1.1.1 2007/05/30 04:28:25 gtkwave Exp $
308 * $Id: lxt2miner.c,v 1.2 2008/07/01 18:51:07 gtkwave Exp $
309309 * $Log: lxt2miner.c,v $
310 * Revision 1.2 2008/07/01 18:51:07 gtkwave
311 * compiler warning fixes for amd64
312 *
310313 * Revision 1.1.1.1 2007/05/30 04:28:25 gtkwave
311314 * Imported sources
312315 *
8787 {
8888 struct lxt2_rd_geometry *g = lxt2_rd_get_fac_geometry(*lt, *pnt_facidx);
8989
90 /* fprintf(stderr, "%lld %d %s\n", *pnt_time, *pnt_facidx, *pnt_value); */
90 /* fprintf(stderr, LXT2_RD_LLD" %d %s\n", *pnt_time, *pnt_facidx, *pnt_value); */
9191
9292 if(vcd_prevtime != *pnt_time)
9393 {
9494 vcd_prevtime = *pnt_time;
95 printf("#%lld\n", *pnt_time);
95 printf("#"LXT2_RD_LLD"\n", *pnt_time);
9696 }
9797
9898 if(!(*pnt_value)[0])
256256
257257 if(vcd_prevtime!=lxt2_rd_get_end_time(lt))
258258 {
259 printf("#%lld\n", lxt2_rd_get_end_time(lt));
259 printf("#"LXT2_RD_LLD"\n", lxt2_rd_get_end_time(lt));
260260 }
261261
262262 lxt2_rd_close(lt);
380380 }
381381
382382 /*
383 * $Id: lxt2vcd.c,v 1.1.1.1 2007/05/30 04:28:25 gtkwave Exp $
383 * $Id: lxt2vcd.c,v 1.2 2008/07/01 18:51:07 gtkwave Exp $
384384 * $Log: lxt2vcd.c,v $
385 * Revision 1.2 2008/07/01 18:51:07 gtkwave
386 * compiler warning fixes for amd64
387 *
385388 * Revision 1.1.1.1 2007/05/30 04:28:25 gtkwave
386389 * Imported sources
387390 *
2222 #include <string.h>
2323 #include <time.h>
2424 #include <sys/types.h>
25
26 #ifdef __MINGW32__
27 #ifndef REGEX_MAY_COMPILE
28 #define REGEX_MAY_COMPILE
29 #include "../gnu_regex.c"
30 #endif
31 #endif
2532
2633 #include "../gnu_regex.h"
2734
552559 }
553560
554561 /*
555 * $Id: tla2vcd.c,v 1.2 2007/08/31 22:42:44 gtkwave Exp $
562 * $Id: tla2vcd.c,v 1.4 2008/05/23 07:02:44 gtkwave Exp $
556563 * $Log: tla2vcd.c,v $
564 * Revision 1.4 2008/05/23 07:02:44 gtkwave
565 * path fix on gnu_regex.c
566 *
567 * Revision 1.3 2008/05/23 04:50:28 gtkwave
568 * mingw compile fix
569 *
557570 * Revision 1.2 2007/08/31 22:42:44 gtkwave
558571 * 3.1.0 RC3 updates
559572 *
8989 {
9090 struct vzt_rd_geometry *g = vzt_rd_get_fac_geometry(*lt, *pnt_facidx);
9191
92 /* fprintf(stderr, "%lld %d %s\n", *pnt_time, *pnt_facidx, *pnt_value); */
92 /* fprintf(stderr, VZT_RD_LLD" %d %s\n", *pnt_time, *pnt_facidx, *pnt_value); */
9393
9494 if(vcd_prevtime != *pnt_time)
9595 {
9696 vcd_prevtime = *pnt_time;
97 printf("#%lld\n", *pnt_time);
97 printf("#"VZT_RD_LLD"\n", *pnt_time);
9898 }
9999
100100 if(!(*pnt_value)[0])
240240 {
241241 if(!(g->flags & VZT_RD_SYM_F_INTEGER))
242242 {
243 printf("$var wire %d %s %s[%d:%d] $end\n", g->len, vcdid(newindx), netname, g->msb, g->lsb);
243 if(g->len) printf("$var wire %d %s %s[%d:%d] $end\n", g->len, vcdid(newindx), netname, g->msb, g->lsb);
244244 }
245245 else
246246 {
265265
266266 if(vcd_prevtime!=vzt_rd_get_end_time(lt))
267267 {
268 printf("#%lld\n", vzt_rd_get_end_time(lt));
268 printf("#"VZT_RD_LLD"\n", vzt_rd_get_end_time(lt));
269269 }
270270
271271 vzt_rd_close(lt);
395395 }
396396
397397 /*
398 * $Id: vzt2vcd.c,v 1.1.1.1 2007/05/30 04:28:25 gtkwave Exp $
398 * $Id: vzt2vcd.c,v 1.3 2008/07/19 23:26:49 gtkwave Exp $
399399 * $Log: vzt2vcd.c,v $
400 * Revision 1.3 2008/07/19 23:26:49 gtkwave
401 * fixed buffer overflow in vectorization code
402 *
403 * Revision 1.2 2008/07/01 18:51:07 gtkwave
404 * compiler warning fixes for amd64
405 *
400406 * Revision 1.1.1.1 2007/05/30 04:28:25 gtkwave
401407 * Imported sources
402408 *
577577 {
578578 for(i=0;i<len;i++)
579579 {
580 if((facidx+i)>=lt->numfacs) break;
581
580582 vindex_offset = lt->vindex_offset[facidx+i];
581583 vindex_offset_x = vindex_offset + lt->total_values;
582584
590592 {
591593 for(i=0;i<len;i++)
592594 {
595 if((facidx+i)>=lt->numfacs) break;
596
593597 vindex_offset = lt->vindex_offset[facidx+i];
594598
595599 valpnt = b->change_dict + (b->vindex[vindex_offset] * row_size + word);
664668 vztint32_t *valpnt_x;
665669 int which;
666670
667 for(i=0;i<len;i++)
668 {
671 for(i=0;i<len;i++)
672 {
673 if((facidx+i)>=lt->numfacs) break;
674
669675 vindex_offset = lt->vindex_offset[facidx+i];
670676 vindex_offset_x = vindex_offset + lt->total_values;
671677
680686 {
681687 for(i=0;i<len;i++)
682688 {
689 if((facidx+i)>=lt->numfacs) break;
690
683691 vindex_offset = lt->vindex_offset[facidx+i];
684692
685693 valpnt = val_base + (b->vindex[vindex_offset] * row_size);
20442052 lt->vindex_offset[i] = lt->vindex_offset[j];
20452053 for(k=1;k<lt->len[i];k++)
20462054 {
2047 lt->vindex_offset[k+i] = lt->vindex_offset[vzt_rd_get_alias_root(lt, k+i)];
2055 if((k+i) <= (lt->numfacs-1))
2056 {
2057 lt->vindex_offset[k+i] = lt->vindex_offset[vzt_rd_get_alias_root(lt, k+i)];
2058 }
20482059 }
20492060
20502061 if(synvec_chain[j])
20592070 {
20602071 for(l=0;l<lt->len[i];l++)
20612072 {
2062 if(lt->vindex_offset[idx+l] != lt->vindex_offset[i+l]) break;
2073 if((idx+l)<=(lt->numfacs-1))
2074 {
2075 if(lt->vindex_offset[idx+l] != lt->vindex_offset[i+l]) break;
2076 }
20632077 }
20642078
20652079 if(l == (lt->len[i]))
23312345 }
23322346
23332347 /*
2334 * $Id: vzt_read.c,v 1.1.1.1 2007/05/30 04:28:22 gtkwave Exp $
2348 * $Id: vzt_read.c,v 1.2 2008/07/19 23:26:49 gtkwave Exp $
23352349 * $Log: vzt_read.c,v $
2350 * Revision 1.2 2008/07/19 23:26:49 gtkwave
2351 * fixed buffer overflow in vectorization code
2352 *
23362353 * Revision 1.1.1.1 2007/05/30 04:28:22 gtkwave
23372354 * Imported sources
23382355 *
7373 typedef uint32_t vztint32_t;
7474 typedef uint64_t vztint64_t;
7575 #ifndef __MINGW32__
76 #define VZT_RD_LLD "%lld"
76 #if __WORDSIZE == 64
77 #define VZT_RD_LLD "%ld"
78 #else
79 #define VZT_RD_LLD "%lld"
80 #endif
7781 #else
7882 #define VZT_RD_LLD "%I64d"
7983 #endif
268272 #endif
269273
270274 /*
271 * $Id: vzt_read.h,v 1.1.1.1 2007/05/30 04:28:18 gtkwave Exp $
275 * $Id: vzt_read.h,v 1.2 2008/07/01 18:51:07 gtkwave Exp $
272276 * $Log: vzt_read.h,v $
277 * Revision 1.2 2008/07/01 18:51:07 gtkwave
278 * compiler warning fixes for amd64
279 *
273280 * Revision 1.1.1.1 2007/05/30 04:28:18 gtkwave
274281 * Imported sources
275282 *
4343 {
4444 struct vzt_rd_geometry *g = vzt_rd_get_fac_geometry(*lt, *pnt_facidx);
4545
46 /* fprintf(stderr, "%lld %d %s\n", *pnt_time, *pnt_facidx, *pnt_value); */
46 /* fprintf(stderr, VZT_RD_LLD" %d %s\n", *pnt_time, *pnt_facidx, *pnt_value); */
4747
4848 if(!(*pnt_value)[0])
4949 {
7474 {
7575 if(!names_only)
7676 {
77 printf("#%lld %s[%d:%d] %s\n", *pnt_time, vzt_rd_get_facname(*lt, *pnt_facidx), g->msb, g->lsb, *pnt_value);
77 printf("#"VZT_RD_LLD" %s[%d:%d] %s\n", *pnt_time, vzt_rd_get_facname(*lt, *pnt_facidx), g->msb, g->lsb, *pnt_value);
7878 }
7979 else
8080 {
8787 {
8888 if(!names_only)
8989 {
90 printf("#%lld %s %s\n", *pnt_time, vzt_rd_get_facname(*lt, *pnt_facidx), *pnt_value);
90 printf("#"VZT_RD_LLD" %s %s\n", *pnt_time, vzt_rd_get_facname(*lt, *pnt_facidx), *pnt_value);
9191 }
9292 else
9393 {
9898 {
9999 if(!names_only)
100100 {
101 printf("#%lld %s[%d] %s\n", *pnt_time, vzt_rd_get_facname(*lt, *pnt_facidx), g->msb, *pnt_value);
101 printf("#"VZT_RD_LLD" %s[%d] %s\n", *pnt_time, vzt_rd_get_facname(*lt, *pnt_facidx), g->msb, *pnt_value);
102102 }
103103 else
104104 {
307307 }
308308
309309 /*
310 * $Id: vztminer.c,v 1.1.1.1 2007/05/30 04:28:22 gtkwave Exp $
310 * $Id: vztminer.c,v 1.2 2008/07/01 18:51:07 gtkwave Exp $
311311 * $Log: vztminer.c,v $
312 * Revision 1.2 2008/07/01 18:51:07 gtkwave
313 * compiler warning fixes for amd64
314 *
312315 * Revision 1.1.1.1 2007/05/30 04:28:22 gtkwave
313316 * Imported sources
314317 *
0 /*
1 * Copyright (c) Tony Bybell 2008.
2 *
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version 2
6 * of the License, or (at your option) any later version.
7 */
8
9 #include "hierpack.h"
10
11 char *hier_decompress(char *n)
12 {
13 char *recon;
14
15 if(*n & 0x80)
16 {
17 unsigned char varbuff[5];
18 int idx = 0;
19 int lhs, rhs, tot;
20 unsigned int idxval = 0;
21 while(*n & 0x80)
22 {
23 varbuff[idx] = *n & 0x7f;
24 n++;
25 idx++;
26 }
27 while(--idx >= 0)
28 {
29 idxval <<= 7;
30 idxval |= (unsigned int)varbuff[idx];
31 }
32
33 lhs = strlen(GLOBALS->pfx_hier_array[idxval]);
34 rhs = strlen(n);
35 tot = lhs + rhs + 1;
36 recon = malloc_2(tot);
37 strcpy(recon, GLOBALS->pfx_hier_array[idxval]);
38 strcpy(recon + lhs, n);
39 }
40 else
41 {
42 recon = n;
43 }
44
45 return(recon);
46 }
47
48
49 char *hier_decompress_flagged(char *n, int *was_packed)
50 {
51 if(n)
52 {
53 *was_packed = ((*n & 0x80) != 0);
54 return(hier_decompress(n));
55 }
56 else
57 {
58 return(n);
59 }
60 }
61
62
63 char *hier_compress(char *name, int add_missing_pfx_to_tree, int *was_packed)
64 {
65 char *pnt = name;
66 char *last_h = NULL;
67 int curr_pfx_len;
68 JRB node;
69
70 *was_packed = 0;
71
72 while(*pnt)
73 {
74 if(*pnt == GLOBALS->hier_delimeter) last_h = pnt;
75 pnt++;
76 }
77 pnt = name;
78
79 if(last_h)
80 {
81 unsigned char varidx[5];
82 unsigned int shiftval;
83 unsigned int shiftidx;
84 unsigned int shiftmasked;
85 unsigned int pfxlen, sfxlen;
86
87 if(!GLOBALS->hier_pfx)
88 {
89 GLOBALS->hier_pfx = make_jrb();
90 GLOBALS->prev_hier_pfx = strdup_2("");
91 GLOBALS->prev_hier_pfx_len = 0;
92
93 fprintf(stderr, "MEMPACK | Using compressed hierarchy names\n");
94 }
95 curr_pfx_len = last_h - pnt + 1;
96 *last_h = 0;
97 if(GLOBALS->prev_hier_pfx_len && (GLOBALS->prev_hier_pfx_len == curr_pfx_len) && !strcmp(GLOBALS->prev_hier_pfx, pnt))
98 {
99 /* pfx matches so reuse */
100 }
101 else
102 {
103 node = jrb_find_str(GLOBALS->hier_pfx, pnt);
104 if(!node)
105 {
106 Jval val;
107 val.ui = GLOBALS->prev_hier_pfx_cnt = GLOBALS->hier_pfx_cnt;
108 if(add_missing_pfx_to_tree)
109 {
110 node = jrb_insert_str(GLOBALS->hier_pfx, strdup_2(pnt), val);
111 GLOBALS->hier_pfx_cnt++;
112 /* printf("Add %d: '%s' %d\n", node->val.ui, node->key.s, GLOBALS->hier_pfx_cnt); */
113 }
114 }
115 else
116 {
117 GLOBALS->prev_hier_pfx_cnt = node->val.ui;
118 }
119 }
120
121 shiftval = GLOBALS->prev_hier_pfx_cnt;
122 shiftidx = 0;
123
124 for(shiftidx=0;;shiftidx++)
125 {
126 shiftmasked = (shiftval & 0x7f) | 0x80; /* 0x80 = hier idx marker */
127 shiftval >>= 7;
128 if(!shiftval)
129 {
130 varidx[shiftidx] = shiftmasked;
131 shiftidx++;
132 break;
133 }
134 varidx[shiftidx] = shiftmasked;
135 }
136
137 pfxlen = shiftidx;
138 sfxlen = strlen(last_h+1);
139 if(curr_pfx_len > pfxlen)
140 {
141 static int savecnt = 0;
142 char *namereplace = malloc_2(pfxlen + 1 + sfxlen + 1);
143 memcpy(namereplace, varidx, pfxlen);
144 namereplace[pfxlen] = GLOBALS->hier_delimeter;
145 strcpy(namereplace+pfxlen+1, last_h+1);
146 *was_packed = 1;
147 name = namereplace;
148 savecnt += curr_pfx_len+1-pfxlen;
149 }
150
151 *last_h = GLOBALS->hier_delimeter;
152 }
153 else
154 {
155 /* no leading hier */
156 }
157
158 return(name);
159 }
160
161 /*
162 * $Id: hierpack.c,v 1.4 2008/07/20 20:48:08 gtkwave Exp $
163 * $Log: hierpack.c,v $
164 * Revision 1.4 2008/07/20 20:48:08 gtkwave
165 * compressed hierarchy support
166 *
167 * Revision 1.3 2008/07/20 01:29:36 gtkwave
168 * added command line option --comphier
169 *
170 * Revision 1.2 2008/07/18 17:29:50 gtkwave
171 * adding cvs headers
172 *
173 * Revision 1.1 2008/07/18 17:27:01 gtkwave
174 * adding hierpack code
175 *
176 */
177
0 /*
1 * Copyright (c) Tony Bybell 2008.
2 *
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version 2
6 * of the License, or (at your option) any later version.
7 */
8
9 #ifndef WAVE_HIERPACK_H
10 #define WAVE_HIERPACK_H
11
12 #include "globals.h"
13
14 char *hier_decompress(char *n);
15 char *hier_decompress_flagged(char *n, int *was_packed);
16
17 char *hier_compress(char *name, int add_missing_pfx_to_tree, int *was_packed);
18
19 enum { HIERPACK_DO_NOT_ADD = 0, HIERPACK_ADD };
20
21 #endif
22
23 /*
24 * $Id: hierpack.h,v 1.2 2008/07/18 17:29:50 gtkwave Exp $
25 * $Log: hierpack.h,v $
26 * Revision 1.2 2008/07/18 17:29:50 gtkwave
27 * adding cvs headers
28 *
29 * Revision 1.1 2008/07/18 17:27:01 gtkwave
30 * adding hierpack code
31 *
32 */
33
3333 #include <strings.h>
3434 #include <math.h>
3535
36 #ifdef __MINGW32__
36 #ifndef HAVE_BZERO
3737 #define bcopy(a,b,c) memcpy((b),(a),(c))
3838 #define bzero(a,b) memset((a),0,(b))
3939 #define bcmp(a,b,c) memcmp((a),(b),(c))
354354 }
355355
356356 /*
357 * $Id: interp.c,v 1.1 2008/02/15 16:30:58 gtkwave Exp $
357 * $Id: interp.c,v 1.2 2008/05/29 15:54:16 gtkwave Exp $
358358 * $Log: interp.c,v $
359 * Revision 1.2 2008/05/29 15:54:16 gtkwave
360 * added HAVE_BZERO patches for MinGW
361 *
359362 * Revision 1.1 2008/02/15 16:30:58 gtkwave
360363 * re-added after permission fix
361364 *
0 /*
1 * Libraries for fields, doubly-linked lists and red-black trees.
2 * Copyright (C) 2001 James S. Plank
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 */
9
10 /* Revision 1.2. Jim Plank */
11
12 /* Original code by Jim Plank (plank@cs.utk.edu) */
13 /* modified for THINK C 6.0 for Macintosh by Chris Bartley */
14
15 #include <string.h>
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <ctype.h>
19 #include "jrb.h"
20
21 static void mk_new_int(JRB l, JRB r, JRB p, int il);
22 static JRB lprev(JRB n);
23 static JRB rprev(JRB n);
24 static void recolor(JRB n);
25 static void single_rotate(JRB y, int l);
26
27 #define isred(n) (n->red)
28 #define isblack(n) (!isred(n))
29 #define isleft(n) (n->left)
30 #define isright(n) (!isleft(n))
31 #define isint(n) (n->internal)
32 #define isext(n) (!isint(n))
33 #define ishead(n) (n->roothead & 2)
34 #define isroot(n) (n->roothead & 1)
35 #define getlext(n) ((struct jrb_node *)(n->key.v))
36 #define setlext(node, val) node->key.v = (void *) (val)
37 #define getrext(n) ((struct jrb_node *)(n->val.v))
38 #define setrext(node, value) node->val.v = (void *) (value)
39 #define setred(n) n->red = 1
40 #define setblack(n) n->red = 0
41 #define setleft(n) n->left = 1
42 #define setright(n) n->left = 0
43 #define sethead(n) (n->roothead |= 2)
44 #define setroot(n) (n->roothead |= 1)
45 #define setint(n) n->internal = 1
46 #define setext(n) n->internal = 0
47 #define setnormal(n) n->roothead = 0
48 #define sibling(n) ((isleft(n)) ? n->parent->blink : n->parent->flink)
49
50 static void insert(JRB item, JRB list) /* Inserts to the end of a list */
51 {
52 JRB last_node;
53
54 last_node = list->blink;
55
56 list->blink = item;
57 last_node->flink = item;
58 item->blink = last_node;
59 item->flink = list;
60 }
61
62 static void delete_item(JRB item) /* Deletes an arbitrary iterm */
63 {
64 item->flink->blink = item->blink;
65 item->blink->flink = item->flink;
66 }
67
68 #define mk_new_ext(new, kkkey, vvval) {\
69 new = (JRB) calloc(1, sizeof(struct jrb_node));\
70 new->val = vvval;\
71 new->key = kkkey;\
72 setext(new);\
73 setblack(new);\
74 setnormal(new);\
75 }
76
77 static void mk_new_int(JRB l, JRB r, JRB p, int il)
78 {
79 JRB newnode;
80
81 newnode = (JRB) calloc(1, sizeof(struct jrb_node));
82 setint(newnode);
83 setred(newnode);
84 setnormal(newnode);
85 newnode->flink = l;
86 newnode->blink = r;
87 newnode->parent = p;
88 setlext(newnode, l);
89 setrext(newnode, r);
90 l->parent = newnode;
91 r->parent = newnode;
92 setleft(l);
93 setright(r);
94 if (ishead(p)) {
95 p->parent = newnode;
96 setroot(newnode);
97 } else if (il) {
98 setleft(newnode);
99 p->flink = newnode;
100 } else {
101 setright(newnode);
102 p->blink = newnode;
103 }
104 recolor(newnode);
105 }
106
107
108 JRB lprev(JRB n)
109 {
110 if (ishead(n)) return n;
111 while (!isroot(n)) {
112 if (isright(n)) return n->parent;
113 n = n->parent;
114 }
115 return n->parent;
116 }
117
118 JRB rprev(JRB n)
119 {
120 if (ishead(n)) return n;
121 while (!isroot(n)) {
122 if (isleft(n)) return n->parent;
123 n = n->parent;
124 }
125 return n->parent;
126 }
127
128 JRB make_jrb()
129 {
130 JRB head;
131
132 head = (JRB) calloc (1, sizeof(struct jrb_node));
133 head->flink = head;
134 head->blink = head;
135 head->parent = head;
136 head->key.s = "";
137 sethead(head);
138 return head;
139 }
140
141 JRB jrb_find_gte_str(JRB n, char *key, int *fnd)
142 {
143 int cmp;
144
145 *fnd = 0;
146 if (!ishead(n)) {
147 fprintf(stderr, "jrb_find_gte_str called on non-head 0x%p\n", n);
148 exit(1);
149 }
150 if (n->parent == n) return n;
151 cmp = strcmp(key, n->blink->key.s);
152 if (cmp == 0) {
153 *fnd = 1;
154 return n->blink;
155 }
156 if (cmp > 0) return n;
157 else n = n->parent;
158 while (1) {
159 if (isext(n)) return n;
160 cmp = strcmp(key, getlext(n)->key.s);
161 if (cmp == 0) {
162 *fnd = 1;
163 return getlext(n);
164 }
165 if (cmp < 0) n = n->flink ; else n = n->blink;
166 }
167 }
168
169 JRB jrb_find_str(JRB n, char *key)
170 {
171 int fnd;
172 JRB j;
173 j = jrb_find_gte_str(n, key, &fnd);
174 if (fnd) return j; else return NULL;
175 }
176
177 JRB jrb_find_gte_int(JRB n, int ikey, int *fnd)
178 {
179 *fnd = 0;
180 if (!ishead(n)) {
181 fprintf(stderr, "jrb_find_gte_int called on non-head 0x%p\n", n);
182 exit(1);
183 }
184 if (n->parent == n) return n;
185 if (ikey == n->blink->key.i) {
186 *fnd = 1;
187 return n->blink;
188 }
189 if (ikey > n->blink->key.i) return n;
190 else n = n->parent;
191 while (1) {
192 if (isext(n)) return n;
193 if (ikey == getlext(n)->key.i) {
194 *fnd = 1;
195 return getlext(n);
196 }
197 n = (ikey < getlext(n)->key.i) ? n->flink : n->blink;
198 }
199 }
200
201 JRB jrb_find_int(JRB n, int ikey)
202 {
203 int fnd;
204 JRB j;
205
206 j = jrb_find_gte_int(n, ikey, &fnd);
207 if (fnd) return j; else return NULL;
208 }
209
210 JRB jrb_find_gte_vptr(JRB n, void *vkey, int *fnd)
211 {
212 *fnd = 0;
213 if (!ishead(n)) {
214 fprintf(stderr, "jrb_find_gte_int called on non-head 0x%p\n", n);
215 exit(1);
216 }
217 if (n->parent == n) return n;
218 if ((char *)vkey == (char *)n->blink->key.v) {
219 *fnd = 1;
220 return n->blink;
221 }
222 if ((char *)vkey > (char *)n->blink->key.v) return n;
223 else n = n->parent;
224 while (1) {
225 if (isext(n)) return n;
226 if ((char *)vkey == (char *)getlext(n)->key.v) {
227 *fnd = 1;
228 return getlext(n);
229 }
230 n = ((char *)vkey < (char *)getlext(n)->key.v) ? n->flink : n->blink;
231 }
232 }
233
234 JRB jrb_find_vptr(JRB n, void *vkey)
235 {
236 int fnd;
237 JRB j;
238
239 j = jrb_find_gte_vptr(n, vkey, &fnd);
240 if (fnd) return j; else return NULL;
241 }
242
243 JRB jrb_find_gte_gen(JRB n, Jval key,int (*fxn)(Jval, Jval), int *fnd)
244 {
245 int cmp;
246
247 *fnd = 0;
248 if (!ishead(n)) {
249 fprintf(stderr, "jrb_find_gte_str called on non-head 0x%p\n", n);
250 exit(1);
251 }
252 if (n->parent == n) return n;
253 cmp = (*fxn)(key, n->blink->key);
254 if (cmp == 0) {
255 *fnd = 1;
256 return n->blink;
257 }
258 if (cmp > 0) return n;
259 else n = n->parent;
260 while (1) {
261 if (isext(n)) return n;
262 cmp = (*fxn)(key, getlext(n)->key);
263 if (cmp == 0) {
264 *fnd = 1;
265 return getlext(n);
266 }
267 if (cmp < 0) n = n->flink ; else n = n->blink;
268 }
269 }
270
271 JRB jrb_find_gen(JRB n, Jval key, int (*fxn)(Jval, Jval))
272 {
273 int fnd;
274 JRB j;
275
276 j = jrb_find_gte_gen(n, key, fxn, &fnd);
277 if (fnd) return j; else return NULL;
278 }
279
280 static JRB jrb_insert_b(JRB n, Jval key, Jval val)
281 {
282 JRB newleft, newright, newnode, p;
283
284 if (ishead(n)) {
285 if (n->parent == n) { /* Tree is empty */
286 mk_new_ext(newnode, key, val);
287 insert(newnode, n);
288 n->parent = newnode;
289 newnode->parent = n;
290 setroot(newnode);
291 return newnode;
292 } else {
293 mk_new_ext(newright, key, val);
294 insert(newright, n);
295 newleft = newright->blink;
296 setnormal(newleft);
297 mk_new_int(newleft, newright, newleft->parent, isleft(newleft));
298 p = rprev(newright);
299 if (!ishead(p)) setlext(p, newright);
300 return newright;
301 }
302 } else {
303 mk_new_ext(newleft, key, val);
304 insert(newleft, n);
305 setnormal(n);
306 mk_new_int(newleft, n, n->parent, isleft(n));
307 p = lprev(newleft);
308 if (!ishead(p)) setrext(p, newleft);
309 return newleft;
310 }
311 }
312
313 static void recolor(JRB n)
314 {
315 JRB p, gp, s;
316 int done = 0;
317
318 while(!done) {
319 if (isroot(n)) {
320 setblack(n);
321 return;
322 }
323
324 p = n->parent;
325
326 if (isblack(p)) return;
327
328 if (isroot(p)) {
329 setblack(p);
330 return;
331 }
332
333 gp = p->parent;
334 s = sibling(p);
335 if (isred(s)) {
336 setblack(p);
337 setred(gp);
338 setblack(s);
339 n = gp;
340 } else {
341 done = 1;
342 }
343 }
344 /* p's sibling is black, p is red, gp is black */
345
346 if ((isleft(n) == 0) == (isleft(p) == 0)) {
347 single_rotate(gp, isleft(n));
348 setblack(p);
349 setred(gp);
350 } else {
351 single_rotate(p, isleft(n));
352 single_rotate(gp, isleft(n));
353 setblack(n);
354 setred(gp);
355 }
356 }
357
358 static void single_rotate(JRB y, int l)
359 {
360 int rl = 0, ir;
361 JRB x, yp;
362
363 ir = isroot(y);
364 yp = y->parent;
365 if (!ir) {
366 rl = isleft(y);
367 }
368
369 if (l) {
370 x = y->flink;
371 y->flink = x->blink;
372 setleft(y->flink);
373 y->flink->parent = y;
374 x->blink = y;
375 setright(y);
376 } else {
377 x = y->blink;
378 y->blink = x->flink;
379 setright(y->blink);
380 y->blink->parent = y;
381 x->flink = y;
382 setleft(y);
383 }
384
385 x->parent = yp;
386 y->parent = x;
387 if (ir) {
388 yp->parent = x;
389 setnormal(y);
390 setroot(x);
391 } else {
392 if (rl) {
393 yp->flink = x;
394 setleft(x);
395 } else {
396 yp->blink = x;
397 setright(x);
398 }
399 }
400 }
401
402 void jrb_delete_node(JRB n)
403 {
404 JRB s, p, gp;
405 char ir;
406
407 if (isint(n)) {
408 fprintf(stderr, "Cannot delete an internal node: 0x%p\n", n);
409 exit(1);
410 }
411 if (ishead(n)) {
412 fprintf(stderr, "Cannot delete the head of an jrb_tree: 0x%p\n", n);
413 exit(1);
414 }
415 delete_item(n); /* Delete it from the list */
416 p = n->parent; /* The only node */
417 if (isroot(n)) {
418 p->parent = p;
419 free(n);
420 return;
421 }
422 s = sibling(n); /* The only node after deletion */
423 if (isroot(p)) {
424 s->parent = p->parent;
425 s->parent->parent = s;
426 setroot(s);
427 free(p);
428 free(n);
429 return;
430 }
431 gp = p->parent; /* Set parent to sibling */
432 s->parent = gp;
433 if (isleft(p)) {
434 gp->flink = s;
435 setleft(s);
436 } else {
437 gp->blink = s;
438 setright(s);
439 }
440 ir = isred(p);
441 free(p);
442 free(n);
443
444 if (isext(s)) { /* Update proper rext and lext values */
445 p = lprev(s);
446 if (!ishead(p)) setrext(p, s);
447 p = rprev(s);
448 if (!ishead(p)) setlext(p, s);
449 } else if (isblack(s)) {
450 fprintf(stderr, "DELETION PROB -- sib is black, internal\n");
451 exit(1);
452 } else {
453 p = lprev(s);
454 if (!ishead(p)) setrext(p, s->flink);
455 p = rprev(s);
456 if (!ishead(p)) setlext(p, s->blink);
457 setblack(s);
458 return;
459 }
460
461 if (ir) return;
462
463 /* Recolor */
464
465 n = s;
466 p = n->parent;
467 s = sibling(n);
468 while(isblack(p) && isblack(s) && isint(s) &&
469 isblack(s->flink) && isblack(s->blink)) {
470 setred(s);
471 n = p;
472 if (isroot(n)) return;
473 p = n->parent;
474 s = sibling(n);
475 }
476
477 if (isblack(p) && isred(s)) { /* Rotation 2.3b */
478 single_rotate(p, isright(n));
479 setred(p);
480 setblack(s);
481 s = sibling(n);
482 }
483
484 { JRB x, z; char il;
485
486 if (isext(s)) {
487 fprintf(stderr, "DELETION ERROR: sibling not internal\n");
488 exit(1);
489 }
490
491 il = isleft(n);
492 x = il ? s->flink : s->blink ;
493 z = sibling(x);
494
495 if (isred(z)) { /* Rotation 2.3f */
496 single_rotate(p, !il);
497 setblack(z);
498 if (isred(p)) setred(s); else setblack(s);
499 setblack(p);
500 } else if (isblack(x)) { /* Recoloring only (2.3c) */
501 if (isred(s) || isblack(p)) {
502 fprintf(stderr, "DELETION ERROR: 2.3c not quite right\n");
503 exit(1);
504 }
505 setblack(p);
506 setred(s);
507 return;
508 } else if (isred(p)) { /* 2.3d */
509 single_rotate(s, il);
510 single_rotate(p, !il);
511 setblack(x);
512 setred(s);
513 return;
514 } else { /* 2.3e */
515 single_rotate(s, il);
516 single_rotate(p, !il);
517 setblack(x);
518 return;
519 }
520 }
521 }
522
523 int jrb_nblack(JRB n)
524 {
525 int nb;
526 if (ishead(n) || isint(n)) {
527 fprintf(stderr, "ERROR: jrb_nblack called on a non-external node 0x%p\n",
528 n);
529 exit(1);
530 }
531 nb = 0;
532 while(!ishead(n)) {
533 if (isblack(n)) nb++;
534 n = n->parent;
535 }
536 return nb;
537 }
538
539 int jrb_plength(JRB n)
540 {
541 int pl;
542 if (ishead(n) || isint(n)) {
543 fprintf(stderr, "ERROR: jrb_plength called on a non-external node 0x%p\n",
544 n);
545 exit(1);
546 }
547 pl = 0;
548 while(!ishead(n)) {
549 pl++;
550 n = n->parent;
551 }
552 return pl;
553 }
554
555 void jrb_free_tree(JRB n)
556 {
557 if (!ishead(n)) {
558 fprintf(stderr, "ERROR: Rb_free_tree called on a non-head node\n");
559 exit(1);
560 }
561
562 while(jrb_first(n) != jrb_nil(n)) {
563 jrb_delete_node(jrb_first(n));
564 }
565 free(n);
566 }
567
568 Jval jrb_val(JRB n)
569 {
570 return n->val;
571 }
572
573 JRB jrb_insert_str(JRB tree, char *key, Jval val)
574 {
575 Jval k;
576 int fnd;
577
578 k.s = key;
579 return jrb_insert_b(jrb_find_gte_str(tree, key, &fnd), k, val);
580 }
581
582 JRB jrb_insert_int(JRB tree, int ikey, Jval val)
583 {
584 Jval k;
585 int fnd;
586
587 k.i = ikey;
588 return jrb_insert_b(jrb_find_gte_int(tree, ikey, &fnd), k, val);
589 }
590
591 JRB jrb_insert_vptr(JRB tree, void *vkey, Jval val)
592 {
593 Jval k;
594 int fnd;
595
596 k.v = vkey;
597 return jrb_insert_b(jrb_find_gte_vptr(tree, vkey, &fnd), k, val);
598 }
599
600 JRB jrb_insert_gen(JRB tree, Jval key, Jval val,
601 int (*func)(Jval, Jval))
602 {
603 int fnd;
604
605 return jrb_insert_b(jrb_find_gte_gen(tree, key, func, &fnd), key, val);
606 }
607
608 /*
609 * $Id: jrb.c,v 1.2 2008/07/18 17:30:58 gtkwave Exp $
610 * $Log: jrb.c,v $
611 * Revision 1.2 2008/07/18 17:30:58 gtkwave
612 * adding cvs headers
613 *
614 * Revision 1.1 2008/07/18 17:27:01 gtkwave
615 * adding hierpack code
616 *
617 */
618
0 #ifndef _JRB_H_
1 #define _JRB_H_
2
3 /* The Jval -- a type that can hold any 8-byte type */
4
5 typedef union {
6 int i;
7 long l;
8 float f;
9 double d;
10 void *v;
11 char *s;
12 char c;
13 unsigned char uc;
14 short sh;
15 unsigned short ush;
16 unsigned int ui;
17 int iarray[2];
18 float farray[2];
19 char carray[8];
20 unsigned char ucarray[8];
21 } Jval;
22
23 struct jrb_chain { /* added for rtlbrowse */
24 struct jrb_chain *next;
25 Jval val;
26 };
27
28 /* Main jrb_node. You only ever use the fields
29 flink
30 blink
31 k.key or k.ikey
32 v.val
33 */
34 typedef struct jrb_node {
35 unsigned char red;
36 unsigned char internal;
37 unsigned char left;
38 unsigned char roothead; /* (bit 1 is root, bit 2 is head) */
39 struct jrb_node *flink;
40 struct jrb_node *blink;
41 struct jrb_node *parent;
42 Jval key;
43 Jval val;
44 } *JRB;
45
46
47 extern JRB make_jrb(); /* Creates a new rb-tree */
48
49
50 /* Creates a node with key key and val val and inserts it into the tree.
51 jrb_insert uses strcmp() as comparison funcion. jrb_inserti uses <>=,
52 jrb_insertg uses func() */
53
54 extern JRB jrb_insert_str(JRB tree, char *key, Jval val);
55 extern JRB jrb_insert_int(JRB tree, int ikey, Jval val);
56 extern JRB jrb_insert_vptr(JRB tree, void *vkey, Jval val);
57 extern JRB jrb_insert_gen(JRB tree, Jval key, Jval val, int (*func)(Jval,Jval));
58
59 /* returns an external node in t whose value is equal k. Returns NULL if
60 there is no such node in the tree */
61
62 extern JRB jrb_find_str(JRB root, char *key);
63 extern JRB jrb_find_int(JRB root, int ikey);
64 extern JRB jrb_find_vptr(JRB root, void *vkey);
65 extern JRB jrb_find_gen(JRB root, Jval, int (*func)(Jval, Jval));
66
67
68 /* returns an external node in t whose value is equal
69 k or whose value is the smallest value greater than k. Sets found to
70 1 if the key was found, and 0 otherwise. */
71
72 extern JRB jrb_find_gte_str(JRB root, char *key, int *found);
73 extern JRB jrb_find_gte_int(JRB root, int ikey, int *found);
74 extern JRB jrb_find_gte_vptr(JRB root, void *vkey, int *found);
75 extern JRB jrb_find_gte_gen(JRB root, Jval key,
76 int (*func)(Jval, Jval), int *found);
77
78
79 /* Creates a node with key key and val val and inserts it into the
80 tree before/after node nd. Does not check to ensure that you are
81 keeping the correct order */
82
83 extern void jrb_delete_node(JRB node); /* Deletes and frees a node (but
84 not the key or val) */
85 extern void jrb_free_tree(JRB root); /* Deletes and frees an entire tree */
86
87 extern Jval jrb_val(JRB node); /* Returns node->v.val -- this is to shut
88 lint up */
89
90 extern int jrb_nblack(JRB n); /* returns # of black nodes in path from
91 n to the root */
92 int jrb_plength(JRB n); /* returns the # of nodes in path from
93 n to the root */
94
95 #define jrb_first(n) (n->flink)
96 #define jrb_last(n) (n->blink)
97 #define jrb_next(n) (n->flink)
98 #define jrb_prev(n) (n->blink)
99 #define jrb_empty(t) (t->flink == t)
100 #ifndef jrb_nil
101 #define jrb_nil(t) (t)
102 #endif
103
104 #define jrb_traverse(ptr, lst) \
105 for(ptr = jrb_first(lst); ptr != jrb_nil(lst); ptr = jrb_next(ptr))
106
107 #define jrb_rtraverse(ptr, lst) \
108 for(ptr = jrb_last(lst); ptr != jrb_nil(lst); ptr = jrb_prev(ptr))
109
110 #endif
111
112 /*
113 * $Id: jrb.h,v 1.2 2008/07/18 17:30:58 gtkwave Exp $
114 * $Log: jrb.h,v $
115 * Revision 1.2 2008/07/18 17:30:58 gtkwave
116 * adding cvs headers
117 *
118 * Revision 1.1 2008/07/18 17:27:01 gtkwave
119 * adding hierpack code
120 *
121 */
122
00 /*
1 * Copyright (c) Tony Bybell 2003-2006.
1 * Copyright (c) Tony Bybell 2003-2008.
22 *
33 * This program is free software; you can redistribute it and/or
44 * modify it under the terms of the GNU General Public License
2525 #include "lxt2_read.h"
2626 #include "debug.h"
2727 #include "busy.h"
28 #include "hierpack.h"
2829
2930
3031 /*
3940 unsigned int numalias = 0;
4041 struct symbol *sym_block = NULL;
4142 struct Node *node_block = NULL;
43 JRB ptr, lst;
4244
4345 GLOBALS->lx2_lx2_c_1 = lxt2_rd_init(fname);
4446 if(!GLOBALS->lx2_lx2_c_1)
8587 if(GLOBALS->numfacs)
8688 {
8789 char *fnam = lxt2_rd_get_facname(GLOBALS->lx2_lx2_c_1, 0);
88 int flen = strlen(fnam);
89
90 GLOBALS->mvlfacs_lx2_c_1[0].name=malloc_2(flen+1);
91 strcpy(GLOBALS->mvlfacs_lx2_c_1[0].name, fnam);
90 char *pnt;
91 int was_packed = 0;
92
93 if(GLOBALS->do_hier_compress)
94 {
95 pnt = hier_compress(fnam, HIERPACK_ADD, &was_packed);
96 }
97
98 if(was_packed)
99 {
100 GLOBALS->mvlfacs_lx2_c_1[0].name = pnt;
101 }
102 else
103 {
104 int flen = strlen(fnam);
105 GLOBALS->mvlfacs_lx2_c_1[0].name=malloc_2(flen+1);
106 strcpy(GLOBALS->mvlfacs_lx2_c_1[0].name, fnam);
107 }
92108 }
93109
94110 for(i=0;i<GLOBALS->numfacs;i++)
100116 if(i!=(GLOBALS->numfacs-1))
101117 {
102118 char *fnam = lxt2_rd_get_facname(GLOBALS->lx2_lx2_c_1, i+1);
103 int flen = strlen(fnam);
104
105 GLOBALS->mvlfacs_lx2_c_1[i+1].name=malloc_2(flen+1);
106 strcpy(GLOBALS->mvlfacs_lx2_c_1[i+1].name, fnam);
119 char *pnt;
120 int was_packed = 0;
121
122 if(GLOBALS->do_hier_compress)
123 {
124 pnt = hier_compress(fnam, HIERPACK_ADD, &was_packed);
125 }
126
127 if(was_packed)
128 {
129 GLOBALS->mvlfacs_lx2_c_1[i+1].name = pnt;
130 }
131 else
132 {
133 int flen = strlen(fnam);
134 GLOBALS->mvlfacs_lx2_c_1[i+1].name=malloc_2(flen+1);
135 strcpy(GLOBALS->mvlfacs_lx2_c_1[i+1].name, fnam);
136 }
107137 }
108138
109139 if(i>1)
237267 }
238268 }
239269
270 GLOBALS->pfx_hier_array = calloc_2(GLOBALS->hier_pfx_cnt ? GLOBALS->hier_pfx_cnt : 1, sizeof(char *));
271
272 lst = GLOBALS->hier_pfx;
273 if(lst)
274 {
275 jrb_traverse(ptr, lst)
276 {
277 GLOBALS->pfx_hier_array[ptr->val.ui] = ptr->key.s;
278 }
279 }
240280
241281 /* SPLASH */ splash_sync(2, 5);
242282 GLOBALS->facs=(struct symbol **)malloc_2(GLOBALS->numfacs*sizeof(struct symbol *));
243283
244 if(GLOBALS->fast_tree_sort)
284 if((GLOBALS->fast_tree_sort) && (!GLOBALS->do_hier_compress))
245285 {
246286 GLOBALS->curnode=GLOBALS->firstnode;
247287 for(i=0;i<GLOBALS->numfacs;i++)
352392 init_tree();
353393 for(i=0;i<GLOBALS->numfacs;i++)
354394 {
355 build_tree_from_name(GLOBALS->facs[i]->name, i);
395 char *n = GLOBALS->facs[i]->name;
396 int was_packed;
397 char *recon = hier_decompress_flagged(n, &was_packed);
398
399 if(was_packed)
400 {
401 build_tree_from_name(recon, i);
402 free_2(recon);
403 }
404 else
405 {
406 build_tree_from_name(n, i);
407 }
356408 }
357409 /* SPLASH */ splash_sync(5, 5);
358410 treegraft(GLOBALS->treeroot);
359411 treesort(GLOBALS->treeroot, NULL);
412 }
413
414 if(GLOBALS->prev_hier_uncompressed_name)
415 {
416 free_2(GLOBALS->prev_hier_uncompressed_name);
417 GLOBALS->prev_hier_uncompressed_name = NULL;
360418 }
361419
362420 GLOBALS->min_time = GLOBALS->first_cycle_lx2_c_1; GLOBALS->max_time=GLOBALS->last_cycle_lx2_c_1;
580638 if(f->flags&LXT2_RD_SYM_F_STRING) np->head.flags |= HIST_STRING;
581639 }
582640
641 {
642 struct HistEnt *htemp2 = calloc_2(1, sizeof(struct HistEnt));
643 htemp2->time = -1;
644 if(len>1)
645 {
646 htemp2->v.h_vector = htemp->v.h_vector;
647 }
648 else
649 {
650 htemp2->v.h_val = htemp->v.h_val;
651 }
652 htemp2->next = htemp;
653 htemp = htemp2;
654 GLOBALS->lx2_table_lx2_c_1[txidx].numtrans++;
655 }
656
583657 np->head.time = -2;
584658 np->head.next = htemp;
585659 np->numhist=GLOBALS->lx2_table_lx2_c_1[txidx].numtrans +2 /*endcap*/ +1 /*frontcap*/;
727801 if(f->flags&LXT2_RD_SYM_F_STRING) np->head.flags |= HIST_STRING;
728802 }
729803
804 {
805 struct HistEnt *htemp2 = calloc_2(1, sizeof(struct HistEnt));
806 htemp2->time = -1;
807 if(len>1)
808 {
809 htemp2->v.h_vector = htemp->v.h_vector;
810 }
811 else
812 {
813 htemp2->v.h_val = htemp->v.h_val;
814 }
815 htemp2->next = htemp;
816 htemp = htemp2;
817 GLOBALS->lx2_table_lx2_c_1[txidx].numtrans++;
818 }
819
730820 np->head.time = -2;
731821 np->head.next = htemp;
732822 np->numhist=GLOBALS->lx2_table_lx2_c_1[txidx].numtrans +2 /*endcap*/ +1 /*frontcap*/;
741831 }
742832
743833 /*
744 * $Id: lx2.c,v 1.2 2007/08/26 21:35:41 gtkwave Exp $
834 * $Id: lx2.c,v 1.4 2008/07/20 20:48:08 gtkwave Exp $
745835 * $Log: lx2.c,v $
836 * Revision 1.4 2008/07/20 20:48:08 gtkwave
837 * compressed hierarchy support
838 *
839 * Revision 1.3 2008/06/15 21:26:45 gtkwave
840 * time -1 endcap add for LXT2 + VZT loaders
841 *
746842 * Revision 1.2 2007/08/26 21:35:41 gtkwave
747843 * integrated global context management from SystemOfCode2007 branch
748844 *
3030 #include "lxt.h"
3131 #include "bsearch.h"
3232 #include "debug.h"
33 #include "hierpack.h"
3334
3435 /****************************************************************************/
3536
145146 */
146147
147148 inline static unsigned int get_byte(offset) {
148 return ((unsigned int)(*((unsigned char *)mm+(offset))));
149 }
150
151 inline static unsigned int define get_16(offset) {
152 return ((unsigned int)(*((unsigned short *)(((unsigned char *)mm)+(offset))))
153 }
154
155 inline static usigned int get_32(offset) {
156 return (*(unsigned int *)(((unsigned char *)mm)+(offset)));
149 return ((unsigned int)(*((unsigned char *)(GLOBALS->mm_lxt_c_1)+(offset))));
150 }
151
152 inline static unsigned int get_16(offset) {
153 return ((unsigned int)(*((unsigned short *)(((unsigned char *)(GLOBALS->mm_lxt_c_1))
154 +(offset)))));
155 }
156
157 inline static unsigned int get_32(offset) {
158 return (*(unsigned int *)(((unsigned char *)(GLOBALS->mm_lxt_c_1))+(offset)));
157159 }
158160
159161 inline static unsigned int get_24(offset) {
160162 return ((get_32((offset)-1)<<8)>>8);
161163 }
162164
163 inline static usigned int get_64(offset) {
164 return ((((UTimeType)get_32(offset))<<32)|((UTimeType)get_32((offset)+4)))
165 }
166
165 inline static unsigned int get_64(offset) {
166 return ((((UTimeType)get_32(offset))<<32)|((UTimeType)get_32((offset)+4)));
167 }
168
167169 #else
168170
169171 /*
431433 int total_mem = get_32(GLOBALS->facname_offset_lxt_c_1+4);
432434 gzFile zhandle = NULL;
433435 char *decmem=NULL;
436 JRB ptr, lst;
437
434438
435439 #if defined __MINGW32__ || defined _MSC_VER
436440 FILE *tmp;
437441 #endif
438442
439 buf=malloc_2(total_mem);
440 pnt=bufprev=buf;
443 if(!GLOBALS->do_hier_compress)
444 {
445 buf=malloc_2(total_mem);
446 pnt=bufprev=buf;
447 }
441448
442449 if(GLOBALS->zfacname_size_lxt_c_1)
443450 {
463470 offs=0; /* we're in our new memory region now.. */
464471 }
465472
466 fprintf(stderr, LXTHDR"Building %d facilities.\n", GLOBALS->numfacs);
467 for(i=0;i<GLOBALS->numfacs;i++)
468 {
469 clone=get_16(offs); offs+=2;
470 bufcurr=pnt;
471 for(j=0;j<clone;j++)
472 {
473 *(pnt++) = *(bufprev++);
474 }
475 while((*(pnt++)=get_byte(offs++)));
476 GLOBALS->mvlfacs_lxt_c_2[i].name=bufcurr;
477 DEBUG(printf(LXTHDR"Encountered facility %d: '%s'\n", i, bufcurr));
478 bufprev=bufcurr;
473 if(GLOBALS->do_hier_compress)
474 {
475 char workspace[4097];
476 int was_packed;
477 char *string_ret;
478
479 workspace[0] = 0;
480
481 fprintf(stderr, LXTHDR"Building %d compressed facilities.\n", GLOBALS->numfacs);
482 for(i=0;i<GLOBALS->numfacs;i++)
483 {
484 clone=get_16(offs); offs+=2;
485 pnt=workspace+clone;
486 while((*(pnt++)=get_byte(offs++)));
487 string_ret = hier_compress(workspace, HIERPACK_ADD, &was_packed);
488 if(was_packed)
489 {
490 GLOBALS->mvlfacs_lxt_c_2[i].name=string_ret;
491 }
492 else
493 {
494 GLOBALS->mvlfacs_lxt_c_2[i].name=strdup_2(workspace);
495 }
496 }
497 }
498 else
499 {
500 fprintf(stderr, LXTHDR"Building %d facilities.\n", GLOBALS->numfacs);
501 for(i=0;i<GLOBALS->numfacs;i++)
502 {
503 clone=get_16(offs); offs+=2;
504 bufcurr=pnt;
505 for(j=0;j<clone;j++)
506 {
507 *(pnt++) = *(bufprev++);
508 }
509 while((*(pnt++)=get_byte(offs++)));
510 GLOBALS->mvlfacs_lxt_c_2[i].name=bufcurr;
511 DEBUG(printf(LXTHDR"Encountered facility %d: '%s'\n", i, bufcurr));
512 bufprev=bufcurr;
513 }
514 }
515
516 GLOBALS->pfx_hier_array = calloc_2(GLOBALS->hier_pfx_cnt ? GLOBALS->hier_pfx_cnt : 1, sizeof(char *));
517 lst = GLOBALS->hier_pfx;
518 if(lst)
519 {
520 jrb_traverse(ptr, lst)
521 {
522 GLOBALS->pfx_hier_array[ptr->val.ui] = ptr->key.s;
523 }
479524 }
525
526 if(GLOBALS->prev_hier_uncompressed_name) { free_2(GLOBALS->prev_hier_uncompressed_name); GLOBALS->prev_hier_uncompressed_name = NULL; }
480527
481528 if(GLOBALS->zfacname_size_lxt_c_1)
482529 {
17401787 init_tree();
17411788 for(i=0;i<GLOBALS->numfacs;i++)
17421789 {
1743 build_tree_from_name(GLOBALS->facs[i]->name, i);
1790 char *n = GLOBALS->facs[i]->name;
1791 int was_packed;
1792 char *recon = hier_decompress_flagged(n, &was_packed);
1793
1794 if(was_packed)
1795 {
1796 build_tree_from_name(recon, i);
1797 free_2(recon);
1798 }
1799 else
1800 {
1801 build_tree_from_name(n, i);
1802 }
17441803 }
17451804 /* SPLASH */ splash_sync(5, 5);
17461805 treegraft(GLOBALS->treeroot);
23162375 }
23172376
23182377 /*
2319 * $Id: lxt.c,v 1.3 2008/02/22 22:08:06 gtkwave Exp $
2378 * $Id: lxt.c,v 1.5 2008/07/22 18:46:16 gtkwave Exp $
23202379 * $Log: lxt.c,v $
2380 * Revision 1.5 2008/07/22 18:46:16 gtkwave
2381 * add compressed hierarchy handling to lxt reader
2382 *
2383 * Revision 1.4 2008/07/18 18:22:58 gtkwave
2384 * fixes for aix
2385 *
23212386 * Revision 1.3 2008/02/22 22:08:06 gtkwave
23222387 * fix of previously undetected linear lxt reader bug involving integers
23232388 *
6969 guint page_num,
7070 gpointer user_data)
7171 {
72 int i;
7372 char timestr[32];
7473 struct Global *g_old = GLOBALS;
7574
198197 " -S, --script=FILE specify GUI command script file for execution\n"
199198 XID_GETOPT
200199 INTR_GETOPT
200 " -C, --comphier use compressed hierarchy names (slower)\n"
201201 " -g, --giga use gigabyte mempacking when recoding (slower)\n"
202202 " -L, --legacy use legacy VCD mode rather than the VCD recoder\n"
203203 " -v, --vcd use stdin as a VCD dumpfile\n"
250250
251251
252252 int main(int argc, char *argv[])
253 {
254 return(main_2(argc, argv));
255 }
256
257 int main_2(int argc, char *argv[])
253258 {
254259 static char *winprefix="GTKWave - ";
255260 static char *winstd="GTKWave (stdio) ";
271276 FILE *wave = NULL;
272277 FILE *vcd_save_handle_cached = NULL;
273278
274 GtkWidget *main_vbox, *top_table, *whole_table;
279 GtkWidget *main_vbox = NULL, *top_table = NULL, *whole_table = NULL;
275280 GtkWidget *menubar;
276281 GtkWidget *text1;
277282 GtkWidget *zoombuttons;
498503 {"dualid", 1, 0, 'D'},
499504 {"interactive", 0, 0, 'I'},
500505 {"giga", 0, 0, 'g'},
506 {"comphier", 0, 0, 'C'},
501507 {"legacy", 0, 0, 'L'},
502508 {0, 0, 0, 0}
503509 };
504510
505 c = getopt_long (argc, argv, "f:on:a:Ar:di:l:s:e:c:t:NS:vVhxX:MD:IgL", long_options, &option_index);
511 c = getopt_long (argc, argv, "f:on:a:Ar:di:l:s:e:c:t:NS:vVhxX:MD:IgCL", long_options, &option_index);
506512
507513 if (c == -1) break; /* no more args */
508514
699705
700706 case 'g':
701707 is_giga = 1;
708 break;
709
710 case 'C':
711 GLOBALS->do_hier_compress = 1;
702712 break;
703713
704714 case '?':
11591169 }
11601170 }
11611171
1162 if(GLOBALS->force_toolbars)
1163 {
1164 toolhandle=gtk_handle_box_new();
1165 gtk_widget_show(toolhandle);
1166 gtk_container_add(GTK_CONTAINER(toolhandle), top_table);
1167 }
1168
11691172 whole_table = gtk_table_new (256, 16, FALSE);
11701173
11711174 tb = gtk_toolbar_new();
11731176
11741177 gtk_toolbar_set_style(GTK_TOOLBAR(tb), GTK_TOOLBAR_ICONS);
11751178 tb_pos = 0;
1179
1180 if(GLOBALS->force_toolbars)
1181 {
1182 toolhandle=gtk_handle_box_new();
1183 gtk_widget_show(toolhandle);
1184 gtk_container_add(GTK_CONTAINER(toolhandle), top_table);
1185 }
11761186
11771187 stock = gtk_toolbar_insert_stock(GTK_TOOLBAR(tb),
11781188 GTK_STOCK_CUT,
20372047 #endif
20382048
20392049 /*
2040 * $Id: main.c,v 1.28 2008/04/03 16:45:06 gtkwave Exp $
2050 * $Id: main.c,v 1.31 2008/07/20 01:29:36 gtkwave Exp $
20412051 * $Log: main.c,v $
2052 * Revision 1.31 2008/07/20 01:29:36 gtkwave
2053 * added command line option --comphier
2054 *
2055 * Revision 1.30 2008/07/01 18:51:06 gtkwave
2056 * compiler warning fixes for amd64
2057 *
2058 * Revision 1.29 2008/06/11 08:01:50 gtkwave
2059 * gcc 4.3.x compiler warning fixes
2060 *
20422061 * Revision 1.28 2008/04/03 16:45:06 gtkwave
20432062 * removed call to time_trunc with marker setting on initialization
20442063 *
2121 char *name;
2222 };
2323
24 int main_2(int argc, char *argv[]);
2425
2526 GtkWidget *create_text(void);
2627 GtkWidget *create_zoom_buttons(void);
7273 #endif
7374
7475 /*
75 * $Id: main.h,v 1.3 2007/12/30 04:27:39 gtkwave Exp $
76 * $Id: main.h,v 1.4 2008/07/01 18:51:07 gtkwave Exp $
7677 * $Log: main.h,v $
78 * Revision 1.4 2008/07/01 18:51:07 gtkwave
79 * compiler warning fixes for amd64
80 *
7781 * Revision 1.3 2007/12/30 04:27:39 gtkwave
7882 * added edge buttons to main window
7983 *
2323 #include "translate.h"
2424 #include "ptranslate.h"
2525 #include "lx2.h"
26 #include "hierpack.h"
2627
2728 #if !defined __MINGW32__ && !defined _MSC_VER
2829 #include <unistd.h>
597598 {
598599 if(!GLOBALS->hier_max_level)
599600 {
600 t->name = t->n.nd->nname;
601 int flagged;
602
603 if(t->is_depacked) { free_2(t->name); }
604 t->name = hier_decompress_flagged(t->n.nd->nname, &flagged);
605 t->is_depacked = (flagged != 0);
601606 }
602607 else
603608 {
604 t->name = hier_extract(t->n.nd->nname, GLOBALS->hier_max_level);
609 int flagged;
610 char *tbuff = hier_decompress_flagged(t->n.nd->nname, &flagged);
611
612 if(t->is_depacked) { free_2(t->name); }
613 t->is_depacked = (flagged != 0);
614 if(!flagged)
615 {
616 t->name = hier_extract(t->n.nd->nname, GLOBALS->hier_max_level);
617 }
618 else
619 {
620 t->name = strdup_2(hier_extract(tbuff, GLOBALS->hier_max_level));
621 free_2(tbuff);
622 }
605623 }
606624 }
607625 }
10511069 unsigned np = GLOBALS->num_notebook_pages;
10521070 unsigned int new_page = (this_page != np-1) ? this_page : (this_page-1);
10531071 GtkWidget *n = GLOBALS->notebook;
1054 struct Global *old_g, *saved_g;
1072 struct Global *old_g = NULL, *saved_g;
10551073
10561074 dead_context_sweep();
10571075
18581876 void
18591877 menu_new_viewer_tab_cleanup(GtkWidget *widget, gpointer data)
18601878 {
1861 pid_t pid;
1862
18631879 if(GLOBALS->filesel_ok)
18641880 {
18651881 char *argv[2];
18761892
18771893 if(!setjmp(*(GLOBALS->vcd_jmp_buf)))
18781894 {
1879 main(2, argv);
1895 main_2(2, argv);
18801896
18811897 g_now = GLOBALS;
18821898 set_GLOBALS(g_old);
25602576
25612577 static char *append_array_row(nptr n)
25622578 {
2579 int was_packed;
2580 char *hname = hier_decompress_flagged(n->nname, &was_packed);
2581
2582
25632583 if(!n->array_height)
25642584 {
2565 return(n->nname);
2585 strcpy(GLOBALS->buf_menu_c_1, hname);
25662586 }
25672587 else
25682588 {
2569 sprintf(GLOBALS->buf_menu_c_1, "%s{%d}", n->nname, n->this_row);
2570 return(GLOBALS->buf_menu_c_1);
2571 }
2589 sprintf(GLOBALS->buf_menu_c_1, "%s{%d}", hname, n->this_row);
2590 }
2591
2592 if(was_packed) free_2(hname);
2593
2594 return(GLOBALS->buf_menu_c_1);
25722595 }
25732596
25742597
47534776
47544777
47554778 /*
4756 * $Id: menu.c,v 1.32 2008/04/03 16:56:10 gtkwave Exp $
4779 * $Id: menu.c,v 1.35 2008/07/18 17:27:01 gtkwave Exp $
47574780 * $Log: menu.c,v $
4781 * Revision 1.35 2008/07/18 17:27:01 gtkwave
4782 * adding hierpack code
4783 *
4784 * Revision 1.34 2008/07/01 18:51:07 gtkwave
4785 * compiler warning fixes for amd64
4786 *
4787 * Revision 1.33 2008/06/11 08:01:51 gtkwave
4788 * gcc 4.3.x compiler warning fixes
4789 *
47584790 * Revision 1.32 2008/04/03 16:56:10 gtkwave
47594791 * more time_trunc() removals
47604792 *
233233 gint xd = 0, yd = 0;
234234 char *asciivalue = NULL;
235235 int nmaxlen = 0, vmaxlen = 0;
236 int totalmax;
236 int totalmax = 0;
237237 int name_charlen = 0, value_charlen = 0;
238238 int num_info_rows = 2;
239239 char *flagged_name = NULL;
384384 }
385385
386386 /*
387 * $Id: mouseover.c,v 1.8 2008/04/25 21:31:10 gtkwave Exp $
387 * $Id: mouseover.c,v 1.9 2008/07/01 18:51:07 gtkwave Exp $
388388 * $Log: mouseover.c,v $
389 * Revision 1.9 2008/07/01 18:51:07 gtkwave
390 * compiler warning fixes for amd64
391 *
389392 * Revision 1.8 2008/04/25 21:31:10 gtkwave
390393 * added missing t->shift in mouseover time calculation
391394 *
2020 #endif
2121 #endif
2222
23 #ifdef __CYGWIN__
24 #include <sys/types.h>
25 #include <stdlib.h>
26 #define REGEX_MAY_COMPILE
27 #include "gnu_regex.c"
28 #else
29 #if defined __linux__
23 #ifdef __linux__
3024 #include <sys/types.h>
3125 #include <stdlib.h>
3226 #include <regex.h>
33 #else /* or for any other compiler that doesn't support POSIX.2 regexs properly like xlc or vc++ */
34 #ifdef __MINGW32__
27 #else
28 #if defined __CYGWIN__ || defined __MINGW32__
29 #include <sys/types.h>
30 #include <stdlib.h>
31 #ifndef HAVE_BZERO
3532 #define bcopy(a,b,c) memcpy((b),(a),(c))
3633 #define bzero(a,b) memset((a),0,(b))
3734 #define bcmp(a,b,c) memcmp((a),(b),(c))
3835 #endif
36 #define REGEX_MAY_COMPILE
37 #include "gnu_regex.c"
38 #else /* or for any other compiler that doesn't support POSIX.2 regexs properly like xlc or vc++ */
3939 #ifdef _MSC_VER
4040 #include <malloc.h>
4141 #define STDC_HEADERS
131131 }
132132
133133 /*
134 * $Id: regex.c,v 1.2 2007/08/26 21:35:44 gtkwave Exp $
134 * $Id: regex.c,v 1.3 2008/05/29 15:54:16 gtkwave Exp $
135135 * $Log: regex.c,v $
136 * Revision 1.3 2008/05/29 15:54:16 gtkwave
137 * added HAVE_BZERO patches for MinGW
138 *
136139 * Revision 1.2 2007/08/26 21:35:44 gtkwave
137140 * integrated global context management from SystemOfCode2007 branch
138141 *
4444 static void pagesize_clicked(GtkWidget *widget, gpointer which)
4545 {
4646 int i;
47 char *which_char;
4847
4948 for(i=0;i<5;i++) GLOBALS->page_mutex_renderopt_c_1[i]=0;
5049
5756 static void rendertype_clicked(GtkWidget *widget, gpointer which)
5857 {
5958 int i;
60 char *which_char;
6159
6260 for(i=0;i<2;i++) GLOBALS->render_mutex_renderopt_c_1[i]=0;
6361
314312 }
315313
316314 /*
317 * $Id: renderopt.c,v 1.5 2007/09/12 17:26:45 gtkwave Exp $
315 * $Id: renderopt.c,v 1.6 2008/06/11 08:01:53 gtkwave Exp $
318316 * $Log: renderopt.c,v $
317 * Revision 1.6 2008/06/11 08:01:53 gtkwave
318 * gcc 4.3.x compiler warning fixes
319 *
319320 * Revision 1.5 2007/09/12 17:26:45 gtkwave
320321 * experimental ctx_swap_watchdog added...still tracking down mouse thrash crashes
321322 *
2323 #include "ghw.h"
2424 #include "debug.h"
2525 #include "busy.h"
26 #include "hierpack.h"
27
28 static gint
29 clist_sigcmp (GtkCList *clist,
30 gconstpointer ptr1,
31 gconstpointer ptr2)
32 {
33 char *text1 = NULL;
34 char *text2 = NULL;
35
36 GtkCListRow *row1 = (GtkCListRow *) ptr1;
37 GtkCListRow *row2 = (GtkCListRow *) ptr2;
38
39 char *nd1, *nd2;
40 int was_packed1=0, was_packed2=0;
41 int rc;
42
43 switch (row1->cell[clist->sort_column].type)
44 {
45 case GTK_CELL_TEXT:
46 text1 = GTK_CELL_TEXT (row1->cell[clist->sort_column])->text;
47 break;
48 case GTK_CELL_PIXTEXT:
49 text1 = GTK_CELL_PIXTEXT (row1->cell[clist->sort_column])->text;
50 break;
51 default:
52 break;
53 }
54
55 switch (row2->cell[clist->sort_column].type)
56 {
57 case GTK_CELL_TEXT:
58 text2 = GTK_CELL_TEXT (row2->cell[clist->sort_column])->text;
59 break;
60 case GTK_CELL_PIXTEXT:
61 text2 = GTK_CELL_PIXTEXT (row2->cell[clist->sort_column])->text;
62 break;
63 default:
64 break;
65 }
66
67 if (!text2)
68 return (text1 != NULL);
69
70 if (!text1)
71 return -1;
72
73 nd1 = hier_decompress_flagged(text1, &was_packed1);
74 nd2 = hier_decompress_flagged(text2, &was_packed2);
75 rc = sigcmp(nd1, nd2);
76
77 if(was_packed1) free_2(nd1);
78 if(was_packed2) free_2(nd2);
79
80 return (rc);
81 }
82
2683
2784
2885 int searchbox_is_active(void)
635692 GtkCList *cl;
636693 G_CONST_RETURN gchar *entry_text;
637694 char *entry_suffixed;
638 int len;
639695 int i, row;
640696 char *s, *tmp2;
641697 gfloat interval;
698 int depack_cnt = 0;
642699
643700 if(GLOBALS->is_searching_running_search_c_1) return;
644701 GLOBALS->is_searching_running_search_c_1 = ~0;
679736
680737 for(i=0;i<GLOBALS->numfacs;i++)
681738 {
739 int was_packed;
740 char *hfacname = NULL;
741
682742 GLOBALS->pdata->value = i;
683743 if(((int)(GLOBALS->pdata->value/interval))!=((int)(GLOBALS->pdata->oldvalue/interval)))
684744 {
687747 }
688748 GLOBALS->pdata->oldvalue = i;
689749
690 if(wave_regex_match(GLOBALS->facs[i]->name, WAVE_REGEX_SEARCH))
691 if((!GLOBALS->is_ghw)||(strcmp(WAVE_GHW_DUMMYFACNAME, GLOBALS->facs[i]->name)))
750 hfacname = hier_decompress_flagged(GLOBALS->facs[i]->name, &was_packed);
751 depack_cnt += was_packed;
752
753 if(wave_regex_match(hfacname, WAVE_REGEX_SEARCH))
754 if((!GLOBALS->is_ghw)||(strcmp(WAVE_GHW_DUMMYFACNAME, hfacname)))
692755 {
693756 if(!GLOBALS->facs[i]->vec_root)
694757 {
695 row=gtk_clist_append(cl,(gchar **)&(GLOBALS->facs[i]->name));
758 row=gtk_clist_append(cl,(gchar **)&(hfacname));
696759 }
697760 else
698761 {
708771 }
709772 else
710773 {
711 s=(char *)malloc_2(strlen(GLOBALS->facs[i]->name)+4);
774 s=(char *)malloc_2(strlen(hfacname)+4);
712775 strcpy(s,"[] ");
713 strcpy(s+3, GLOBALS->facs[i]->name);
776 strcpy(s+3, hfacname);
714777 }
715778
716779 row=gtk_clist_append(cl,(gchar **)&s);
719782
720783 gtk_clist_set_row_data(cl, row,GLOBALS->facs[i]);
721784 GLOBALS->num_rows_search_c_2++;
722 if(GLOBALS->num_rows_search_c_2==WAVE_MAX_CLIST_LENGTH) break;
785 if(GLOBALS->num_rows_search_c_2==WAVE_MAX_CLIST_LENGTH)
786 {
787 if(was_packed) { free_2(hfacname); }
788 break;
789 }
723790 }
791
792 if(was_packed) { free_2(hfacname); }
793 }
794
795 if(depack_cnt)
796 {
797 gtk_clist_set_compare_func(cl, clist_sigcmp);
798 gtk_clist_sort (cl);
724799 }
725800
726801 gtk_clist_set_column_width(GTK_CLIST(GLOBALS->clist_search_c_3),0,gtk_clist_optimal_column_width(GTK_CLIST(GLOBALS->clist_search_c_3),0));
10301105 }
10311106
10321107 /*
1033 * $Id: search.c,v 1.7 2008/05/08 20:10:04 gtkwave Exp $
1108 * $Id: search.c,v 1.9 2008/07/18 17:27:01 gtkwave Exp $
10341109 * $Log: search.c,v $
1110 * Revision 1.9 2008/07/18 17:27:01 gtkwave
1111 * adding hierpack code
1112 *
1113 * Revision 1.8 2008/06/11 08:01:54 gtkwave
1114 * gcc 4.3.x compiler warning fixes
1115 *
10351116 * Revision 1.7 2008/05/08 20:10:04 gtkwave
10361117 * 2.4 not required for dnd so requirement relaxed
10371118 *
10961177 * initial release
10971178 *
10981179 */
1099
369369
370370 /* printf("drop to %d of %d: '%s'\n", which, GLOBALS->traces.total, t ? t->name : "undef"); */
371371 }
372 bot: 1;
372 bot: return(FALSE);
373373 }
374374
375375 return(FALSE);
751751 t->flags |= TR_HIGHLIGHT;
752752 }
753753 }
754 else
754 else if(!(t->flags & TR_HIGHLIGHT)) /* Ben Sferrazza suggested fix rather than a regular "else" */
755755 {
756756 GLOBALS->starting_unshifted_trace = t;
757757
11761176 }
11771177
11781178
1179 /*
11791180 static gint popup_event (GtkWidget *widget)
11801181 {
11811182 do_popup_menu(widget, NULL);
11821183 return(TRUE);
11831184 }
1185 */
11841186
11851187 /*** gtkwave click routines turned on with "use_standard_clicking"=0 ***/
11861188 /**************************************************************************/
13021304 {
13031305 gint rc;
13041306 gint page_num = gtk_notebook_get_current_page(GTK_NOTEBOOK(GLOBALS->notebook));
1305 struct Global *g_old = GLOBALS;
1307 /* struct Global *g_old = GLOBALS; */
13061308
13071309 set_GLOBALS((*GLOBALS->contexts)[page_num]);
13081310
14911493
14921494
14931495 /*
1494 * $Id: signalwindow.c,v 1.30 2008/03/26 01:23:52 gtkwave Exp $
1496 * $Id: signalwindow.c,v 1.33 2008/08/18 16:10:54 gtkwave Exp $
14951497 * $Log: signalwindow.c,v $
1498 * Revision 1.33 2008/08/18 16:10:54 gtkwave
1499 * adding sticky click semantics on already selected entries
1500 *
1501 * Revision 1.32 2008/07/01 18:51:07 gtkwave
1502 * compiler warning fixes for amd64
1503 *
1504 * Revision 1.31 2008/06/11 08:01:55 gtkwave
1505 * gcc 4.3.x compiler warning fixes
1506 *
14961507 * Revision 1.30 2008/03/26 01:23:52 gtkwave
14971508 * reduce drag and drop visual noise
14981509 *
13421342 basetime=GLOBALS->named_markers[GLOBALS->mark_idx_start-1];
13431343 else
13441344 {
1345 status_text(item_mark_start_strings[GLOBALS->mark_idx_start].str);
1345 status_text(item_mark_start_strings[(unsigned int)GLOBALS->mark_idx_start].str);
13461346 status_text(" not in use.\n");
13471347 }
13481348 }
13531353 endtime=GLOBALS->named_markers[GLOBALS->mark_idx_end-1];
13541354 else
13551355 {
1356 status_text(item_mark_end_strings[GLOBALS->mark_idx_end].str);
1356 status_text(item_mark_end_strings[(unsigned int)GLOBALS->mark_idx_end].str);
13571357 status_text(" not in use.\n");
13581358 }
13591359 }
16381638 }
16391639
16401640 /*
1641 * $Id: strace.c,v 1.7 2007/12/31 17:11:58 gtkwave Exp $
1641 * $Id: strace.c,v 1.8 2008/07/01 18:51:07 gtkwave Exp $
16421642 * $Log: strace.c,v $
1643 * Revision 1.8 2008/07/01 18:51:07 gtkwave
1644 * compiler warning fixes for amd64
1645 *
16431646 * Revision 1.7 2007/12/31 17:11:58 gtkwave
16441647 * fixed backward seek bug in pattern/edge search
16451648 *
1818 #include "lx2.h"
1919 #include "busy.h"
2020 #include "debug.h"
21
2122
2223 enum { VIEW_DRAG_INACTIVE, TREE_TO_VIEW_DRAG_ACTIVE, SEARCH_TO_VIEW_DRAG_ACTIVE };
2324
10031004 }
10041005 }
10051006
1006
1007 /**********************************************************************/
1008
1009 /* view_selection_func is commented out for now... */
1010
1011 static gboolean
1012 view_selection_func (GtkTreeSelection *selection,
1013 GtkTreeModel *model,
1014 GtkTreePath *path,
1015 gboolean path_currently_selected,
1016 gpointer userdata)
1017 {
1018 /*
1019 GtkTreeIter iter;
1020
1021 if (gtk_tree_model_get_iter(model, &iter, path))
1022 {
1023 gchar *name;
1024
1025 gtk_tree_model_get(model, &iter, 0, &name, -1);
1026
1027 if (!path_currently_selected)
1028 {
1029 g_print ("%s is going to be selected.\n", name);
1030 }
1031 else
1032 {
1033 g_print ("%s is going to be unselected.\n", name);
1034 }
1035
1036 g_free(name);
1037 }
1038 */
1039 return TRUE; /* allow selection state to change */
1040 }
1041
1042 /**********************************************************************/
10071043
10081044 /*
10091045 * mainline..
11281164 /* Setup the selection handler */
11291165 GLOBALS->sig_selection_treesearch_gtk2_c_1 = gtk_tree_view_get_selection (GTK_TREE_VIEW (sig_view));
11301166 gtk_tree_selection_set_mode (GLOBALS->sig_selection_treesearch_gtk2_c_1, GTK_SELECTION_MULTIPLE);
1167 /* gtk_tree_selection_set_select_function (GLOBALS->sig_selection_treesearch_gtk2_c_1,
1168 view_selection_func, NULL, NULL); */
11311169 }
11321170
11331171 GLOBALS->dnd_sigview = sig_view;
13611399 /* Setup the selection handler */
13621400 GLOBALS->sig_selection_treesearch_gtk2_c_1 = gtk_tree_view_get_selection (GTK_TREE_VIEW (sig_view));
13631401 gtk_tree_selection_set_mode (GLOBALS->sig_selection_treesearch_gtk2_c_1, GTK_SELECTION_MULTIPLE);
1402 /* gtk_tree_selection_set_select_function (GLOBALS->sig_selection_treesearch_gtk2_c_1,
1403 view_selection_func, NULL, NULL); */
13641404 }
13651405
13661406 GLOBALS->dnd_sigview = sig_view;
18511891 }
18521892
18531893 /*
1854 * $Id: treesearch_gtk2.c,v 1.15 2008/05/11 03:05:25 gtkwave Exp $
1894 * $Id: treesearch_gtk2.c,v 1.16 2008/08/18 16:10:54 gtkwave Exp $
18551895 * $Log: treesearch_gtk2.c,v $
1896 * Revision 1.16 2008/08/18 16:10:54 gtkwave
1897 * adding sticky click semantics on already selected entries
1898 *
18561899 * Revision 1.15 2008/05/11 03:05:25 gtkwave
18571900 * add gating flag on dnd data request so moving in/out of search window
18581901 * doesn't cause spurious insert ops into the signal/wavewindow
3737 #include <config.h>
3838 #include "globals.h"
3939 #include "vcd.h"
40 #include "hierpack.h"
4041
4142 #undef VCD_BSEARCH_IS_PERFECT /* bsearch is imperfect under linux, but OK under AIX */
4243
335336 return((int)(*(GLOBALS->vst_vcd_c_1++)));
336337 }
337338
338 static char getch() {
339 static signed char getch() {
339340 return ((GLOBALS->vst_vcd_c_1!=GLOBALS->vend_vcd_c_1)?((int)(*(GLOBALS->vst_vcd_c_1++))):(getch_fetch()));
340341 }
341342
13861387 else
13871388 if((v->msi>v->lsi)&&((v->msi-v->lsi+1)!=v->size))
13881389 {
1389 if((v->vartype!=V_EVENT)&&(v->vartype!=V_PARAMETER)) goto err;
1390 v->size=v->msi-v->lsi+1;
1390 if((v->vartype!=V_EVENT)&&(v->vartype!=V_PARAMETER))
1391 {
1392 v->msi = v->size-1; v->lsi = 0;
1393 /* all this formerly was goto err; */
1394 }
1395 else
1396 {
1397 v->size=v->msi-v->lsi+1;
1398 }
13911399 }
13921400 else
13931401 if((v->lsi>=v->msi)&&((v->lsi-v->msi+1)!=v->size))
13941402 {
1395 if((v->vartype!=V_EVENT)&&(v->vartype!=V_PARAMETER)) goto err;
1396 v->size=v->msi-v->lsi+1;
1403 if((v->vartype!=V_EVENT)&&(v->vartype!=V_PARAMETER))
1404 {
1405 v->lsi = v->size-1; v->msi = 0;
1406 /* all this formerly was goto err; */
1407 }
1408 else
1409 {
1410 v->size=v->lsi-v->msi+1;
1411 }
13971412 }
13981413
13991414 /* initial conditions */
21642179 void vcd_sortfacs(void)
21652180 {
21662181 int i;
2182 JRB ptr, lst;
2183
2184 GLOBALS->pfx_hier_array = calloc_2(GLOBALS->hier_pfx_cnt ? GLOBALS->hier_pfx_cnt : 1, sizeof(char *));
2185 lst = GLOBALS->hier_pfx;
2186 if(lst)
2187 {
2188 jrb_traverse(ptr, lst)
2189 {
2190 GLOBALS->pfx_hier_array[ptr->val.ui] = ptr->key.s;
2191 }
2192 }
21672193
21682194 GLOBALS->facs=(struct symbol **)malloc_2(GLOBALS->numfacs*sizeof(struct symbol *));
21692195 GLOBALS->curnode=GLOBALS->firstnode;
22062232 init_tree();
22072233 for(i=0;i<GLOBALS->numfacs;i++)
22082234 {
2209 build_tree_from_name(GLOBALS->facs[i]->name, i);
2235 char *n = GLOBALS->facs[i]->name;
2236 int was_packed;
2237 char *recon = hier_decompress_flagged(n, &was_packed);
2238
2239 if(was_packed)
2240 {
2241 build_tree_from_name(recon, i);
2242 free_2(recon);
2243 }
2244 else
2245 {
2246 build_tree_from_name(n, i);
2247 }
22102248
22112249 if(GLOBALS->escaped_names_found_vcd_c_1)
22122250 {
24222460 /*******************************************************************************/
24232461
24242462 /*
2425 * $Id: vcd.c,v 1.4 2008/01/22 20:11:47 gtkwave Exp $
2463 * $Id: vcd.c,v 1.9 2008/07/20 01:29:36 gtkwave Exp $
24262464 * $Log: vcd.c,v $
2465 * Revision 1.9 2008/07/20 01:29:36 gtkwave
2466 * added command line option --comphier
2467 *
2468 * Revision 1.8 2008/07/18 18:46:11 gtkwave
2469 * bitblasted vector relinking fix, disable hier pack in legacy+partial vcdload
2470 *
2471 * Revision 1.7 2008/07/18 18:22:58 gtkwave
2472 * fixes for aix
2473 *
2474 * Revision 1.6 2008/07/18 17:27:01 gtkwave
2475 * adding hierpack code
2476 *
2477 * Revision 1.5 2008/07/12 22:54:12 gtkwave
2478 * array of wires malformed vcd dump load abort fixed
2479 *
24272480 * Revision 1.4 2008/01/22 20:11:47 gtkwave
24282481 * track and hold experimentation
24292482 *
3232 #include "wavealloca.h"
3333 #include "debug.h"
3434 #include "tree.h"
35 #include "jrb.h"
3536
3637 #define VCD_SIZE_WARN (256) /* number of MB size where converter warning message appears */
3738 #define VCD_BSIZ 32768 /* size of getch() emulation buffer--this val should be ok */
127128 #endif
128129
129130 /*
130 * $Id: vcd.h,v 1.2 2007/08/26 21:35:46 gtkwave Exp $
131 * $Id: vcd.h,v 1.3 2008/07/18 17:27:01 gtkwave Exp $
131132 * $Log: vcd.h,v $
133 * Revision 1.3 2008/07/18 17:27:01 gtkwave
134 * adding hierpack code
135 *
132136 * Revision 1.2 2007/08/26 21:35:46 gtkwave
133137 * integrated global context management from SystemOfCode2007 branch
134138 *
3232 #include <config.h>
3333 #include "globals.h"
3434 #include "vcd.h"
35 #include "hierpack.h"
3536
3637 #if !defined _MSC_VER && !defined __MINGW32__
3738 #include <sys/time.h>
339340 return((int)(*(GLOBALS->vst_vcd_partial_c_2++)));
340341 }
341342
342 static char getch() {
343 static signed char getch() {
343344 return ((GLOBALS->vst_vcd_partial_c_2!=GLOBALS->vend_vcd_partial_c_2)?((int)(*(GLOBALS->vst_vcd_partial_c_2++))):(getch_fetch()));
344345 }
345346
13801381 else
13811382 if((v->msi>v->lsi)&&((v->msi-v->lsi+1)!=v->size))
13821383 {
1383 if((v->vartype!=V_EVENT)&&(v->vartype!=V_PARAMETER)) goto err;
1384 v->size=v->msi-v->lsi+1;
1384 if((v->vartype!=V_EVENT)&&(v->vartype!=V_PARAMETER))
1385 {
1386 v->msi = v->size-1; v->lsi = 0;
1387 /* all this formerly was goto err; */
1388 }
1389 else
1390 {
1391 v->size=v->msi-v->lsi+1;
1392 }
13851393 }
13861394 else
13871395 if((v->lsi>=v->msi)&&((v->lsi-v->msi+1)!=v->size))
13881396 {
1389 if((v->vartype!=V_EVENT)&&(v->vartype!=V_PARAMETER)) goto err;
1390 v->size=v->msi-v->lsi+1;
1397 if((v->vartype!=V_EVENT)&&(v->vartype!=V_PARAMETER))
1398 {
1399 v->lsi = v->size-1; v->msi = 0;
1400 /* all this formerly was goto err; */
1401 }
1402 else
1403 {
1404 v->size=v->lsi-v->msi+1;
1405 }
13911406 }
13921407
13931408 /* initial conditions */
23642379 }
23652380
23662381 /*
2367 * $Id: vcd_partial.c,v 1.3 2007/09/11 02:12:50 gtkwave Exp $
2382 * $Id: vcd_partial.c,v 1.7 2008/07/18 18:46:11 gtkwave Exp $
23682383 * $Log: vcd_partial.c,v $
2384 * Revision 1.7 2008/07/18 18:46:11 gtkwave
2385 * bitblasted vector relinking fix, disable hier pack in legacy+partial vcdload
2386 *
2387 * Revision 1.6 2008/07/18 18:23:06 gtkwave
2388 * fixes for aix
2389 *
2390 * Revision 1.5 2008/07/18 17:27:01 gtkwave
2391 * adding hierpack code
2392 *
2393 * Revision 1.4 2008/07/12 22:54:12 gtkwave
2394 * array of wires malformed vcd dump load abort fixed
2395 *
23692396 * Revision 1.3 2007/09/11 02:12:50 gtkwave
23702397 * context locking in busy spinloops (gtk_main_iteration() calls)
23712398 *
3535 #include "vcd.h"
3636 #include "vlist.h"
3737 #include "lx2.h"
38 #include "hierpack.h"
3839
3940 /**/
4041
518519 return((int)(*(GLOBALS->vst_vcd_recoder_c_3++)));
519520 }
520521
521 static char getch() {
522 static signed char getch() {
522523 return ((GLOBALS->vst_vcd_recoder_c_3!=GLOBALS->vend_vcd_recoder_c_3)?((int)(*(GLOBALS->vst_vcd_recoder_c_3++))):(getch_fetch()));
523524 }
524525
12471248
12481249 if(GLOBALS->pv_vcd_recoder_c_3)
12491250 {
1250 if(!strcmp(GLOBALS->pv_vcd_recoder_c_3->name,v->name))
1251 if(!strcmp(GLOBALS->prev_hier_uncompressed_name,v->name))
12511252 {
12521253 GLOBALS->pv_vcd_recoder_c_3->chain=v;
12531254 v->root=GLOBALS->rootv_vcd_recoder_c_3;
12571258 {
12581259 GLOBALS->rootv_vcd_recoder_c_3=v;
12591260 }
1261
1262 free_2(GLOBALS->prev_hier_uncompressed_name);
12601263 }
12611264 else
12621265 {
12631266 GLOBALS->rootv_vcd_recoder_c_3=v;
12641267 }
1268
12651269 GLOBALS->pv_vcd_recoder_c_3=v;
1270 GLOBALS->prev_hier_uncompressed_name;
12661271 }
12671272 else /* regular vcd var, not an evcd port var */
12681273 {
13261331
13271332 if(GLOBALS->pv_vcd_recoder_c_3)
13281333 {
1329 if(!strcmp(GLOBALS->pv_vcd_recoder_c_3->name,v->name))
1334 if(!strcmp(GLOBALS->prev_hier_uncompressed_name,v->name))
13301335 {
13311336 GLOBALS->pv_vcd_recoder_c_3->chain=v;
13321337 v->root=GLOBALS->rootv_vcd_recoder_c_3;
13361341 {
13371342 GLOBALS->rootv_vcd_recoder_c_3=v;
13381343 }
1344
1345 free_2(GLOBALS->prev_hier_uncompressed_name);
13391346 }
13401347 else
13411348 {
13421349 GLOBALS->rootv_vcd_recoder_c_3=v;
13431350 }
13441351 GLOBALS->pv_vcd_recoder_c_3=v;
1345
1352 GLOBALS->prev_hier_uncompressed_name = strdup_2(v->name);
1353
13461354 vtok=get_vartoken(1);
13471355 if(vtok==V_END) goto dumpv;
13481356 if(vtok!=V_LB) goto err;
13891397 else
13901398 if((v->msi>v->lsi)&&((v->msi-v->lsi+1)!=v->size))
13911399 {
1392 if((v->vartype!=V_EVENT)&&(v->vartype!=V_PARAMETER)) goto err;
1393 v->size=v->msi-v->lsi+1;
1400 if((v->vartype!=V_EVENT)&&(v->vartype!=V_PARAMETER))
1401 {
1402 v->msi = v->size-1; v->lsi = 0;
1403 /* all this formerly was goto err; */
1404 }
1405 else
1406 {
1407 v->size=v->msi-v->lsi+1;
1408 }
13941409 }
13951410 else
13961411 if((v->lsi>=v->msi)&&((v->lsi-v->msi+1)!=v->size))
13971412 {
1398 if((v->vartype!=V_EVENT)&&(v->vartype!=V_PARAMETER)) goto err;
1399 v->size=v->msi-v->lsi+1;
1413 if((v->vartype!=V_EVENT)&&(v->vartype!=V_PARAMETER))
1414 {
1415 v->lsi = v->size-1; v->msi = 0;
1416 /* all this formerly was goto err; */
1417 }
1418 else
1419 {
1420 v->size=v->lsi-v->msi+1;
1421 }
14001422 }
14011423
14021424 /* initial conditions */
14631485 fprintf(stderr, "Near byte %d, $VAR parse error encountered\n", (int)(GLOBALS->vcdbyteno_vcd_recoder_c_3+(GLOBALS->vst_vcd_recoder_c_3-GLOBALS->vcdbuf_vcd_recoder_c_3)));
14641486 }
14651487 if(v->id) free_2(v->id);
1466 free_2(v);
1488 free_2(v); v=NULL;
14671489 GLOBALS->pv_vcd_recoder_c_3 = NULL;
14681490 }
14691491
14701492 bail:
1493 if((v) && (GLOBALS->do_hier_compress))
1494 {
1495 char *old_name = v->name;
1496 int was_packed;
1497 v->name = hier_compress(v->name, HIERPACK_ADD, &was_packed);
1498 if(was_packed) free_2(old_name);
1499 }
1500
14711501 if(vtok!=V_END) sync_end(NULL);
14721502 break;
14731503 }
15751605 {
15761606 GLOBALS->blackout_regions->bend = GLOBALS->current_time_vcd_recoder_c_3;
15771607 }
1608
1609 GLOBALS->pv_vcd_recoder_c_3 = NULL;
1610 if(GLOBALS->prev_hier_uncompressed_name) { free_2(GLOBALS->prev_hier_uncompressed_name); GLOBALS->prev_hier_uncompressed_name = NULL; }
1611
15781612 return;
15791613 default:
15801614 DEBUG(fprintf(stderr,"UNKNOWN TOKEN\n"));
22942328 unsigned int accum;
22952329 unsigned char ch;
22962330 double *d;
2297 unsigned char *depacked;
2331 unsigned char *depacked = NULL;
22982332
22992333 if(!v) return;
23002334 vlist_uncompress(&v);
23012335
23022336 if(GLOBALS->vlist_prepack)
23032337 {
2304 depacked = vlist_packer_decompress(v, &list_size);
2338 depacked = vlist_packer_decompress(v, (unsigned int *)&list_size);
23052339 vlist_destroy(v);
23062340 }
23072341 else
24062440 time_idx += delta;
24072441
24082442 curtime_pnt = vlist_locate(GLOBALS->time_vlist_vcd_recoder_c_1, time_idx ? time_idx-1 : 0);
2443 if(!curtime_pnt)
2444 {
2445 fprintf(stderr, "GTKWAVE | malformed bitwise signal data for '%s' after time_idx = %d\n",
2446 np->nname, time_idx - delta);
2447 exit(255);
2448 }
24092449
24102450 if(vartype != V_EVENT)
24112451 {
24592499 time_idx += delta;
24602500
24612501 curtime_pnt = vlist_locate(GLOBALS->time_vlist_vcd_recoder_c_1, time_idx ? time_idx-1 : 0);
2502 if(!curtime_pnt)
2503 {
2504 fprintf(stderr, "GTKWAVE | malformed 'b' signal data for '%s' after time_idx = %d\n",
2505 np->nname, time_idx - delta);
2506 exit(255);
2507 }
24622508
24632509 dst_len = 0;
24642510 for(;;)
25402586 time_idx += delta;
25412587
25422588 curtime_pnt = vlist_locate(GLOBALS->time_vlist_vcd_recoder_c_1, time_idx ? time_idx-1 : 0);
2589 if(!curtime_pnt)
2590 {
2591 fprintf(stderr, "GTKWAVE | malformed 'r' signal data for '%s' after time_idx = %d\n",
2592 np->nname, time_idx - delta);
2593 exit(255);
2594 }
25432595
25442596 dst_len = 0;
25452597 do
25952647 time_idx += delta;
25962648
25972649 curtime_pnt = vlist_locate(GLOBALS->time_vlist_vcd_recoder_c_1, time_idx ? time_idx-1 : 0);
2650 if(!curtime_pnt)
2651 {
2652 fprintf(stderr, "GTKWAVE | malformed 's' signal data for '%s' after time_idx = %d\n",
2653 np->nname, time_idx - delta);
2654 exit(255);
2655 }
25982656
25992657 dst_len = 0;
26002658 do
26302688
26312689 if(GLOBALS->vlist_prepack)
26322690 {
2633 vlist_packer_decompress_destroy(depacked);
2691 vlist_packer_decompress_destroy((char *)depacked);
26342692 }
26352693 else
26362694 {
26492707
26502708 if(GLOBALS->vlist_prepack)
26512709 {
2652 vlist_packer_decompress_destroy(depacked);
2710 vlist_packer_decompress_destroy((char *)depacked);
26532711 }
26542712 else
26552713 {
26592717 }
26602718
26612719 /*
2662 * $Id: vcd_recoder.c,v 1.8 2007/12/24 19:56:03 gtkwave Exp $
2720 * $Id: vcd_recoder.c,v 1.14 2008/07/18 18:46:11 gtkwave Exp $
26632721 * $Log: vcd_recoder.c,v $
2722 * Revision 1.14 2008/07/18 18:46:11 gtkwave
2723 * bitblasted vector relinking fix, disable hier pack in legacy+partial vcdload
2724 *
2725 * Revision 1.13 2008/07/18 18:23:07 gtkwave
2726 * fixes for aix
2727 *
2728 * Revision 1.12 2008/07/18 17:27:01 gtkwave
2729 * adding hierpack code
2730 *
2731 * Revision 1.11 2008/07/12 22:54:12 gtkwave
2732 * array of wires malformed vcd dump load abort fixed
2733 *
2734 * Revision 1.10 2008/07/11 07:02:54 gtkwave
2735 * recoder fix for malformed files
2736 *
2737 * Revision 1.9 2008/06/11 08:01:55 gtkwave
2738 * gcc 4.3.x compiler warning fixes
2739 *
26642740 * Revision 1.8 2007/12/24 19:56:03 gtkwave
26652741 * preparing for 3.1.2 version bump
26662742 *
1111 #include "vcd_saver.h"
1212 #include "helpers/lxt_write.h"
1313 #include "ghw.h"
14 #include "hierpack.h"
1415 #include <time.h>
1516
1617
459460
460461 for(i=0;i<nodecnt;i++)
461462 {
462 char *netname = lxt ? GLOBALS->hp_vcd_saver_c_1[i]->item->nname : output_hier(GLOBALS->hp_vcd_saver_c_1[i]->item->nname);
463 int was_packed = 0;
464 char *hname = hier_decompress_flagged(GLOBALS->hp_vcd_saver_c_1[i]->item->nname, &was_packed);
465 char *netname = lxt ? hname : output_hier(hname);
463466
464467 if(GLOBALS->hp_vcd_saver_c_1[i]->flags & (HIST_REAL|HIST_STRING))
465468 {
514517 }
515518 }
516519
520 if(was_packed)
521 {
522 free_2(hname);
523 }
517524 }
518525
519526 row_data = malloc_2(max_len + 1);
847854 }
848855
849856 /*
850 * $Id: vcd_saver.c,v 1.2 2007/08/26 21:35:46 gtkwave Exp $
857 * $Id: vcd_saver.c,v 1.3 2008/07/18 17:27:01 gtkwave Exp $
851858 * $Log: vcd_saver.c,v $
859 * Revision 1.3 2008/07/18 17:27:01 gtkwave
860 * adding hierpack code
861 *
852862 * Revision 1.2 2007/08/26 21:35:46 gtkwave
853863 * integrated global context management from SystemOfCode2007 branch
854864 *
143143 exit(255);
144144 }
145145
146 /* args are reversed to fread (compared to above) to handle short read at end of file! */
147 /* (this can happen because of how we write out only the used size of a block) */
146148 vrebuild = malloc_2(sizeof(struct vlist_t) + vhdr.siz);
147149 memcpy(vrebuild, &vhdr, sizeof(struct vlist_t));
148 fread(vrebuild+1, vrebuild->siz, 1, GLOBALS->vlist_handle);
150 rc = fread(vrebuild+1, 1, vrebuild->siz, GLOBALS->vlist_handle);
151 if(!rc)
152 {
153 printf("Error in reading from VList spill file!\n");
154 exit(255);
155 }
149156
150157 if(vprev)
151158 {
766773
767774
768775 /*
769 * $Id: vlist.c,v 1.10 2007/12/24 19:56:03 gtkwave Exp $
776 * $Id: vlist.c,v 1.12 2008/07/13 00:15:41 gtkwave Exp $
770777 * $Log: vlist.c,v $
778 * Revision 1.12 2008/07/13 00:15:41 gtkwave
779 * fix for short reads when --giga option is enabled
780 *
781 * Revision 1.11 2008/06/11 08:01:57 gtkwave
782 * gcc 4.3.x compiler warning fixes
783 *
771784 * Revision 1.10 2007/12/24 19:56:03 gtkwave
772785 * preparing for 3.1.2 version bump
773786 *
00 /*
1 * Copyright (c) Tony Bybell 2003-2006.
1 * Copyright (c) Tony Bybell 2003-2008.
22 *
33 * This program is free software; you can redistribute it and/or
44 * modify it under the terms of the GNU General Public License
2626 #include "vzt_read.h"
2727 #include "debug.h"
2828 #include "busy.h"
29
29 #include "hierpack.h"
3030
3131 /*
3232 * mainline
4040 unsigned int numalias = 0;
4141 struct symbol *sym_block = NULL;
4242 struct Node *node_block = NULL;
43 JRB ptr, lst;
4344
4445 GLOBALS->vzt_vzt_c_1 = vzt_rd_init_smp(fname, GLOBALS->num_cpus);
4546 if(!GLOBALS->vzt_vzt_c_1)
8687 if(GLOBALS->numfacs)
8788 {
8889 char *fnam = vzt_rd_get_facname(GLOBALS->vzt_vzt_c_1, 0);
89 int flen = strlen(fnam);
90
91 GLOBALS->mvlfacs_vzt_c_3[0].name=malloc_2(flen+1);
92 strcpy(GLOBALS->mvlfacs_vzt_c_3[0].name, fnam);
90 char *pnt;
91 int was_packed = 0;
92
93 if(GLOBALS->do_hier_compress)
94 {
95 pnt = hier_compress(fnam, HIERPACK_ADD, &was_packed);
96 }
97
98 if(was_packed)
99 {
100 GLOBALS->mvlfacs_vzt_c_3[0].name = pnt;
101 }
102 else
103 {
104 int flen = strlen(fnam);
105 GLOBALS->mvlfacs_vzt_c_3[0].name=malloc_2(flen+1);
106 strcpy(GLOBALS->mvlfacs_vzt_c_3[0].name, fnam);
107 }
93108 }
94109
95110 for(i=0;i<GLOBALS->numfacs;i++)
101116 if(i!=(GLOBALS->numfacs-1))
102117 {
103118 char *fnam = vzt_rd_get_facname(GLOBALS->vzt_vzt_c_1, i+1);
104 int flen = strlen(fnam);
105
106 GLOBALS->mvlfacs_vzt_c_3[i+1].name=malloc_2(flen+1);
107 strcpy(GLOBALS->mvlfacs_vzt_c_3[i+1].name, fnam);
119 char *pnt;
120 int was_packed = 0;
121
122 if(GLOBALS->do_hier_compress)
123 {
124 pnt = hier_compress(fnam, HIERPACK_ADD, &was_packed);
125 }
126
127 if(was_packed)
128 {
129 GLOBALS->mvlfacs_vzt_c_3[i+1].name = pnt;
130 }
131 else
132 {
133 int flen = strlen(fnam);
134 GLOBALS->mvlfacs_vzt_c_3[i+1].name=malloc_2(flen+1);
135 strcpy(GLOBALS->mvlfacs_vzt_c_3[i+1].name, fnam);
136 }
108137 }
109138
110139 if(i>1)
243272 /* SPLASH */ splash_sync(2, 5);
244273 GLOBALS->facs=(struct symbol **)malloc_2(GLOBALS->numfacs*sizeof(struct symbol *));
245274
246 if(GLOBALS->fast_tree_sort)
275 GLOBALS->pfx_hier_array = calloc_2(GLOBALS->hier_pfx_cnt ? GLOBALS->hier_pfx_cnt : 1, sizeof(char *));
276
277 lst = GLOBALS->hier_pfx;
278 if(lst)
279 {
280 jrb_traverse(ptr, lst)
281 {
282 GLOBALS->pfx_hier_array[ptr->val.ui] = ptr->key.s;
283 }
284 }
285
286 if((GLOBALS->fast_tree_sort) && (!GLOBALS->do_hier_compress))
247287 {
248288 GLOBALS->curnode=GLOBALS->firstnode;
249289 for(i=0;i<GLOBALS->numfacs;i++)
300340 init_tree();
301341 for(i=0;i<GLOBALS->numfacs;i++)
302342 {
303 build_tree_from_name(GLOBALS->facs[i]->name, i);
343 build_tree_from_name(GLOBALS->facs[i]->name, i);
304344 }
305345 /* SPLASH */ splash_sync(4, 5);
306346 treegraft(GLOBALS->treeroot);
354394 init_tree();
355395 for(i=0;i<GLOBALS->numfacs;i++)
356396 {
357 build_tree_from_name(GLOBALS->facs[i]->name, i);
397 char *n = GLOBALS->facs[i]->name;
398 int was_packed;
399 char *recon = hier_decompress_flagged(n, &was_packed);
400
401 if(was_packed)
402 {
403 build_tree_from_name(recon, i);
404 free_2(recon);
405 }
406 else
407 {
408 build_tree_from_name(n, i);
409 }
358410 }
359411 /* SPLASH */ splash_sync(5, 5);
360412 treegraft(GLOBALS->treeroot);
361413 treesort(GLOBALS->treeroot, NULL);
414 }
415
416 if(GLOBALS->prev_hier_uncompressed_name)
417 {
418 free_2(GLOBALS->prev_hier_uncompressed_name);
419 GLOBALS->prev_hier_uncompressed_name = NULL;
362420 }
363421
364422 GLOBALS->min_time = GLOBALS->first_cycle_vzt_c_3; GLOBALS->max_time=GLOBALS->last_cycle_vzt_c_3;
572630 if(f->flags&VZT_RD_SYM_F_STRING) np->head.flags |= HIST_STRING;
573631 }
574632
633 {
634 struct HistEnt *htemp2 = calloc_2(1, sizeof(struct HistEnt));
635 htemp2->time = -1;
636 if(len>1)
637 {
638 htemp2->v.h_vector = htemp->v.h_vector;
639 }
640 else
641 {
642 htemp2->v.h_val = htemp->v.h_val;
643 }
644 htemp2->next = htemp;
645 htemp = htemp2;
646 GLOBALS->vzt_table_vzt_c_1[txidx].numtrans++;
647 }
648
575649 np->head.time = -2;
576650 np->head.next = htemp;
577651 np->numhist=GLOBALS->vzt_table_vzt_c_1[txidx].numtrans +2 /*endcap*/ +1 /*frontcap*/;
698772 if(f->flags&VZT_RD_SYM_F_STRING) np->head.flags |= HIST_STRING;
699773 }
700774
775 {
776 struct HistEnt *htemp2 = calloc_2(1, sizeof(struct HistEnt));
777 htemp2->time = -1;
778 if(len>1)
779 {
780 htemp2->v.h_vector = htemp->v.h_vector;
781 }
782 else
783 {
784 htemp2->v.h_val = htemp->v.h_val;
785 }
786 htemp2->next = htemp;
787 htemp = htemp2;
788 GLOBALS->vzt_table_vzt_c_1[txidx].numtrans++;
789 }
790
701791 np->head.time = -2;
702792 np->head.next = htemp;
703793 np->numhist=GLOBALS->vzt_table_vzt_c_1[txidx].numtrans +2 /*endcap*/ +1 /*frontcap*/;
712802 }
713803
714804 /*
715 * $Id: vzt.c,v 1.2 2007/08/26 21:35:46 gtkwave Exp $
805 * $Id: vzt.c,v 1.4 2008/07/20 20:48:08 gtkwave Exp $
716806 * $Log: vzt.c,v $
807 * Revision 1.4 2008/07/20 20:48:08 gtkwave
808 * compressed hierarchy support
809 *
810 * Revision 1.3 2008/06/15 21:26:45 gtkwave
811 * time -1 endcap add for LXT2 + VZT loaders
812 *
717813 * Revision 1.2 2007/08/26 21:35:46 gtkwave
718814 * integrated global context management from SystemOfCode2007 branch
719815 *
12371237 {
12381238 gint rc;
12391239 gint page_num = gtk_notebook_get_current_page(GTK_NOTEBOOK(GLOBALS->notebook));
1240 struct Global *g_old = GLOBALS;
1240 /* struct Global *g_old = GLOBALS; */
12411241
12421242 set_GLOBALS((*GLOBALS->contexts)[page_num]);
12431243
31143114 GdkGC *cinf = GLOBALS->gc_w_wavewindow_c_1;
31153115 GdkGC *cfixed;
31163116 double mynan = strtod("NaN", NULL);
3117 double tmin = mynan, tmax = mynan, tv, tv2;
3117 double tmin = mynan, tmax = mynan, tv=0.0, tv2;
31183118 gint rmargin;
31193119 int is_nan = 0, is_nan2 = 0, is_inf = 0, is_inf2 = 0;
31203120 int any_infs = 0, any_infp = 0, any_infm = 0;
37513751 }
37523752
37533753 /*
3754 * $Id: wavewindow.c,v 1.34 2008/04/03 16:56:11 gtkwave Exp $
3754 * $Id: wavewindow.c,v 1.36 2008/07/01 18:51:07 gtkwave Exp $
37553755 * $Log: wavewindow.c,v $
3756 * Revision 1.36 2008/07/01 18:51:07 gtkwave
3757 * compiler warning fixes for amd64
3758 *
3759 * Revision 1.35 2008/06/11 08:01:57 gtkwave
3760 * gcc 4.3.x compiler warning fixes
3761 *
37563762 * Revision 1.34 2008/04/03 16:56:11 gtkwave
37573763 * more time_trunc() removals
37583764 *
2424
2525 pageinc=(gfloat)(((gdouble)GLOBALS->wavewidth)*GLOBALS->nspx);
2626 hadj->page_size=hadj->page_increment=(pageinc>=1.0)?pageinc:1.0;
27 hadj->step_increment=(GLOBALS->nspx>=1.0)?GLOBALS->nspx:1.0;
27
28 /* hadj->step_increment=(GLOBALS->nspx>=1.0)?GLOBALS->nspx:1.0; */
29
30 hadj->step_increment = pageinc / 10.0;
31 if(hadj->step_increment < 1.0) hadj->step_increment = 1.0;
2832
2933 if(hadj->page_size >= (hadj->upper-hadj->lower)) hadj->value=hadj->lower;
3034 if(hadj->value+hadj->page_size>hadj->upper)
470474 }
471475
472476 /*
473 * $Id: zoombuttons.c,v 1.4 2007/09/12 19:24:45 gtkwave Exp $
477 * $Id: zoombuttons.c,v 1.5 2008/08/05 20:14:26 gtkwave Exp $
474478 * $Log: zoombuttons.c,v $
479 * Revision 1.5 2008/08/05 20:14:26 gtkwave
480 * make step_increment equal to 1/10 of the page inc rather than pixel level
481 *
475482 * Revision 1.4 2007/09/12 19:24:45 gtkwave
476483 * more ctx_swap_watchdog updates
477484 *