Import upstream version 3.3.108
Debian Janitor
3 years ago
0 | GTKWave Wave Viewer is Copyright (C) 1999-2020 Tony Bybell. | |
1 | Windows compatibility and PS/MIF routines are Copyright (C) 1999-2020 Udi Finkelstein. | |
2 | Context support is Copyright (C) 2007-2020 Kermin Elliott Fleming. | |
3 | Trace group support is Copyright (C) 2009-2020 Donald Baltus. | |
4 | GHW and additional GUI support is Copyright (C) 2005-2020 Tristan Gingold. | |
5 | Analog support is Copyright (C) 2005-2020 Thomas Sailer. | |
6 | External DnD support is Copyright (C) 2008-2020 Concept Engineering GmbH. | |
7 | FastLZ is Copyright (C) 2005-2020 Ariya Hidayat. | |
0 | GTKWave Wave Viewer is Copyright (C) 1999-2021 Tony Bybell. | |
1 | Windows compatibility and PS/MIF routines are Copyright (C) 1999-2021 Udi Finkelstein. | |
2 | Context support is Copyright (C) 2007-2021 Kermin Elliott Fleming. | |
3 | Trace group support is Copyright (C) 2009-2021 Donald Baltus. | |
4 | GHW and additional GUI support is Copyright (C) 2005-2021 Tristan Gingold. | |
5 | Analog support is Copyright (C) 2005-2021 Thomas Sailer. | |
6 | External DnD support is Copyright (C) 2008-2021 Concept Engineering GmbH. | |
7 | FastLZ is Copyright (C) 2005-2021 Ariya Hidayat. | |
8 | 8 | Some public domain clip art by contributors at http://www.sxc.hu/ website. |
9 | 9 | Hierarchy marker icons from the Silk icons set by Mark James found at the http://www.famfamfam.com/lab/icons/silk/ website. |
10 | 10 | Portions of the TCL implementation, tcl_np.c and tcl_np.h are copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState Corporation, and other parties. |
11 | NSAlert is Copyright (C) 2011-2020 Philipp Mayerhofer. | |
12 | LZ4 is Copyright (C) 2011-2020 Yann Collet. | |
11 | NSAlert is Copyright (C) 2011-2021 Philipp Mayerhofer. | |
12 | LZ4 is Copyright (C) 2011-2021 Yann Collet. |
1722 | 1722 | Added support for dumping variable types in vcd saveer, not |
1723 | 1723 | just using "wire" for non-reals/strings. |
1724 | 1724 | Fix for uninitialized values at time 0 for FST, FSDB loaders. |
1725 | 3.3.105 01jul20 Fix bad (void) of is_closing in fstDestroyMmaps when using | |
1726 | Cygwin or MinGW. | |
1727 | Fix left shift overflow in cvt_fpsdec(). | |
1728 | Add in missing file/translate/process filter for reals. | |
1729 | Fix for bitvec merging in GHW so integers arrays can be viewed. | |
1730 | Added Shift-Up/Down highlight with scroll in order to assist | |
1731 | with left/right arrow based transition movement. | |
1732 | Fix Show Wave Highlight so it is not dependent on Show Grid. | |
1733 | Fix negative MSBs on VCD loaders for vectors. | |
1734 | Fix getpwuid() null pointer exception. | |
1735 | Add missing recursion case to treenamefix(). | |
1736 | Fix lock/unlock misuse of pthread mutexes across threads. | |
1737 | Examine env var $HOME for home dir on geteuid failure. | |
1738 | 3.3.106 06jul20 Fix for GDK_KEY_* definitions missing in older GDK versions. | |
1739 | Fix Shift-Up/Down highlight to traverse inside groups. | |
1740 | Resync ghwlib to handled unbounded arrays. | |
1741 | 3.3.107 30sep20 Fix left shift overflow in cvt_fpsudec for fixed point. | |
1742 | Added Find First One trace type options. | |
1743 | Fixed bug in Show-Change All Highlighted. | |
1744 | 3.3.108 19dec20 Fix VZT writer crash when dumpoff is invoked before first | |
1745 | timestep. | |
1746 | Fix convert_ffo() that scanned in wrong direction. | |
1747 | Fix use after free in fstapi.c. |
0 | 0 | ########################################################################## |
1 | 1 | |
2 | GTKWave 3.3.104 Wave Viewer is Copyright (C) 1999-2020 Tony Bybell. | |
3 | Portions of GTKWave are Copyright (C) 1999-2020 Udi Finkelstein. | |
4 | Context support is Copyright (C) 2007-2020 Kermin Elliott Fleming. | |
5 | Trace group support is Copyright (C) 2009-2020 Donald Baltus. | |
6 | GHW and additional GUI support is Copyright (C) 2005-2020 Tristan Gingold. | |
7 | Analog support is Copyright (C) 2005-2020 Thomas Sailer. | |
8 | External DnD support is Copyright (C) 2008-2020 Concept Engineering GmbH. | |
9 | FastLZ is Copyright (C) 2005-2020 Ariya Hidayat. | |
10 | LZ4 is Copyright (C) 2011-2020 Yann Collet. | |
2 | GTKWave 3.3.108 Wave Viewer is Copyright (C) 1999-2021 Tony Bybell. | |
3 | Portions of GTKWave are Copyright (C) 1999-2021 Udi Finkelstein. | |
4 | Context support is Copyright (C) 2007-2021 Kermin Elliott Fleming. | |
5 | Trace group support is Copyright (C) 2009-2021 Donald Baltus. | |
6 | GHW and additional GUI support is Copyright (C) 2005-2021 Tristan Gingold. | |
7 | Analog support is Copyright (C) 2005-2021 Thomas Sailer. | |
8 | External DnD support is Copyright (C) 2008-2021 Concept Engineering GmbH. | |
9 | FastLZ is Copyright (C) 2005-2021 Ariya Hidayat. | |
10 | LZ4 is Copyright (C) 2011-2021 Yann Collet. | |
11 | 11 | |
12 | 12 | This program is free software; you can redistribute it and/or modify it |
13 | 13 | under the terms of the GNU General Public License as published by the Free |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for gtkwave 3.3.104. | |
2 | # Generated by GNU Autoconf 2.69 for gtkwave 3.3.108. | |
3 | 3 | # |
4 | 4 | # Report bugs to <bybell@rocketmail.com>. |
5 | 5 | # |
579 | 579 | # Identity of this package. |
580 | 580 | PACKAGE_NAME='gtkwave' |
581 | 581 | PACKAGE_TARNAME='gtkwave' |
582 | PACKAGE_VERSION='3.3.104' | |
583 | PACKAGE_STRING='gtkwave 3.3.104' | |
582 | PACKAGE_VERSION='3.3.108' | |
583 | PACKAGE_STRING='gtkwave 3.3.108' | |
584 | 584 | PACKAGE_BUGREPORT='bybell@rocketmail.com' |
585 | 585 | PACKAGE_URL='' |
586 | 586 | |
1404 | 1404 | # Omit some internal or obsolete options to make the list less imposing. |
1405 | 1405 | # This message is too long to be a string in the A/UX 3.1 sh. |
1406 | 1406 | cat <<_ACEOF |
1407 | \`configure' configures gtkwave 3.3.104 to adapt to many kinds of systems. | |
1407 | \`configure' configures gtkwave 3.3.108 to adapt to many kinds of systems. | |
1408 | 1408 | |
1409 | 1409 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1410 | 1410 | |
1470 | 1470 | |
1471 | 1471 | if test -n "$ac_init_help"; then |
1472 | 1472 | case $ac_init_help in |
1473 | short | recursive ) echo "Configuration of gtkwave 3.3.104:";; | |
1473 | short | recursive ) echo "Configuration of gtkwave 3.3.108:";; | |
1474 | 1474 | esac |
1475 | 1475 | cat <<\_ACEOF |
1476 | 1476 | |
1629 | 1629 | test -n "$ac_init_help" && exit $ac_status |
1630 | 1630 | if $ac_init_version; then |
1631 | 1631 | cat <<\_ACEOF |
1632 | gtkwave configure 3.3.104 | |
1632 | gtkwave configure 3.3.108 | |
1633 | 1633 | generated by GNU Autoconf 2.69 |
1634 | 1634 | |
1635 | 1635 | Copyright (C) 2012 Free Software Foundation, Inc. |
2273 | 2273 | This file contains any messages produced by compilers while |
2274 | 2274 | running configure, to aid debugging if configure makes a mistake. |
2275 | 2275 | |
2276 | It was created by gtkwave $as_me 3.3.104, which was | |
2276 | It was created by gtkwave $as_me 3.3.108, which was | |
2277 | 2277 | generated by GNU Autoconf 2.69. Invocation command line was |
2278 | 2278 | |
2279 | 2279 | $ $0 $@ |
3140 | 3140 | |
3141 | 3141 | # Define the identity of the package. |
3142 | 3142 | PACKAGE='gtkwave' |
3143 | VERSION='3.3.104' | |
3143 | VERSION='3.3.108' | |
3144 | 3144 | |
3145 | 3145 | |
3146 | 3146 | cat >>confdefs.h <<_ACEOF |
11498 | 11498 | # report actual input values of CONFIG_FILES etc. instead of their |
11499 | 11499 | # values after options handling. |
11500 | 11500 | ac_log=" |
11501 | This file was extended by gtkwave $as_me 3.3.104, which was | |
11501 | This file was extended by gtkwave $as_me 3.3.108, which was | |
11502 | 11502 | generated by GNU Autoconf 2.69. Invocation command line was |
11503 | 11503 | |
11504 | 11504 | CONFIG_FILES = $CONFIG_FILES |
11564 | 11564 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
11565 | 11565 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
11566 | 11566 | ac_cs_version="\\ |
11567 | gtkwave config.status 3.3.104 | |
11567 | gtkwave config.status 3.3.108 | |
11568 | 11568 | configured by $0, generated by GNU Autoconf 2.69, |
11569 | 11569 | with options \\"\$ac_cs_config\\" |
11570 | 11570 |
1 | 1 | # Process this file with autoconf to produce a configure script. |
2 | 2 | |
3 | 3 | AC_PREREQ(2.59) |
4 | AC_INIT(gtkwave, 3.3.104, bybell@rocketmail.com) | |
4 | AC_INIT(gtkwave, 3.3.108, bybell@rocketmail.com) | |
5 | 5 | AC_CONFIG_SRCDIR([src/vcd.c]) |
6 | 6 | AM_INIT_AUTOMAKE |
7 | 7 | AC_CONFIG_HEADER([config.h]) |
7 | 7 | <key>CFBundleExecutable</key> |
8 | 8 | <string>gtkwave</string> |
9 | 9 | <key>CFBundleGetInfoString</key> |
10 | <string>3.3.104, (C) 1999-2020 Tony Bybell http://gtkwave.sourceforge.net</string> | |
10 | <string>3.3.108, (C) 1999-2021 Tony Bybell http://gtkwave.sourceforge.net</string> | |
11 | 11 | <key>CFBundleIconFile</key> |
12 | 12 | <string>gtkwave.icns</string> |
13 | 13 | <key>CFBundleIdentifier</key> |
17 | 17 | <key>CFBundlePackageType</key> |
18 | 18 | <string>APPL</string> |
19 | 19 | <key>CFBundleShortVersionString</key> |
20 | <string>3.3.104</string> | |
20 | <string>3.3.108</string> | |
21 | 21 | <key>CFBundleSignature</key> |
22 | 22 | <string>????</string> |
23 | 23 | <key>CFBundleVersion</key> |
24 | <string>3.3.104</string> | |
24 | <string>3.3.108</string> | |
25 | 25 | <key>NSHumanReadableCopyright</key> |
26 | <string>Copyright 1999 - 2020 Tony Bybell, GNU General Public License.</string> | |
26 | <string>Copyright 1999 - 2021 Tony Bybell, GNU General Public License.</string> | |
27 | 27 | <key>LSMinimumSystemVersion</key> |
28 | 28 | <string>10.6</string> |
29 | 29 |
9 | 9 | #include <string.h> |
10 | 10 | #include <inttypes.h> |
11 | 11 | #include <time.h> |
12 | #include "wlf_api.h" | |
12 | #include <wlf_api.h> | |
13 | 13 | |
14 | 14 | /* skips using wlfValueToString() and determines string directly from value representation */ |
15 | 15 | #define BYPASS_USING_VALUE_TO_STRING |
Binary diff not shown
286 | 286 | \fBlxt_clock_compress_to_z\fR <\fIvalue\fP> |
287 | 287 | For LXT (not LXT2) allows clocks to compress to a 'z' value so that regular/periodic value changes may be noted. |
288 | 288 | .TP |
289 | \fBlz_removal\fR <\fIvalue\fP> | |
290 | When nonzero, suppresses the display of leading zeros on non-filtered traces. This has no effect on filtered traces. | |
291 | .TP | |
289 | 292 | \fBmax_fsdb_trees\fR <\fIvalue\fP> |
290 | 293 | sets the maximum number of hierarchy and signal trees to process for an FSDB file. Default = 0 = unlimited. The intent of this is to work around sim environments that accidentally call fsdbDumpVars multiple times. |
291 | 294 | .TP |
220 | 220 | fprintf(stderr, "INTERNAL ERROR: ClearGroupTrace applied to non-group! Exiting.\n"); |
221 | 221 | exit(255); |
222 | 222 | } |
223 | } | |
224 | ||
225 | void MarkTraceCursor(Trptr t_curs) | |
226 | { | |
227 | if(t_curs) | |
228 | { | |
229 | Trptr t=GLOBALS->traces.first; | |
230 | ||
231 | while(t) | |
232 | { | |
233 | t->is_cursor = 0; | |
234 | t=t->t_next; | |
235 | } | |
236 | ||
237 | t_curs->is_cursor = 1; | |
238 | } | |
223 | 239 | } |
224 | 240 | |
225 | 241 | /* |
512 | 512 | unsigned int t_color; /* trace color index */ |
513 | 513 | unsigned char t_fpdecshift; /* for fixed point decimal */ |
514 | 514 | |
515 | unsigned is_cursor : 1; /* set to mark a cursor trace */ | |
515 | 516 | unsigned is_alias : 1; /* set when it's an alias (safe to free t->name then) */ |
516 | 517 | unsigned is_depacked : 1; /* set when it's been depacked from a compressed entry (safe to free t->name then) */ |
517 | 518 | unsigned vector : 1; /* 1 if bit vector, 0 if node */ |
537 | 538 | TR_FPDECSHIFT_B, |
538 | 539 | TR_TIME_B, |
539 | 540 | TR_ENUM_B, |
541 | TR_CURSOR_B, | |
542 | TR_FFO_B, | |
540 | 543 | |
541 | 544 | TR_RSVD_B /* for use internally such as temporary caching of highlighting, not for use in traces */ |
542 | 545 | }; |
573 | 576 | #define TR_REAL2BITS (UINT64_C(1)<<TR_REAL2BITS_B) |
574 | 577 | |
575 | 578 | #define TR_NUMMASK (TR_ASCII|TR_HEX|TR_DEC|TR_BIN|TR_OCT|TR_SIGNED|TR_REAL|TR_TIME|TR_ENUM) |
579 | #define TR_ATTRIBS (TR_RJUSTIFY|TR_INVERT|TR_REVERSE|TR_EXCLUDE|TR_POPCNT|TR_FFO) | |
576 | 580 | |
577 | 581 | #define TR_COLLAPSED (UINT64_C(1)<<TR_COLLAPSED_B) |
578 | 582 | #define TR_ISCOLLAPSED (TR_BLANK|TR_COLLAPSED) |
586 | 590 | |
587 | 591 | #define TR_TIME (UINT64_C(1)<<TR_TIME_B) |
588 | 592 | #define TR_ENUM (UINT64_C(1)<<TR_ENUM_B) |
593 | ||
594 | #define TR_CURSOR (UINT64_C(1)<<TR_CURSOR_B) | |
595 | #define TR_FFO (UINT64_C(1)<<TR_FFO_B) | |
589 | 596 | |
590 | 597 | #define TR_ANALOGMASK (TR_ANALOG_STEP|TR_ANALOG_INTERPOLATED) |
591 | 598 | |
646 | 653 | void CloseTrace(Trptr t); |
647 | 654 | void ClearTraces(void); |
648 | 655 | void ClearGroupTraces(Trptr t); |
656 | void MarkTraceCursor(Trptr t); | |
649 | 657 | |
650 | 658 | char *varxt_fix(char *s); |
651 | 659 |
28 | 28 | #endif |
29 | 29 | |
30 | 30 | /* |
31 | * convert binary <=> gray/popcnt in place | |
31 | * filters mutually exclusive with file/translate/process filters | |
32 | */ | |
33 | static char *lzremoval(char *s) | |
34 | { | |
35 | char *p = s; | |
36 | ||
37 | if(*p) | |
38 | { | |
39 | while((*p=='0') && *(p+1)) | |
40 | { | |
41 | p++; | |
42 | } | |
43 | } | |
44 | ||
45 | if(p != s) | |
46 | { | |
47 | memmove(s, p, strlen(p) + 1); | |
48 | } | |
49 | ||
50 | return(s); | |
51 | } | |
52 | ||
53 | /* | |
54 | * file/translate/process filters | |
55 | */ | |
56 | static char *dofilter(Trptr t, char *s) | |
57 | { | |
58 | GLOBALS->xl_file_filter[t->f_filter] = xl_splay(s, GLOBALS->xl_file_filter[t->f_filter]); | |
59 | ||
60 | if(!strcasecmp(s, GLOBALS->xl_file_filter[t->f_filter]->item)) | |
61 | { | |
62 | free_2(s); | |
63 | s = malloc_2(strlen(GLOBALS->xl_file_filter[t->f_filter]->trans) + 1); | |
64 | strcpy(s, GLOBALS->xl_file_filter[t->f_filter]->trans); | |
65 | } | |
66 | ||
67 | if((*s == '?') && (!GLOBALS->color_active_in_filter)) | |
68 | { | |
69 | char *s2a; | |
70 | char *s2 = strchr(s+1, '?'); | |
71 | if(s2) | |
72 | { | |
73 | s2++; | |
74 | s2a = malloc_2(strlen(s2)+1); | |
75 | strcpy(s2a, s2); | |
76 | free_2(s); | |
77 | s = s2a; | |
78 | } | |
79 | } | |
80 | ||
81 | return(s); | |
82 | } | |
83 | ||
84 | static char *edofilter(Trptr t, char *s) | |
85 | { | |
86 | if(t->flags & TR_ENUM) | |
87 | { | |
88 | int filt = t->e_filter - 1; | |
89 | ||
90 | #ifdef _WAVE_HAVE_JUDY | |
91 | PPvoid_t pv = JudyHSGet(GLOBALS->xl_enum_filter[filt], s, strlen(s)); | |
92 | if(pv) | |
93 | { | |
94 | free_2(s); | |
95 | s = malloc_2(strlen(*pv) + 1); | |
96 | strcpy(s, *pv); | |
97 | } | |
98 | #else | |
99 | GLOBALS->xl_enum_filter[filt] = xl_splay(s, GLOBALS->xl_enum_filter[filt]); | |
100 | ||
101 | if(!strcasecmp(s, GLOBALS->xl_enum_filter[filt]->item)) | |
102 | { | |
103 | free_2(s); | |
104 | s = malloc_2(strlen(GLOBALS->xl_enum_filter[filt]->trans) + 1); | |
105 | strcpy(s, GLOBALS->xl_enum_filter[filt]->trans); | |
106 | } | |
107 | #endif | |
108 | else | |
109 | { | |
110 | char *zerofind = s; | |
111 | char *dst = s, *src; | |
112 | while(*zerofind == '0') zerofind++; | |
113 | if(zerofind != s) | |
114 | { | |
115 | src = (!*zerofind) ? (zerofind-1) : zerofind; | |
116 | while(*src) | |
117 | { | |
118 | *(dst++) = *(src++); | |
119 | } | |
120 | *dst = 0; | |
121 | } | |
122 | } | |
123 | } | |
124 | ||
125 | return(s); | |
126 | } | |
127 | ||
128 | static char *pdofilter(Trptr t, char *s) | |
129 | { | |
130 | struct pipe_ctx *p = GLOBALS->proc_filter[t->p_filter]; | |
131 | char buf[1025]; | |
132 | int n; | |
133 | ||
134 | if(p) | |
135 | { | |
136 | #if !defined _MSC_VER && !defined __MINGW32__ | |
137 | fputs(s, p->sout); | |
138 | fputc('\n', p->sout); | |
139 | fflush(p->sout); | |
140 | ||
141 | buf[0] = 0; | |
142 | ||
143 | n = fgets(buf, 1024, p->sin) ? strlen(buf) : 0; | |
144 | buf[n] = 0; | |
145 | #else | |
146 | { | |
147 | BOOL bSuccess; | |
148 | DWORD dwWritten, dwRead; | |
149 | ||
150 | WriteFile(p->g_hChildStd_IN_Wr, s, strlen(s), &dwWritten, NULL); | |
151 | WriteFile(p->g_hChildStd_IN_Wr, "\n", 1, &dwWritten, NULL); | |
152 | ||
153 | for(n=0;n<1024;n++) | |
154 | { | |
155 | do { | |
156 | bSuccess = ReadFile(p->g_hChildStd_OUT_Rd, buf+n, 1, &dwRead, NULL); | |
157 | if((!bSuccess)||(buf[n]=='\n')) | |
158 | { | |
159 | goto ex; | |
160 | } | |
161 | ||
162 | } while(buf[n]=='\r'); | |
163 | } | |
164 | ex: buf[n] = 0; | |
165 | } | |
166 | ||
167 | #endif | |
168 | ||
169 | if(n) | |
170 | { | |
171 | if(buf[n-1] == '\n') { buf[n-1] = 0; n--; } | |
172 | } | |
173 | ||
174 | if(buf[0]) | |
175 | { | |
176 | free_2(s); | |
177 | s = malloc_2(n + 1); | |
178 | strcpy(s, buf); | |
179 | } | |
180 | } | |
181 | ||
182 | if((*s == '?') && (!GLOBALS->color_active_in_filter)) | |
183 | { | |
184 | char *s2a; | |
185 | char *s2 = strchr(s+1, '?'); | |
186 | if(s2) | |
187 | { | |
188 | s2++; | |
189 | s2a = malloc_2(strlen(s2)+1); | |
190 | strcpy(s2a, s2); | |
191 | free_2(s); | |
192 | s = s2a; | |
193 | } | |
194 | } | |
195 | return(s); | |
196 | } | |
197 | ||
198 | ||
199 | /* | |
200 | * convert binary <=> gray/ffo/popcnt in place | |
32 | 201 | */ |
33 | 202 | #define cvt_gray(f,p,n) \ |
34 | 203 | do { \ |
35 | if((f)&(TR_GRAYMASK|TR_POPCNT)) \ | |
36 | { \ | |
37 | if((f)&TR_BINGRAY) { convert_bingray((p),(n)); } \ | |
38 | if((f)&TR_GRAYBIN) { convert_graybin((p),(n)); } \ | |
39 | if((f)&TR_POPCNT) { convert_popcnt((p),(n)); } \ | |
40 | } \ | |
204 | if((f)&(TR_GRAYMASK|TR_POPCNT|TR_FFO)) \ | |
205 | { \ | |
206 | if((f)&TR_BINGRAY) { convert_bingray((p),(n)); } \ | |
207 | if((f)&TR_GRAYBIN) { convert_graybin((p),(n)); } \ | |
208 | if((f)&TR_FFO) { convert_ffo((p),(n)); } \ | |
209 | if((f)&TR_POPCNT) { convert_popcnt((p),(n)); } \ | |
210 | } \ | |
41 | 211 | } while(0) |
42 | 212 | |
43 | 213 | |
167 | 337 | } |
168 | 338 | |
169 | 339 | |
340 | static void convert_ffo(char *pnt, int nbits) | |
341 | { | |
342 | int i; | |
343 | int ffo = -1; | |
344 | ||
345 | for(i=(nbits-1);i>=0;i--) | |
346 | { | |
347 | char ch = pnt[i]; | |
348 | ||
349 | if((ch == AN_1) || (ch == AN_H)) | |
350 | { | |
351 | ffo = (nbits-1) - i; | |
352 | break; | |
353 | } | |
354 | } | |
355 | ||
356 | if(ffo >= 0) | |
357 | { | |
358 | for(i=nbits-1;i>=0;i--) /* always requires less number of bits */ | |
359 | { | |
360 | pnt[i] = (ffo & 1) ? AN_1 : AN_0; | |
361 | ffo >>= 1; | |
362 | } | |
363 | } | |
364 | else | |
365 | { | |
366 | for(i=nbits-1;i>=0;i--) /* always requires less number of bits */ | |
367 | { | |
368 | pnt[i] = AN_X; | |
369 | } | |
370 | } | |
371 | } | |
372 | ||
373 | ||
170 | 374 | static void dpr_e16(char *str, double d) |
171 | 375 | { |
172 | 376 | char *buf16; |
195 | 399 | |
196 | 400 | int shamt = t->t_fpdecshift; |
197 | 401 | TimeType lpart = val >> shamt; |
198 | TimeType rmsk = (1 << shamt); | |
402 | TimeType rmsk = (ULLDescriptor(1) << shamt); | |
403 | ||
199 | 404 | TimeType rbit = (val >= 0) ? (val & (rmsk-1)) : ((-val) & (rmsk-1)); |
200 | 405 | double rfrac; |
201 | 406 | int negflag = 0; |
244 | 449 | { |
245 | 450 | int shamt = t->t_fpdecshift; |
246 | 451 | UTimeType lpart = ((UTimeType)val) >> shamt; |
247 | TimeType rmsk = (1 << shamt); | |
452 | TimeType rmsk = (ULLDescriptor(1) << shamt); | |
248 | 453 | TimeType rbit = (val & (rmsk-1)); |
249 | 454 | double rfrac; |
250 | 455 | char dbuf[32]; |
465 | 670 | if(GLOBALS->show_base) { *(pnt++)='"'; } |
466 | 671 | *(pnt)=0x00; /* scan build : remove dead increment */ |
467 | 672 | } |
468 | else if((flags&TR_HEX)||((flags&(TR_DEC|TR_SIGNED))&&(nbits>64)&&(!(flags&TR_POPCNT)))) | |
673 | else if((flags&TR_HEX)||((flags&(TR_DEC|TR_SIGNED))&&(nbits>64)&&(!(flags&(TR_POPCNT|TR_FFO))))) | |
469 | 674 | { |
470 | 675 | char *parse; |
471 | 676 | |
894 | 1099 | strcpy(rv,"UNDEF"); |
895 | 1100 | } |
896 | 1101 | } |
1102 | ||
1103 | if(!(t->f_filter|t->p_filter|t->e_filter)) | |
1104 | { | |
1105 | if(GLOBALS->lz_removal) lzremoval(rv); | |
1106 | } | |
1107 | else | |
1108 | { | |
1109 | if(t->e_filter) | |
1110 | { | |
1111 | rv = edofilter(t, rv); | |
1112 | } | |
1113 | else | |
1114 | if(t->f_filter) | |
1115 | { | |
1116 | rv = dofilter(t, rv); | |
1117 | } | |
1118 | else | |
1119 | { | |
1120 | rv = pdofilter(t, rv); | |
1121 | } | |
1122 | } | |
897 | 1123 | |
898 | 1124 | return(rv); |
899 | 1125 | } |
1214 | 1440 | if(GLOBALS->show_base) { *(pnt++)='"'; } |
1215 | 1441 | *(pnt)=0x00; /* scan build : remove dead increment */ |
1216 | 1442 | } |
1217 | else if((flags&TR_HEX)||((flags&(TR_DEC|TR_SIGNED))&&(nbits>64)&&(!(flags&TR_POPCNT)))) | |
1443 | else if((flags&TR_HEX)||((flags&(TR_DEC|TR_SIGNED))&&(nbits>64)&&(!(flags&(TR_POPCNT|TR_FFO))))) | |
1218 | 1444 | { |
1219 | 1445 | char *parse; |
1220 | 1446 | |
1595 | 1821 | } |
1596 | 1822 | |
1597 | 1823 | |
1598 | static char *dofilter(Trptr t, char *s) | |
1599 | { | |
1600 | GLOBALS->xl_file_filter[t->f_filter] = xl_splay(s, GLOBALS->xl_file_filter[t->f_filter]); | |
1601 | ||
1602 | if(!strcasecmp(s, GLOBALS->xl_file_filter[t->f_filter]->item)) | |
1603 | { | |
1604 | free_2(s); | |
1605 | s = malloc_2(strlen(GLOBALS->xl_file_filter[t->f_filter]->trans) + 1); | |
1606 | strcpy(s, GLOBALS->xl_file_filter[t->f_filter]->trans); | |
1607 | } | |
1608 | ||
1609 | if((*s == '?') && (!GLOBALS->color_active_in_filter)) | |
1610 | { | |
1611 | char *s2a; | |
1612 | char *s2 = strchr(s+1, '?'); | |
1613 | if(s2) | |
1614 | { | |
1615 | s2++; | |
1616 | s2a = malloc_2(strlen(s2)+1); | |
1617 | strcpy(s2a, s2); | |
1618 | free_2(s); | |
1619 | s = s2a; | |
1620 | } | |
1621 | } | |
1622 | ||
1623 | return(s); | |
1624 | } | |
1625 | ||
1626 | static char *edofilter(Trptr t, char *s) | |
1627 | { | |
1628 | if(t->flags & TR_ENUM) | |
1629 | { | |
1630 | int filt = t->e_filter - 1; | |
1631 | ||
1632 | #ifdef _WAVE_HAVE_JUDY | |
1633 | PPvoid_t pv = JudyHSGet(GLOBALS->xl_enum_filter[filt], s, strlen(s)); | |
1634 | if(pv) | |
1635 | { | |
1636 | free_2(s); | |
1637 | s = malloc_2(strlen(*pv) + 1); | |
1638 | strcpy(s, *pv); | |
1639 | } | |
1640 | #else | |
1641 | GLOBALS->xl_enum_filter[filt] = xl_splay(s, GLOBALS->xl_enum_filter[filt]); | |
1642 | ||
1643 | if(!strcasecmp(s, GLOBALS->xl_enum_filter[filt]->item)) | |
1644 | { | |
1645 | free_2(s); | |
1646 | s = malloc_2(strlen(GLOBALS->xl_enum_filter[filt]->trans) + 1); | |
1647 | strcpy(s, GLOBALS->xl_enum_filter[filt]->trans); | |
1648 | } | |
1649 | #endif | |
1650 | else | |
1651 | { | |
1652 | char *zerofind = s; | |
1653 | char *dst = s, *src; | |
1654 | while(*zerofind == '0') zerofind++; | |
1655 | if(zerofind != s) | |
1656 | { | |
1657 | src = (!*zerofind) ? (zerofind-1) : zerofind; | |
1658 | while(*src) | |
1659 | { | |
1660 | *(dst++) = *(src++); | |
1661 | } | |
1662 | *dst = 0; | |
1663 | } | |
1664 | } | |
1665 | } | |
1666 | ||
1667 | return(s); | |
1668 | } | |
1669 | ||
1670 | static char *pdofilter(Trptr t, char *s) | |
1671 | { | |
1672 | struct pipe_ctx *p = GLOBALS->proc_filter[t->p_filter]; | |
1673 | char buf[1025]; | |
1674 | int n; | |
1675 | ||
1676 | if(p) | |
1677 | { | |
1678 | #if !defined _MSC_VER && !defined __MINGW32__ | |
1679 | fputs(s, p->sout); | |
1680 | fputc('\n', p->sout); | |
1681 | fflush(p->sout); | |
1682 | ||
1683 | buf[0] = 0; | |
1684 | ||
1685 | n = fgets(buf, 1024, p->sin) ? strlen(buf) : 0; | |
1686 | buf[n] = 0; | |
1687 | #else | |
1688 | { | |
1689 | BOOL bSuccess; | |
1690 | DWORD dwWritten, dwRead; | |
1691 | ||
1692 | WriteFile(p->g_hChildStd_IN_Wr, s, strlen(s), &dwWritten, NULL); | |
1693 | WriteFile(p->g_hChildStd_IN_Wr, "\n", 1, &dwWritten, NULL); | |
1694 | ||
1695 | for(n=0;n<1024;n++) | |
1696 | { | |
1697 | do { | |
1698 | bSuccess = ReadFile(p->g_hChildStd_OUT_Rd, buf+n, 1, &dwRead, NULL); | |
1699 | if((!bSuccess)||(buf[n]=='\n')) | |
1700 | { | |
1701 | goto ex; | |
1702 | } | |
1703 | ||
1704 | } while(buf[n]=='\r'); | |
1705 | } | |
1706 | ex: buf[n] = 0; | |
1707 | } | |
1708 | ||
1709 | #endif | |
1710 | ||
1711 | if(n) | |
1712 | { | |
1713 | if(buf[n-1] == '\n') { buf[n-1] = 0; n--; } | |
1714 | } | |
1715 | ||
1716 | if(buf[0]) | |
1717 | { | |
1718 | free_2(s); | |
1719 | s = malloc_2(n + 1); | |
1720 | strcpy(s, buf); | |
1721 | } | |
1722 | } | |
1723 | ||
1724 | if((*s == '?') && (!GLOBALS->color_active_in_filter)) | |
1725 | { | |
1726 | char *s2a; | |
1727 | char *s2 = strchr(s+1, '?'); | |
1728 | if(s2) | |
1729 | { | |
1730 | s2++; | |
1731 | s2a = malloc_2(strlen(s2)+1); | |
1732 | strcpy(s2a, s2); | |
1733 | free_2(s); | |
1734 | s = s2a; | |
1735 | } | |
1736 | } | |
1737 | return(s); | |
1738 | } | |
1739 | ||
1740 | ||
1741 | 1824 | char *convert_ascii_vec(Trptr t, char *vec) |
1742 | 1825 | { |
1743 | 1826 | char *s = convert_ascii_vec_2(t, vec); |
1744 | 1827 | |
1745 | 1828 | if(!(t->f_filter|t->p_filter|t->e_filter)) |
1746 | 1829 | { |
1830 | if(GLOBALS->lz_removal) lzremoval(s); | |
1747 | 1831 | } |
1748 | 1832 | else |
1749 | 1833 | { |
1794 | 1878 | |
1795 | 1879 | if(!(t->f_filter|t->p_filter|t->e_filter)) |
1796 | 1880 | { |
1881 | if(GLOBALS->lz_removal) lzremoval(s); | |
1797 | 1882 | } |
1798 | 1883 | else |
1799 | 1884 | { |
172 | 172 | { |
173 | 173 | if(psr) |
174 | 174 | { |
175 | char *fstr1 = GLOBALS->facs[i-1]->name; | |
176 | char *fstr2 = GLOBALS->facs[i]->name; | |
177 | int p1 = strand_pnt(fstr1); | |
178 | int p2 = strand_pnt(fstr2); | |
179 | ||
180 | if(!root) | |
175 | int ev1 = GLOBALS->facs[i-1]->n->extvals; | |
176 | int ev2 = GLOBALS->facs[i]->n->extvals; | |
177 | ||
178 | if(!ev1 && !ev2) | |
181 | 179 | { |
182 | if((p1>=0)&&(p1==p2)) | |
180 | char *fstr1 = GLOBALS->facs[i-1]->name; | |
181 | char *fstr2 = GLOBALS->facs[i]->name; | |
182 | int p1 = strand_pnt(fstr1); | |
183 | int p2 = strand_pnt(fstr2); | |
184 | ||
185 | if(!root) | |
183 | 186 | { |
184 | if(!strncmp(fstr1, fstr2, p1)) | |
187 | if((p1>=0)&&(p1==p2)) | |
185 | 188 | { |
186 | root = GLOBALS->facs[i-1]; | |
187 | root->vec_root = root; | |
188 | root->vec_chain = GLOBALS->facs[i]; | |
189 | GLOBALS->facs[i]->vec_root = root; | |
189 | if(!strncmp(fstr1, fstr2, p1)) | |
190 | { | |
191 | root = GLOBALS->facs[i-1]; | |
192 | root->vec_root = root; | |
193 | root->vec_chain = GLOBALS->facs[i]; | |
194 | GLOBALS->facs[i]->vec_root = root; | |
195 | } | |
190 | 196 | } |
191 | 197 | } |
192 | } | |
193 | else | |
194 | { | |
195 | if((p1>=0)&&(p1==p2)) | |
198 | else | |
196 | 199 | { |
197 | if(!strncmp(fstr1, fstr2, p1)) | |
200 | if((p1>=0)&&(p1==p2)) | |
198 | 201 | { |
199 | psr->vec_chain = GLOBALS->facs[i]; | |
200 | GLOBALS->facs[i]->vec_root = root; | |
202 | if(!strncmp(fstr1, fstr2, p1)) | |
203 | { | |
204 | psr->vec_chain = GLOBALS->facs[i]; | |
205 | GLOBALS->facs[i]->vec_root = root; | |
206 | } | |
207 | else | |
208 | { | |
209 | root = NULL; | |
210 | } | |
201 | 211 | } |
202 | 212 | else |
203 | 213 | { |
204 | 214 | root = NULL; |
205 | 215 | } |
206 | 216 | } |
207 | else | |
208 | { | |
209 | root = NULL; | |
210 | } | |
217 | } | |
218 | else | |
219 | { | |
220 | root = NULL; | |
211 | 221 | } |
212 | 222 | } |
213 | 223 | |
439 | 449 | const char *pfx, struct tree **res, unsigned int **sig) |
440 | 450 | { |
441 | 451 | union ghw_type *idx; |
442 | struct ghw_type_array *base = arr->sa.base; | |
452 | struct ghw_type_array *base = | |
453 | (struct ghw_type_array *) ghw_get_base_type (arr->sa.base); | |
443 | 454 | char *name = NULL; |
444 | 455 | |
445 | 456 | if ((unsigned int)dim == base->nbr_dim) |
448 | 459 | sprintf (GLOBALS->asbuf, "%s]", pfx); |
449 | 460 | name = strdup_2(GLOBALS->asbuf); |
450 | 461 | |
451 | t = build_hierarchy_type (h, base->el, name, sig); | |
462 | t = build_hierarchy_type (h, arr->sa.el, name, sig); | |
452 | 463 | |
453 | 464 | if (*res != NULL) |
454 | 465 | (*res)->next = t; |
438 | 438 | case ghdl_rtik_type_f64: |
439 | 439 | case ghdl_rtik_type_p32: |
440 | 440 | case ghdl_rtik_type_p64: |
441 | case ghdl_rtik_type_array: | |
441 | 442 | return t; |
442 | 443 | case ghdl_rtik_subtype_scalar: |
443 | 444 | return t->ss.base; |
444 | 445 | case ghdl_rtik_subtype_array: |
445 | return (union ghw_type*)(t->sa.base); | |
446 | return t->sa.base; | |
447 | case ghdl_rtik_subtype_unbounded_array: | |
448 | return t->sua.base; | |
446 | 449 | default: |
447 | 450 | fprintf (stderr, "ghw_get_base_type: cannot handle type %d\n", t->kind); |
448 | 451 | abort (); |
473 | 476 | return t->rec.nbr_scalars; |
474 | 477 | case ghdl_rtik_subtype_record: |
475 | 478 | return t->sr.nbr_scalars; |
479 | case ghdl_rtik_subtype_unbounded_record: | |
480 | case ghdl_rtik_subtype_unbounded_array: | |
481 | return -1; | |
476 | 482 | default: |
477 | 483 | fprintf (stderr, "get_nbr_elements: unhandled type %d\n", t->kind); |
478 | 484 | abort (); |
514 | 520 | return (res <= 0) ? 0 : res; |
515 | 521 | } |
516 | 522 | |
523 | static union ghw_type * | |
524 | ghw_read_type_bounds (struct ghw_handler *h, union ghw_type *base); | |
525 | ||
517 | 526 | /* Create an array subtype using BASE and ranges read from H. */ |
518 | 527 | |
519 | 528 | struct ghw_subtype_array * |
520 | ghw_read_array_subtype (struct ghw_handler *h, struct ghw_type_array *base) | |
521 | { | |
529 | ghw_read_array_subtype (struct ghw_handler *h, union ghw_type *base) | |
530 | { | |
531 | struct ghw_type_array *arr = | |
532 | (struct ghw_type_array *)ghw_get_base_type (base); | |
522 | 533 | struct ghw_subtype_array *sa; |
523 | 534 | unsigned j; |
524 | 535 | int nbr_scalars; |
536 | int nbr_els; | |
525 | 537 | |
526 | 538 | sa = malloc (sizeof (struct ghw_subtype_array)); |
527 | 539 | sa->kind = ghdl_rtik_subtype_array; |
528 | 540 | sa->name = NULL; |
529 | 541 | sa->base = base; |
530 | nbr_scalars = get_nbr_elements (base->el); | |
531 | sa->rngs = malloc (base->nbr_dim * sizeof (union ghw_range *)); | |
532 | for (j = 0; j < base->nbr_dim; j++) | |
542 | nbr_els = get_nbr_elements (arr->el); | |
543 | nbr_scalars = 1; | |
544 | sa->rngs = malloc (arr->nbr_dim * sizeof (union ghw_range *)); | |
545 | for (j = 0; j < arr->nbr_dim; j++) | |
533 | 546 | { |
534 | 547 | sa->rngs[j] = ghw_read_range (h); |
535 | 548 | nbr_scalars *= ghw_get_range_length (sa->rngs[j]); |
536 | 549 | } |
537 | sa->nbr_scalars = nbr_scalars; | |
550 | if (nbr_els >= 0) | |
551 | { | |
552 | /* Element type is bounded. */ | |
553 | sa->el = arr->el; | |
554 | } | |
555 | else | |
556 | { | |
557 | /* Read bounds for the elements. */ | |
558 | sa->el = ghw_read_type_bounds(h, arr->el); | |
559 | nbr_els = get_nbr_elements (sa->el); | |
560 | } | |
561 | sa->nbr_scalars = nbr_scalars * nbr_els; | |
538 | 562 | return sa; |
539 | 563 | } |
540 | 564 | |
574 | 598 | } |
575 | 599 | else |
576 | 600 | { |
577 | switch (btype->kind) | |
578 | { | |
579 | case ghdl_rtik_type_array: | |
580 | sr->els[j].type = (union ghw_type *) | |
581 | ghw_read_array_subtype (h, &btype->ar); | |
582 | break; | |
583 | case ghdl_rtik_type_record: | |
584 | sr->els[j].type = (union ghw_type *) | |
585 | ghw_read_record_subtype (h, &btype->rec); | |
586 | break; | |
587 | default: | |
588 | fprintf | |
589 | (stderr, "ghw_read_record_subtype: unhandled kind %d\n", | |
590 | btype->kind); | |
591 | return NULL; | |
592 | } | |
601 | sr->els[j].type = ghw_read_type_bounds(h, btype); | |
593 | 602 | el_nbr_scalars = get_nbr_elements (sr->els[j].type); |
594 | 603 | } |
595 | 604 | nbr_scalars += el_nbr_scalars; |
599 | 608 | return sr; |
600 | 609 | } |
601 | 610 | |
611 | /* Read bounds for BASE and create a subtype. */ | |
612 | ||
613 | static union ghw_type * | |
614 | ghw_read_type_bounds (struct ghw_handler *h, union ghw_type *base) | |
615 | { | |
616 | switch (base->kind) | |
617 | { | |
618 | case ghdl_rtik_type_array: | |
619 | case ghdl_rtik_subtype_unbounded_array: | |
620 | return (union ghw_type *)ghw_read_array_subtype (h, base); | |
621 | break; | |
622 | case ghdl_rtik_type_record: | |
623 | case ghdl_rtik_subtype_unbounded_record: | |
624 | return (union ghw_type *)ghw_read_record_subtype (h, &base->rec); | |
625 | break; | |
626 | default: | |
627 | fprintf (stderr, "ghw_read_type_bounds: unhandled kind %d\n", | |
628 | base->kind); | |
629 | return NULL; | |
630 | } | |
631 | } | |
632 | ||
602 | 633 | int |
603 | 634 | ghw_read_type (struct ghw_handler *h) |
604 | 635 | { |
621 | 652 | t = fgetc (h->stream); |
622 | 653 | if (t == EOF) |
623 | 654 | return -1; |
624 | /* printf ("type[%d]= %d\n", i, t); */ | |
655 | if (h->flag_verbose > 1) | |
656 | printf ("type[%d]= %d\n", i, t); | |
625 | 657 | switch (t) |
626 | 658 | { |
627 | 659 | case ghdl_rtik_type_b2: |
733 | 765 | for (j = 0; j < arr->nbr_dim; j++) |
734 | 766 | arr->dims[j] = ghw_read_typeid (h); |
735 | 767 | if (h->flag_verbose > 1) |
736 | printf ("array: %s\n", arr->name); | |
768 | printf ("array: %s (ndim=%u) of %s\n", | |
769 | arr->name, arr->nbr_dim, arr->el->common.name); | |
737 | 770 | h->types[i] = (union ghw_type *)arr; |
738 | 771 | break; |
739 | 772 | err_array: |
745 | 778 | { |
746 | 779 | struct ghw_subtype_array *sa; |
747 | 780 | const char *name; |
748 | struct ghw_type_array *base; | |
781 | union ghw_type *base; | |
749 | 782 | |
750 | 783 | name = ghw_read_strid (h); |
751 | base = (struct ghw_type_array *)ghw_read_typeid (h); | |
784 | base = ghw_read_typeid (h); | |
752 | 785 | |
753 | 786 | sa = ghw_read_array_subtype (h, base); |
754 | 787 | sa->name = name; |
756 | 789 | if (h->flag_verbose > 1) |
757 | 790 | printf ("subtype array: %s (nbr_scalars=%d)\n", |
758 | 791 | sa->name, sa->nbr_scalars); |
792 | } | |
793 | break; | |
794 | case ghdl_rtik_subtype_unbounded_array: | |
795 | { | |
796 | struct ghw_subtype_unbounded_array *sua; | |
797 | ||
798 | sua = malloc (sizeof (struct ghw_subtype_unbounded_array)); | |
799 | sua->kind = t; | |
800 | sua->name = ghw_read_strid (h); | |
801 | sua->base = ghw_read_typeid (h); | |
802 | h->types[i] = (union ghw_type *)sua; | |
803 | if (h->flag_verbose > 1) | |
804 | printf ("subtype unbounded array: %s\n", sua->name); | |
759 | 805 | } |
760 | 806 | break; |
761 | 807 | case ghdl_rtik_type_record: |
896 | 942 | int len; |
897 | 943 | |
898 | 944 | len = t->sa.nbr_scalars; |
899 | stride = get_nbr_elements (t->sa.base->el); | |
945 | stride = get_nbr_elements (t->sa.el); | |
900 | 946 | |
901 | 947 | for (i = 0; i < len; i += stride) |
902 | if (ghw_read_signal (h, &sigs[i], t->sa.base->el) < 0) | |
948 | if (ghw_read_signal (h, &sigs[i], t->sa.el) < 0) | |
903 | 949 | return -1; |
904 | 950 | } |
905 | 951 | return 0; |
1089 | 1135 | /* Should not be here. */ |
1090 | 1136 | abort (); |
1091 | 1137 | case ghw_hie_process: |
1138 | el->u.blk.child = NULL; | |
1092 | 1139 | break; |
1093 | 1140 | case ghw_hie_block: |
1094 | 1141 | case ghw_hie_generate_if: |
1312 | 1359 | ghw_disp_subtype_indication (h, hie->u.sig.type); |
1313 | 1360 | printf (":"); |
1314 | 1361 | k = 0; |
1315 | assert (sigs[0] != GHW_NO_SIG); | |
1316 | while (1) | |
1362 | /* There can be 0-length signals. */ | |
1363 | while (sigs[k] != GHW_NO_SIG) | |
1317 | 1364 | { |
1318 | 1365 | /* First signal of the range. */ |
1319 | 1366 | printf (" #%u", sigs[k]); |
1323 | 1370 | if (num > 1) |
1324 | 1371 | printf ("-#%u", sigs[k + num - 1]); |
1325 | 1372 | k += num; |
1326 | /* End of signals ? */ | |
1327 | if (sigs[k] == GHW_NO_SIG) | |
1328 | break; | |
1329 | 1373 | } |
1330 | 1374 | n = hie->brother; |
1331 | 1375 | } |
1976 | 2020 | ghw_disp_array_subtype_bounds (struct ghw_subtype_array *a) |
1977 | 2021 | { |
1978 | 2022 | unsigned i; |
2023 | struct ghw_type_array *base = | |
2024 | (struct ghw_type_array *)ghw_get_base_type (a->base); | |
1979 | 2025 | |
1980 | 2026 | printf (" ("); |
1981 | for (i = 0; i < a->base->nbr_dim; i++) | |
2027 | for (i = 0; i < base->nbr_dim; i++) | |
1982 | 2028 | { |
1983 | 2029 | if (i != 0) |
1984 | 2030 | printf (", "); |
1985 | ghw_disp_range (a->base->dims[i], a->rngs[i]); | |
2031 | ghw_disp_range (base->dims[i], a->rngs[i]); | |
1986 | 2032 | } |
1987 | 2033 | printf (")"); |
1988 | 2034 | } |
2052 | 2098 | ghw_disp_record_subtype_bounds (sr); |
2053 | 2099 | } |
2054 | 2100 | break; |
2101 | case ghdl_rtik_subtype_unbounded_array: | |
2102 | { | |
2103 | struct ghw_subtype_unbounded_record *sur = &t->sur; | |
2104 | ||
2105 | ghw_disp_typename (h, (union ghw_type *)sur->base); | |
2106 | } | |
2107 | break; | |
2055 | 2108 | default: |
2056 | 2109 | printf ("ghw_disp_subtype_definition: unhandled type kind %d\n", |
2057 | 2110 | t->kind); |
2159 | 2212 | case ghdl_rtik_subtype_array: |
2160 | 2213 | case ghdl_rtik_subtype_scalar: |
2161 | 2214 | case ghdl_rtik_subtype_record: |
2215 | case ghdl_rtik_subtype_unbounded_array: | |
2162 | 2216 | { |
2163 | 2217 | struct ghw_type_common *c = &t->common; |
2164 | 2218 | printf ("subtype %s is ", c->name); |
23 | 23 | #include <stdio.h> |
24 | 24 | #include <stdlib.h> |
25 | 25 | |
26 | /* To be libraries friendly. */ | |
26 | 27 | #ifdef HAVE_CONFIG_H |
27 | 28 | #include "config.h" |
28 | 29 | #endif |
81 | 82 | ghdl_rtik_type_file, |
82 | 83 | ghdl_rtik_subtype_scalar, |
83 | 84 | ghdl_rtik_subtype_array, /* 35 */ |
84 | ghdl_rtik_subtype_array_ptr, /* Obsolete. */ | |
85 | ghdl_rtik_subtype_unconstrained_array, /* Obsolete. */ | |
85 | ghdl_rtik_subtype_array_ptr, /* Obsolete. */ | |
86 | ghdl_rtik_subtype_unbounded_array, | |
86 | 87 | ghdl_rtik_subtype_record, |
87 | ghdl_rtik_subtype_access, | |
88 | ghdl_rtik_subtype_unbounded_record, | |
89 | #if 0 | |
90 | ghdl_rtik_subtype_access, /* 40 */ | |
88 | 91 | ghdl_rtik_type_protected, |
89 | 92 | ghdl_rtik_element, |
90 | 93 | ghdl_rtik_unit, |
91 | 94 | ghdl_rtik_attribute_transaction, |
92 | 95 | ghdl_rtik_attribute_quiet, |
93 | 96 | ghdl_rtik_attribute_stable, |
97 | #endif | |
94 | 98 | ghdl_rtik_error |
95 | 99 | }; |
96 | 100 | |
201 | 205 | union ghw_type **dims; |
202 | 206 | }; |
203 | 207 | |
208 | struct ghw_subtype_unbounded_array | |
209 | { | |
210 | enum ghdl_rtik kind; | |
211 | const char *name; | |
212 | ||
213 | union ghw_type *base; | |
214 | }; | |
215 | ||
204 | 216 | struct ghw_subtype_array |
205 | 217 | { |
206 | 218 | enum ghdl_rtik kind; |
207 | 219 | const char *name; |
208 | 220 | |
209 | struct ghw_type_array *base; | |
221 | union ghw_type *base; | |
210 | 222 | int nbr_scalars; |
211 | 223 | union ghw_range **rngs; |
224 | union ghw_type *el; | |
212 | 225 | }; |
213 | 226 | |
214 | 227 | struct ghw_subtype_scalar |
244 | 257 | struct ghw_type_record *base; |
245 | 258 | int nbr_scalars; /* Number of scalar elements (ie nbr of signals). */ |
246 | 259 | struct ghw_record_element *els; |
260 | }; | |
261 | ||
262 | struct ghw_subtype_unbounded_record | |
263 | { | |
264 | enum ghdl_rtik kind; | |
265 | const char *name; | |
266 | ||
267 | struct ghw_type_record *base; | |
247 | 268 | }; |
248 | 269 | |
249 | 270 | union ghw_type |
254 | 275 | struct ghw_type_scalar sc; |
255 | 276 | struct ghw_type_physical ph; |
256 | 277 | struct ghw_subtype_scalar ss; |
257 | struct ghw_subtype_array sa; | |
258 | struct ghw_subtype_record sr; | |
259 | 278 | struct ghw_type_array ar; |
260 | 279 | struct ghw_type_record rec; |
280 | struct ghw_subtype_array sa; | |
281 | struct ghw_subtype_unbounded_array sua; | |
282 | struct ghw_subtype_record sr; | |
283 | struct ghw_subtype_unbounded_record sur; | |
261 | 284 | }; |
262 | 285 | |
263 | 286 | union ghw_val |
413 | 436 | ghw_res_other = 3 |
414 | 437 | }; |
415 | 438 | |
439 | enum ghw_res ghw_read_sm_hdr (struct ghw_handler *h, int *list); | |
440 | ||
416 | 441 | int ghw_read_sm (struct ghw_handler *h, enum ghw_sm_type *sm); |
417 | 442 | |
418 | 443 | int ghw_read_dump (struct ghw_handler *h); |
438 | 463 | void ghw_disp_type (struct ghw_handler *h, union ghw_type *t); |
439 | 464 | |
440 | 465 | void ghw_disp_types (struct ghw_handler *h); |
441 | ||
442 | enum ghw_res ghw_read_sm_hdr (struct ghw_handler *h, int *list); | |
443 | ||
444 | 466 | #endif /* _GHWLIB_H_ */ |
853 | 853 | NULL, /* toggle3_showchange_c_1 364 */ |
854 | 854 | NULL, /* toggle4_showchange_c_1 364 */ |
855 | 855 | NULL, /* toggle5_showchange_c_1 364 */ |
856 | NULL, /* toggle6_showchange_c_1 364 */ | |
856 | 857 | NULL, /* window_showchange_c_8 365 */ |
857 | 858 | NULL, /* cleanup_showchange_c_6 366 */ |
858 | 859 | NULL, /* tcache_showchange_c_1 367 */ |
1380 | 1381 | 0, /* ruler_origin */ |
1381 | 1382 | 0, /* ruler_step */ |
1382 | 1383 | 0, /* fill_waveform */ |
1384 | 0, /* lz_removal */ | |
1383 | 1385 | FALSE, /*save_on_exit */ |
1384 | 1386 | |
1385 | 1387 | |
1901 | 1903 | new_globals->display_grid = GLOBALS->display_grid; |
1902 | 1904 | new_globals->highlight_wavewindow = GLOBALS->highlight_wavewindow; |
1903 | 1905 | new_globals->fill_waveform = GLOBALS->fill_waveform; |
1906 | new_globals->lz_removal = GLOBALS->lz_removal; | |
1904 | 1907 | new_globals->use_standard_trace_select = GLOBALS->use_standard_trace_select; |
1905 | 1908 | new_globals->use_big_fonts = GLOBALS->use_big_fonts; |
1906 | 1909 | new_globals->use_full_precision = GLOBALS->use_full_precision; |
2848 | 2851 | GLOBALS->display_grid = g_old->display_grid; |
2849 | 2852 | GLOBALS->highlight_wavewindow = g_old->highlight_wavewindow; |
2850 | 2853 | GLOBALS->fill_waveform = g_old->fill_waveform; |
2854 | GLOBALS->lz_removal = g_old->lz_removal; | |
2851 | 2855 | GLOBALS->use_standard_trace_select = g_old->use_standard_trace_select; |
2852 | 2856 | GLOBALS->disable_mouseover = g_old->disable_mouseover; |
2853 | 2857 | GLOBALS->clipboard_mouseover = g_old->clipboard_mouseover; |
856 | 856 | GtkWidget *toggle3_showchange_c_1; /* from showchange.c 390 */ |
857 | 857 | GtkWidget *toggle4_showchange_c_1; /* from showchange.c 391 */ |
858 | 858 | GtkWidget *toggle5_showchange_c_1; /* from showchange.c 391 */ |
859 | GtkWidget *toggle6_showchange_c_1; /* from showchange.c 391 */ | |
859 | 860 | GtkWidget *window_showchange_c_8; /* from showchange.c 392 */ |
860 | 861 | void (*cleanup_showchange_c_6)(void); /* from showchange.c 393 */ |
861 | 862 | struct TraceEnt *tcache_showchange_c_1; /* from showchange.c 394 */ |
1369 | 1370 | TimeType ruler_origin; |
1370 | 1371 | TimeType ruler_step; |
1371 | 1372 | char fill_waveform; |
1373 | char lz_removal; | |
1372 | 1374 | gboolean save_on_exit; |
1373 | 1375 | |
1374 | 1376 |
21 | 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
22 | 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
23 | 23 | THE SOFTWARE. |
24 | ||
25 | SPDX-License-Identifier: MIT | |
24 | 26 | */ |
25 | 27 | |
26 | 28 | #include "fastlz.h" |
21 | 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
22 | 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
23 | 23 | THE SOFTWARE. |
24 | ||
25 | SPDX-License-Identifier: MIT | |
24 | 26 | */ |
25 | 27 | |
26 | 28 | #ifndef FASTLZ_H |
17 | 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
18 | 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
19 | 19 | * DEALINGS IN THE SOFTWARE. |
20 | * | |
21 | * SPDX-License-Identifier: MIT | |
20 | 22 | */ |
21 | 23 | |
22 | 24 | /* |
791 | 793 | pthread_attr_t thread_attr; |
792 | 794 | struct fstWriterContext *xc_parent; |
793 | 795 | #endif |
796 | unsigned in_pthread : 1; | |
794 | 797 | |
795 | 798 | size_t fst_orig_break_size; |
796 | 799 | size_t fst_orig_break_add_size; |
1023 | 1026 | |
1024 | 1027 | static void fstDestroyMmaps(struct fstWriterContext *xc, int is_closing) |
1025 | 1028 | { |
1029 | #if !defined __CYGWIN__ && !defined __MINGW32__ | |
1026 | 1030 | (void)is_closing; |
1031 | #endif | |
1027 | 1032 | |
1028 | 1033 | fstMunmap(xc->valpos_mem, xc->maxhandle * 4 * sizeof(uint32_t)); |
1029 | 1034 | xc->valpos_mem = NULL; |
1800 | 1805 | static void *fstWriterFlushContextPrivate1(void *ctx) |
1801 | 1806 | { |
1802 | 1807 | struct fstWriterContext *xc = (struct fstWriterContext *)ctx; |
1803 | ||
1808 | struct fstWriterContext *xc_parent; | |
1809 | ||
1810 | pthread_mutex_lock(&(xc->xc_parent->mutex)); | |
1804 | 1811 | fstWriterFlushContextPrivate2(xc); |
1805 | ||
1806 | pthread_mutex_unlock(&(xc->xc_parent->mutex)); | |
1807 | 1812 | |
1808 | 1813 | #ifdef FST_REMOVE_DUPLICATE_VC |
1809 | 1814 | free(xc->curval_mem); |
1811 | 1816 | free(xc->valpos_mem); |
1812 | 1817 | free(xc->vchg_mem); |
1813 | 1818 | tmpfile_close(&xc->tchn_handle, &xc->tchn_handle_nam); |
1819 | xc_parent = xc->xc_parent; | |
1814 | 1820 | free(xc); |
1821 | ||
1822 | xc_parent->in_pthread = 0; | |
1823 | pthread_mutex_unlock(&(xc_parent->mutex)); | |
1815 | 1824 | |
1816 | 1825 | return(NULL); |
1817 | 1826 | } |
1860 | 1869 | xc->section_header_only = 0; |
1861 | 1870 | xc->secnum++; |
1862 | 1871 | |
1872 | while (xc->in_pthread) | |
1873 | { | |
1874 | pthread_mutex_lock(&xc->mutex); | |
1875 | pthread_mutex_unlock(&xc->mutex); | |
1876 | }; | |
1877 | ||
1863 | 1878 | pthread_mutex_lock(&xc->mutex); |
1879 | xc->in_pthread = 1; | |
1880 | pthread_mutex_unlock(&xc->mutex); | |
1864 | 1881 | |
1865 | 1882 | pthread_create(&xc->thread, &xc->thread_attr, fstWriterFlushContextPrivate1, xc2); |
1866 | 1883 | } |
1942 | 1959 | #ifdef FST_WRITER_PARALLEL |
1943 | 1960 | pthread_mutex_lock(&xc->mutex); |
1944 | 1961 | pthread_mutex_unlock(&xc->mutex); |
1962 | ||
1963 | while (xc->in_pthread) | |
1964 | { | |
1965 | pthread_mutex_lock(&xc->mutex); | |
1966 | pthread_mutex_unlock(&xc->mutex); | |
1967 | }; | |
1945 | 1968 | #endif |
1946 | 1969 | } |
1947 | 1970 | } |
17 | 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
18 | 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
19 | 19 | * DEALINGS IN THE SOFTWARE. |
20 | * | |
21 | * SPDX-License-Identifier: MIT | |
20 | 22 | */ |
21 | 23 | |
22 | 24 | #ifndef FST_API_H |
25 | 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 | 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | ||
29 | SPDX-License-Identifier: BSD-2-Clause | |
28 | 30 | |
29 | 31 | You can contact the author at : |
30 | 32 | - LZ4 source repository : https://github.com/Cyan4973/lz4 |
26 | 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 | 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 | 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | ||
30 | SPDX-License-Identifier: BSD-2-Clause | |
29 | 31 | |
30 | 32 | You can contact the author at : |
31 | 33 | - LZ4 source repository : https://github.com/Cyan4973/lz4 |
1858 | 1858 | msk = (~0U << lt->timepos); |
1859 | 1859 | msk_n = ~msk; |
1860 | 1860 | |
1861 | if(!lt->emitted) | |
1862 | { | |
1863 | vzt_wr_emitfacs(lt); | |
1864 | lt->emitted = 1; | |
1865 | ||
1866 | if(!lt->timeset) | |
1867 | { | |
1868 | vzt_wr_set_time(lt, 0); | |
1869 | } | |
1870 | } | |
1871 | ||
1861 | 1872 | for(j=0;j<lt->numfacs;j++) |
1862 | 1873 | { |
1863 | 1874 | struct vzt_wr_symbol *s = lt->sorted_facs[j]; |
116 | 116 | GLOBALS->display_grid = g_old->display_grid; |
117 | 117 | GLOBALS->highlight_wavewindow = g_old->highlight_wavewindow; |
118 | 118 | GLOBALS->fill_waveform = g_old->fill_waveform; |
119 | GLOBALS->lz_removal = g_old->lz_removal; | |
119 | 120 | GLOBALS->use_standard_trace_select = g_old->use_standard_trace_select; |
120 | 121 | GLOBALS->disable_mouseover = g_old->disable_mouseover; |
121 | 122 | GLOBALS->clipboard_mouseover = g_old->clipboard_mouseover; |
633 | 634 | GLOBALS->enable_ghost_marker = old_g->enable_ghost_marker; |
634 | 635 | GLOBALS->enable_horiz_grid = old_g->enable_horiz_grid; |
635 | 636 | GLOBALS->fill_waveform = old_g->fill_waveform; |
637 | GLOBALS->lz_removal = old_g->lz_removal; | |
636 | 638 | GLOBALS->make_vcd_save_file = old_g->make_vcd_save_file; |
637 | 639 | GLOBALS->enable_vert_grid = old_g->enable_vert_grid; |
638 | 640 | GLOBALS->force_toolbars = old_g->force_toolbars; |
648 | 650 | GLOBALS->show_base = old_g->show_base; |
649 | 651 | GLOBALS->display_grid = old_g->display_grid; |
650 | 652 | GLOBALS->highlight_wavewindow = old_g->highlight_wavewindow; |
651 | GLOBALS->fill_waveform = old_g->fill_waveform; | |
652 | 653 | GLOBALS->use_standard_trace_select = old_g->use_standard_trace_select; |
653 | 654 | GLOBALS->use_big_fonts = old_g->use_big_fonts; |
654 | 655 | GLOBALS->use_full_precision = old_g->use_full_precision; |
4482 | 4482 | t=GLOBALS->showchangeall_menu_c_1; |
4483 | 4483 | if(t) |
4484 | 4484 | { |
4485 | flags = t->flags & (TR_NUMMASK | TR_HIGHLIGHT); | |
4485 | flags = t->flags & (TR_NUMMASK | TR_HIGHLIGHT | TR_ATTRIBS); | |
4486 | 4486 | while(t) |
4487 | 4487 | { |
4488 | 4488 | if((t->flags&TR_HIGHLIGHT)&&(!(t->flags&(TR_BLANK|TR_ANALOG_BLANK_STRETCH)))&&(t->name)) |
4489 | 4489 | { |
4490 | t->flags = (t->flags & ~(TR_NUMMASK | TR_HIGHLIGHT)) | flags; | |
4490 | t->flags = (t->flags & ~(TR_NUMMASK | TR_HIGHLIGHT | TR_ATTRIBS)) | flags; | |
4491 | 4491 | t->minmax_valid = 0; /* force analog traces to regenerate if necessary */ |
4492 | 4492 | } |
4493 | 4493 | t=t->t_next; |
6770 | 6770 | dataformat( ~(TR_POPCNT), 0 ); |
6771 | 6771 | } |
6772 | 6772 | |
6773 | void | |
6774 | menu_dataformat_ffo_on(gpointer null_data, guint callback_action, GtkWidget *widget) | |
6775 | { | |
6776 | (void)null_data; | |
6777 | (void)callback_action; | |
6778 | (void)widget; | |
6779 | ||
6780 | if(GLOBALS->helpbox_is_active) | |
6781 | { | |
6782 | help_text_bold("\n\nData Format-Find First Rightmost One Index-On"); | |
6783 | help_text( | |
6784 | " will step through all highlighted traces and ensure that" | |
6785 | " bits and vectors with this qualifier will be displayed after" | |
6786 | " going through a right->left FFO index conversion. This is a filter" | |
6787 | " which sits before other Data Format options such as hex, etc." | |
6788 | ); | |
6789 | return; | |
6790 | } | |
6791 | ||
6792 | dataformat( ~(TR_FFO), TR_FFO ); | |
6793 | } | |
6794 | ||
6795 | void | |
6796 | menu_dataformat_ffo_off(gpointer null_data, guint callback_action, GtkWidget *widget) | |
6797 | { | |
6798 | (void)null_data; | |
6799 | (void)callback_action; | |
6800 | (void)widget; | |
6801 | ||
6802 | if(GLOBALS->helpbox_is_active) | |
6803 | { | |
6804 | help_text_bold("\n\nData Format-Find First Rightmost One Index-Off"); | |
6805 | help_text( | |
6806 | " will step through all highlighted traces and ensure that" | |
6807 | " bits and vectors with this qualifier will be displayed with" | |
6808 | " normal encoding." | |
6809 | ); | |
6810 | return; | |
6811 | } | |
6812 | ||
6813 | dataformat( ~(TR_FFO), 0 ); | |
6814 | } | |
6815 | ||
6773 | 6816 | |
6774 | 6817 | void |
6775 | 6818 | menu_dataformat_time(gpointer null_data, guint callback_action, GtkWidget *widget) |
7783 | 7826 | |
7784 | 7827 | #ifndef WAVE_USE_MLIST_T |
7785 | 7828 | GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget(GLOBALS->item_factory_menu_c_1, menu_items[WV_MENU_FILL1].path))->active=(GLOBALS->fill_waveform)?TRUE:FALSE; |
7829 | #endif | |
7830 | } | |
7831 | ||
7832 | /**/ | |
7833 | void menu_lz_removal(gpointer null_data, guint callback_action, GtkWidget *widget) | |
7834 | { | |
7835 | (void)null_data; | |
7836 | (void)callback_action; | |
7837 | (void)widget; | |
7838 | ||
7839 | if(GLOBALS->helpbox_is_active) | |
7840 | { | |
7841 | help_text_bold("\n\nShow Filled High Values"); | |
7842 | help_text( | |
7843 | " toggles the display of leading zeros on non-filtered traces. This has no effect on filtered traces." | |
7844 | ); | |
7845 | } | |
7846 | else | |
7847 | { | |
7848 | #ifndef WAVE_USE_MLIST_T | |
7849 | GLOBALS->lz_removal=(GLOBALS->lz_removal)?0:~0; | |
7850 | #else | |
7851 | GLOBALS->lz_removal = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu_wlist[WV_MENU_LZ_REMOVAL])); | |
7852 | #endif | |
7853 | if(GLOBALS->signalarea && GLOBALS->wavearea) | |
7854 | { | |
7855 | GLOBALS->signalwindow_width_dirty=1; | |
7856 | MaxSignalLength(); | |
7857 | signalarea_configure_event(GLOBALS->signalarea, NULL); | |
7858 | wavearea_configure_event(GLOBALS->wavearea, NULL); | |
7859 | } | |
7860 | DEBUG(printf("Leading Zero Removal\n")); | |
7861 | } | |
7862 | ||
7863 | #ifndef WAVE_USE_MLIST_T | |
7864 | GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget(GLOBALS->item_factory_menu_c_1, menu_items[WV_MENU_LZ_REMOVAL].path))->active=(GLOBALS->lz_removal)?TRUE:FALSE; | |
7786 | 7865 | #endif |
7787 | 7866 | } |
7788 | 7867 | |
7989 | 8068 | WAVE_GTKIFE("/Edit/Data Format/Gray Filters/None", NULL, menu_dataformat_nogray, WV_MENU_GBNONE, "<Item>"), |
7990 | 8069 | WAVE_GTKIFE("/Edit/Data Format/Popcnt/On", NULL, menu_dataformat_popcnt_on, WV_MENU_POPON, "<Item>"), |
7991 | 8070 | WAVE_GTKIFE("/Edit/Data Format/Popcnt/Off", NULL, menu_dataformat_popcnt_off, WV_MENU_POPOFF, "<Item>"), |
8071 | WAVE_GTKIFE("/Edit/Data Format/Find First One/On", NULL, menu_dataformat_ffo_on, WV_MENU_FFOON, "<Item>"), | |
8072 | WAVE_GTKIFE("/Edit/Data Format/Find First One/Off", NULL, menu_dataformat_ffo_off, WV_MENU_FFOOFF, "<Item>"), | |
7992 | 8073 | WAVE_GTKIFE("/Edit/Data Format/Fixed Point Shift/On", NULL, menu_dataformat_fpshift_on, WV_MENU_FPSHIFTON, "<Item>"), |
7993 | 8074 | WAVE_GTKIFE("/Edit/Data Format/Fixed Point Shift/Off", NULL, menu_dataformat_fpshift_off, WV_MENU_FPSHIFTOFF, "<Item>"), |
7994 | 8075 | WAVE_GTKIFE("/Edit/Data Format/Fixed Point Shift/Specify", NULL, menu_dataformat_fpshift_specify, WV_MENU_FPSHIFTVAL, "<Item>"), |
8107 | 8188 | WAVE_GTKIFE("/View/<separator>", NULL, NULL, WV_MENU_SEP9, "<Separator>"), |
8108 | 8189 | WAVE_GTKIFE("/View/Show Wave Highlight", NULL, menu_show_wave_highlight, WV_MENU_SHW, "<ToggleItem>"), |
8109 | 8190 | WAVE_GTKIFE("/View/Show Filled High Values", NULL, menu_show_filled_high_values, WV_MENU_FILL1, "<ToggleItem>"), |
8191 | WAVE_GTKIFE("/View/Leading Zero Removal", NULL, menu_lz_removal, WV_MENU_LZ_REMOVAL, "<ToggleItem>"), | |
8110 | 8192 | WAVE_GTKIFE("/View/<separator>", NULL, NULL, WV_MENU_SEP9B, "<Separator>"), |
8111 | 8193 | WAVE_GTKIFE("/View/Show Mouseover", NULL, menu_show_mouseover, WV_MENU_VSMO, "<ToggleItem>"), |
8112 | 8194 | #ifdef WAVE_USE_GTK2 |
8238 | 8320 | |
8239 | 8321 | GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget(GLOBALS->item_factory_menu_c_1, menu_items[WV_MENU_FILL1].path))->active=(GLOBALS->fill_waveform)?TRUE:FALSE; |
8240 | 8322 | |
8323 | GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget(GLOBALS->item_factory_menu_c_1, menu_items[WV_MENU_LZ_REMOVAL].path))->active=(GLOBALS->lz_removal)?TRUE:FALSE; | |
8324 | ||
8241 | 8325 | GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget(GLOBALS->item_factory_menu_c_1, menu_items[WV_MENU_HSWM].path))->active=(GLOBALS->alt_wheel_mode)?TRUE:FALSE; |
8242 | 8326 | |
8243 | 8327 | GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget(GLOBALS->item_factory_menu_c_1,menu_items[WV_MENU_VSMO].path))->active=(GLOBALS->disable_mouseover)?FALSE:TRUE; |
8294 | 8378 | gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_wlist[WV_MENU_VSG]), GLOBALS->display_grid); |
8295 | 8379 | gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_wlist[WV_MENU_SHW]), GLOBALS->highlight_wavewindow); |
8296 | 8380 | gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_wlist[WV_MENU_FILL1]), GLOBALS->fill_waveform); |
8381 | gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_wlist[WV_MENU_LZ_REMOVAL]), GLOBALS->lz_removal); | |
8297 | 8382 | gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_wlist[WV_MENU_HSWM]), GLOBALS->alt_wheel_mode); |
8298 | 8383 | |
8299 | 8384 | gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_wlist[WV_MENU_VSMO]), !GLOBALS->disable_mouseover); |
8695 | 8780 | WAVE_GTKIFE("/Data Format/Gray Filters/None", NULL, menu_dataformat_nogray, WV_MENU_GBNONE, "<Item>"), |
8696 | 8781 | WAVE_GTKIFE("/Data Format/Popcnt/On", NULL, menu_dataformat_popcnt_on, WV_MENU_POPON, "<Item>"), |
8697 | 8782 | WAVE_GTKIFE("/Data Format/Popcnt/Off", NULL, menu_dataformat_popcnt_off, WV_MENU_POPOFF, "<Item>"), |
8783 | WAVE_GTKIFE("/Data Format/Find First One/On", NULL, menu_dataformat_ffo_on, WV_MENU_FFOON, "<Item>"), | |
8784 | WAVE_GTKIFE("/Data Format/Find First One/Off", NULL, menu_dataformat_ffo_off, WV_MENU_FFOOFF, "<Item>"), | |
8698 | 8785 | WAVE_GTKIFE("/Data Format/Fixed Point Shift/On", NULL, menu_dataformat_fpshift_on, WV_MENU_FPSHIFTON, "<Item>"), |
8699 | 8786 | WAVE_GTKIFE("/Data Format/Fixed Point Shift/Off", NULL, menu_dataformat_fpshift_off, WV_MENU_FPSHIFTOFF, "<Item>"), |
8700 | 8787 | WAVE_GTKIFE("/Data Format/Fixed Point Shift/Specify", NULL, menu_dataformat_fpshift_specify, WV_MENU_FPSHIFTVAL, "<Item>"), |
166 | 166 | WV_MENU_GBNONE, |
167 | 167 | WV_MENU_POPON, |
168 | 168 | WV_MENU_POPOFF, |
169 | WV_MENU_FFOON, | |
170 | WV_MENU_FFOOFF, | |
169 | 171 | WV_MENU_FPSHIFTON, |
170 | 172 | WV_MENU_FPSHIFTOFF, |
171 | 173 | WV_MENU_FPSHIFTVAL, |
263 | 265 | WV_MENU_SEP9, |
264 | 266 | WV_MENU_SHW, |
265 | 267 | WV_MENU_FILL1, |
268 | WV_MENU_LZ_REMOVAL, | |
266 | 269 | WV_MENU_SEP9B, |
267 | 270 | WV_MENU_VSMO, |
268 | 271 | #ifdef WAVE_USE_GTK2 |
83 | 83 | if((flags & TR_TTRANSLATED) != 0) { ch[pos++] = 'T'; } |
84 | 84 | |
85 | 85 | /* [14] */ |
86 | if((flags & TR_FFO) != 0) { ch[pos++] = 'f'; } | |
87 | ||
88 | /* [15] */ | |
86 | 89 | if((flags & TR_POPCNT) != 0) { ch[pos++] = 'p'; } |
87 | 90 | |
88 | /* [15] */ | |
91 | /* [16] */ | |
89 | 92 | if((flags & TR_FPDECSHIFT) != 0) |
90 | 93 | { |
91 | 94 | int ln = sprintf(ch+pos, "s(%d)", t->t_fpdecshift); |
92 | 95 | pos += ln; |
93 | 96 | } |
94 | 97 | |
95 | /* [16+] */ | |
98 | /* [17+] */ | |
96 | 99 | ch[pos] = 0; |
97 | 100 | |
98 | 101 | return(pos); |
109 | 109 | if((flags & TR_TTRANSLATED) != 0) { ch[pos++] = 'T'; } |
110 | 110 | |
111 | 111 | /* [14] */ |
112 | if((flags & TR_FFO) != 0) { ch[pos++] = 'f'; } | |
113 | ||
114 | /* [15] */ | |
112 | 115 | if((flags & TR_POPCNT) != 0) { ch[pos++] = 'p'; } |
113 | 116 | |
114 | /* [15] */ | |
117 | /* [16] */ | |
115 | 118 | if((flags & TR_FPDECSHIFT) != 0) |
116 | 119 | { |
117 | 120 | int ln = sprintf(ch+pos, "s(%d)", t->t_fpdecshift); |
118 | 121 | pos += ln; |
119 | 122 | } |
120 | 123 | |
121 | /* [16+] */ | |
124 | /* [17+] */ | |
122 | 125 | ch[pos] = 0; |
123 | 126 | |
124 | 127 | if(!t->vector) |
276 | 276 | { |
277 | 277 | DEBUG(printf("f_fill_waveform(\"%s\")\n",str)); |
278 | 278 | GLOBALS->fill_waveform=atoi_64(str)?1:0; |
279 | return(0); | |
280 | } | |
281 | ||
282 | int f_lz_removal(char *str) | |
283 | { | |
284 | DEBUG(printf("f_lz_removal(\"%s\")\n",str)); | |
285 | GLOBALS->lz_removal=atoi_64(str)?1:0; | |
279 | 286 | return(0); |
280 | 287 | } |
281 | 288 | |
941 | 948 | { "keep_xz_colors", f_keep_xz_colors }, |
942 | 949 | { "left_justify_sigs", f_left_justify_sigs }, |
943 | 950 | { "lxt_clock_compress_to_z", f_lxt_clock_compress_to_z }, |
951 | { "lz_removal", f_lz_removal }, | |
944 | 952 | { "max_fsdb_trees", f_max_fsdb_trees }, |
945 | 953 | { "page_divisor", f_page_divisor }, |
946 | 954 | { "ps_maxveclen", f_ps_maxveclen }, |
1097 | 1105 | |
1098 | 1106 | void read_rc_file(char *override_rc) |
1099 | 1107 | { |
1100 | FILE *handle; | |
1108 | FILE *handle = NULL; | |
1101 | 1109 | int i; |
1102 | 1110 | int num_rcitems = sizeof(rcitems)/sizeof(struct rc_entry); |
1103 | 1111 | |
1122 | 1130 | #if !defined __MINGW32__ && !defined _MSC_VER |
1123 | 1131 | if(!(handle=fopen(rcname,"rb"))) |
1124 | 1132 | { |
1125 | char *home; | |
1126 | char *rcpath; | |
1127 | ||
1128 | home=getpwuid(geteuid())->pw_dir; | |
1129 | rcpath=(char *)alloca(strlen(home)+1+strlen(rcname)+1); | |
1130 | strcpy(rcpath,home); | |
1131 | strcat(rcpath,"/"); | |
1132 | strcat(rcpath,rcname); | |
1133 | ||
1134 | if(!(handle=fopen(rcpath,"rb"))) | |
1133 | struct passwd *pw = NULL; | |
1134 | char *home = NULL; | |
1135 | char *rcpath = NULL; | |
1136 | ||
1137 | pw=getpwuid(geteuid()); | |
1138 | if(pw) | |
1139 | { | |
1140 | home=pw->pw_dir; | |
1141 | } | |
1142 | ||
1143 | if(!home) | |
1144 | { | |
1145 | home = getenv("HOME"); | |
1146 | } | |
1147 | ||
1148 | if(home) | |
1149 | { | |
1150 | rcpath=(char *)alloca(strlen(home)+1+strlen(rcname)+1); | |
1151 | strcpy(rcpath,home); | |
1152 | strcat(rcpath,"/"); | |
1153 | strcat(rcpath,rcname); | |
1154 | } | |
1155 | ||
1156 | if( !rcpath || !(handle=fopen(rcpath,"rb")) ) | |
1135 | 1157 | { |
1136 | 1158 | #ifdef MAC_INTEGRATION |
1137 | 1159 | const gchar *bundle_id = gtkosx_application_get_bundle_id(); |
59 | 59 | (void)nothing; |
60 | 60 | |
61 | 61 | toggle_generic(widget, TR_POPCNT); |
62 | } | |
63 | static void toggle6_callback(GtkWidget *widget, GtkWidget *nothing) | |
64 | { | |
65 | (void)nothing; | |
66 | ||
67 | toggle_generic(widget, TR_FFO); | |
62 | 68 | } |
63 | 69 | |
64 | 70 | static void enter_callback(GtkWidget *widget, GtkWidget *nothing) |
288 | 294 | gtk_widget_show (GLOBALS->toggle5_showchange_c_1); |
289 | 295 | gtkwave_signal_connect (GTK_OBJECT (GLOBALS->toggle5_showchange_c_1), "toggled", GTK_SIGNAL_FUNC(toggle5_callback), NULL); |
290 | 296 | |
297 | GLOBALS->toggle6_showchange_c_1=gtk_check_button_new_with_label("Find First One"); | |
298 | gtk_box_pack_start (GTK_BOX (box1), GLOBALS->toggle6_showchange_c_1, TRUE, TRUE, 0); | |
299 | if(GLOBALS->flags_showchange_c_1&TR_FFO)gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(GLOBALS->toggle6_showchange_c_1), TRUE); | |
300 | gtk_widget_show (GLOBALS->toggle6_showchange_c_1); | |
301 | gtkwave_signal_connect (GTK_OBJECT (GLOBALS->toggle6_showchange_c_1), "toggled", GTK_SIGNAL_FUNC(toggle6_callback), NULL); | |
302 | ||
291 | 303 | gtk_container_add (GTK_CONTAINER (main_vbox), hbox); |
292 | 304 | |
293 | 305 | separator = gtk_hseparator_new (); |
18 | 18 | /* GDK_KEY_equal defined from gtk2 2.22 onwards. */ |
19 | 19 | #ifndef GDK_KEY_equal |
20 | 20 | #define GDK_KEY_equal GDK_equal |
21 | #endif | |
22 | #ifndef GDK_KEY_Up | |
23 | #define GDK_KEY_Up GDK_Up | |
24 | #endif | |
25 | #ifndef GDK_KEY_KP_Up | |
26 | #define GDK_KEY_KP_Up GDK_KP_Up | |
27 | #endif | |
28 | #ifndef GDK_KEY_Down | |
29 | #define GDK_KEY_Down GDK_Down | |
30 | #endif | |
31 | #ifndef GDK_KEY_KP_Down | |
32 | #define GDK_KEY_KP_Down GDK_KP_Down | |
21 | 33 | #endif |
22 | 34 | |
23 | 35 | #undef FOCUS_DEBUG_MSGS |
470 | 482 | int which; |
471 | 483 | gint rc = FALSE; |
472 | 484 | int yscroll; |
485 | int ud_kill = 0; | |
473 | 486 | |
474 | 487 | #ifdef FOCUS_DEBUG_MSGS |
475 | 488 | printf("focus: %d %08x %08x %08x\n", GTK_WIDGET_HAS_FOCUS(GLOBALS->signalarea_event_box), |
548 | 561 | num_traces_displayable=(GLOBALS->signalarea->allocation.height)/(GLOBALS->fontheight); |
549 | 562 | num_traces_displayable--; /* for the time trace that is always there */ |
550 | 563 | |
551 | if(num_traces_displayable<GLOBALS->traces.visible) | |
564 | if(event->state & GDK_SHIFT_MASK) | |
565 | { | |
566 | Trptr t = NULL, t2 = NULL; | |
567 | Trptr tc = NULL, th = NULL; | |
568 | int num_high = 0; | |
569 | ||
570 | if((event->keyval == GDK_KEY_Up) || (event->keyval == GDK_KEY_KP_Up)) | |
571 | { | |
572 | ud_kill = 1; | |
573 | for(t=GLOBALS->traces.first;t;t=t->t_next) | |
574 | { | |
575 | if(t->flags&TR_HIGHLIGHT) | |
576 | { | |
577 | if(!th) th = t; | |
578 | num_high++; | |
579 | } | |
580 | ||
581 | if(t->is_cursor) | |
582 | { | |
583 | tc = t; | |
584 | } | |
585 | } | |
586 | ||
587 | if(num_high <= 1) | |
588 | { | |
589 | t = th ? GivePrevTrace(th) : GLOBALS->topmost_trace; | |
590 | } | |
591 | else | |
592 | { | |
593 | t = tc ? GivePrevTrace(tc) : GLOBALS->topmost_trace; | |
594 | } | |
595 | ||
596 | MarkTraceCursor(t); | |
597 | } | |
598 | else | |
599 | if((event->keyval == GDK_KEY_Down) || (event->keyval == GDK_KEY_KP_Down)) | |
600 | { | |
601 | ud_kill = 1; | |
602 | for(t=GLOBALS->traces.first;t;t=t->t_next) | |
603 | { | |
604 | if(t->flags&TR_HIGHLIGHT) | |
605 | { | |
606 | th = t; | |
607 | num_high++; | |
608 | } | |
609 | if(t->is_cursor) | |
610 | { | |
611 | tc = t; | |
612 | } | |
613 | } | |
614 | ||
615 | if(num_high <= 1) | |
616 | { | |
617 | t = th ? GiveNextTrace(th) : GLOBALS->topmost_trace; | |
618 | } | |
619 | else | |
620 | { | |
621 | if(tc) | |
622 | { | |
623 | t = GiveNextTrace(tc); | |
624 | } | |
625 | else | |
626 | { | |
627 | t = th ? GiveNextTrace(th) : GLOBALS->topmost_trace; | |
628 | } | |
629 | } | |
630 | ||
631 | MarkTraceCursor(t); | |
632 | } | |
633 | ||
634 | if(t) | |
635 | { | |
636 | int top_target = 0; | |
637 | target = 0; | |
638 | which=num_traces_displayable-1; | |
639 | ||
640 | ClearTraces(); | |
641 | t->flags |= TR_HIGHLIGHT; | |
642 | t2 = t; | |
643 | ||
644 | for(t=GLOBALS->traces.first;t;t=GiveNextTrace(t)) | |
645 | { | |
646 | if(t == GLOBALS->topmost_trace) break; | |
647 | top_target++; | |
648 | } | |
649 | ||
650 | for(t=GLOBALS->traces.first;t;t=GiveNextTrace(t)) | |
651 | { | |
652 | if(t2 == t) break; | |
653 | target++; | |
654 | } | |
655 | ||
656 | if((target >= top_target) && (target <= top_target+which)) | |
657 | { | |
658 | /* nothing */ | |
659 | } | |
660 | else | |
661 | { | |
662 | if((event->keyval == GDK_KEY_Up) || (event->keyval == GDK_KEY_KP_Up)) | |
663 | { | |
664 | if(target<0) target=0; | |
665 | } | |
666 | else | |
667 | if((event->keyval == GDK_KEY_Down) || (event->keyval == GDK_KEY_KP_Down)) | |
668 | { | |
669 | target = target - which; | |
670 | if(target+which>=(GLOBALS->traces.visible-1)) target=GLOBALS->traces.visible-which-1; | |
671 | } | |
672 | ||
673 | wadj->value = target; | |
674 | } | |
675 | ||
676 | if(GLOBALS->cachedwhich_signalwindow_c_1==which) GLOBALS->cachedwhich_signalwindow_c_1=which-1; /* force update */ | |
677 | ||
678 | gtk_signal_emit_by_name (GTK_OBJECT (wadj), "changed"); /* force bar update */ | |
679 | gtk_signal_emit_by_name (GTK_OBJECT (wadj), "value_changed"); /* force text update */ | |
680 | signalarea_configure_event(GLOBALS->signalarea, NULL); | |
681 | wavearea_configure_event(GLOBALS->wavearea, NULL); | |
682 | } | |
683 | } | |
684 | ||
685 | if((num_traces_displayable<GLOBALS->traces.visible) && (!ud_kill)) | |
552 | 686 | { |
553 | 687 | switch(event->keyval) |
554 | 688 | { |
567 | 701 | |
568 | 702 | gtk_signal_emit_by_name (GTK_OBJECT (wadj), "changed"); /* force bar update */ |
569 | 703 | gtk_signal_emit_by_name (GTK_OBJECT (wadj), "value_changed"); /* force text update */ |
704 | signalarea_configure_event(GLOBALS->signalarea, NULL); | |
705 | wavearea_configure_event(GLOBALS->wavearea, NULL); | |
570 | 706 | break; |
571 | 707 | |
572 | 708 | case GDK_Up: |
1227 | 1363 | } |
1228 | 1364 | else |
1229 | 1365 | { |
1230 | t->flags ^= TR_HIGHLIGHT; | |
1366 | t->flags ^= TR_HIGHLIGHT; MarkTraceCursor(t); | |
1231 | 1367 | } |
1232 | 1368 | } |
1233 | 1369 | } |
1234 | 1370 | else |
1235 | 1371 | if((event->state&GDK_SHIFT_MASK)&&(GLOBALS->starting_unshifted_trace)) |
1236 | 1372 | { |
1237 | int src = -1, dst = -1; | |
1373 | int src = -1, dst = -1, dsto = -1; | |
1238 | 1374 | int cnt = 0; |
1239 | 1375 | |
1240 | 1376 | t2=GLOBALS->traces.first; |
1264 | 1400 | cnt++; |
1265 | 1401 | } |
1266 | 1402 | |
1403 | dsto = dst; | |
1267 | 1404 | if(src > dst) { int cpy; cpy = src; src = dst; dst = cpy; } |
1268 | 1405 | cnt = 0; |
1269 | 1406 | t2=GLOBALS->traces.first; |
1274 | 1411 | t2->flags |= TR_HIGHLIGHT; |
1275 | 1412 | } |
1276 | 1413 | |
1414 | if(cnt == dsto) { MarkTraceCursor(t2); } | |
1415 | ||
1277 | 1416 | cnt++; |
1278 | 1417 | t2=t2->t_next; |
1279 | 1418 | } |
1297 | 1436 | t2 = t2->t_next; |
1298 | 1437 | } |
1299 | 1438 | |
1300 | if(t) { t->flags |= TR_HIGHLIGHT; } /* scan-build */ | |
1439 | if(t) { t->flags |= TR_HIGHLIGHT; MarkTraceCursor(t); } /* scan-build */ | |
1301 | 1440 | } |
1302 | 1441 | |
1303 | 1442 | GLOBALS->standard_trace_dnd_degate = 0; |
351 | 351 | |
352 | 352 | while(tnext) |
353 | 353 | { |
354 | if(tnext->child) treenamefix(tnext->child); | |
354 | 355 | if(tnext->name) treenamefix_str(tnext->name); |
355 | 356 | tnext=tnext->next; |
356 | 357 | } |
2212 | 2212 | str=(slen>max_slen)?(wave_alloca((max_slen=slen)+32)):(str); /* more than enough */ |
2213 | 2213 | strcpy(str,v->name); |
2214 | 2214 | |
2215 | if(v->msi>=0) | |
2215 | if((v->msi>=0)||(v->msi != v->lsi)) | |
2216 | 2216 | { |
2217 | 2217 | strcpy(str+slen,GLOBALS->vcd_hier_delimeter); |
2218 | 2218 | slen++; |
2054 | 2054 | str=(slen>max_slen)?(wave_alloca((max_slen=slen)+32)):(str); /* more than enough */ |
2055 | 2055 | strcpy(str,v->name); |
2056 | 2056 | |
2057 | if(v->msi>=0) | |
2057 | if((v->msi>=0)||(v->msi != v->lsi)) | |
2058 | 2058 | { |
2059 | 2059 | strcpy(str+slen,GLOBALS->vcd_hier_delimeter); |
2060 | 2060 | slen++; |
2447 | 2447 | str=(slen>max_slen)?(wave_alloca((max_slen=slen)+32)):(str); /* more than enough */ |
2448 | 2448 | strcpy(str,v->name); |
2449 | 2449 | |
2450 | if(v->msi>=0) | |
2450 | if((v->msi>=0)||(v->msi != v->lsi)) | |
2451 | 2451 | { |
2452 | 2452 | strcpy(str+slen,GLOBALS->vcd_hier_delimeter); |
2453 | 2453 | slen++; |
17 | 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
18 | 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
19 | 19 | * DEALINGS IN THE SOFTWARE. |
20 | * | |
21 | * SPDX-License-Identifier: MIT | |
20 | 22 | */ |
21 | 23 | |
22 | 24 | #ifndef WAVE_ALLOCA_H |
3236 | 3236 | yu=(_y0+_y1)/2; |
3237 | 3237 | ytext=yu-(GLOBALS->wavefont->ascent/2)+GLOBALS->wavefont->ascent; |
3238 | 3238 | |
3239 | if((GLOBALS->highlight_wavewindow) && (t) && (t->flags & TR_HIGHLIGHT) && (!GLOBALS->black_and_white)&&(!kill_grid)) | |
3240 | { | |
3241 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
3242 | TRUE,0, liney - GLOBALS->fontheight, | |
3243 | GLOBALS->wavewidth, GLOBALS->fontheight); | |
3244 | } | |
3245 | else | |
3239 | 3246 | if((GLOBALS->display_grid)&&(GLOBALS->enable_horiz_grid)&&(!kill_grid)) |
3240 | 3247 | { |
3241 | if((GLOBALS->highlight_wavewindow) && (t) && (t->flags & TR_HIGHLIGHT) && (!GLOBALS->black_and_white)) | |
3242 | { | |
3243 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
3244 | TRUE,0, liney - GLOBALS->fontheight, | |
3245 | GLOBALS->wavewidth, GLOBALS->fontheight); | |
3246 | } | |
3247 | else | |
3248 | { | |
3249 | gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
3250 | (GLOBALS->tims.start<GLOBALS->tims.first)?(GLOBALS->tims.first-GLOBALS->tims.start)*GLOBALS->pxns:0, liney,(GLOBALS->tims.last<=GLOBALS->tims.end)?(GLOBALS->tims.last-GLOBALS->tims.start)*GLOBALS->pxns:GLOBALS->wavewidth-1, liney); | |
3251 | } | |
3248 | gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
3249 | (GLOBALS->tims.start<GLOBALS->tims.first)?(GLOBALS->tims.first-GLOBALS->tims.start)*GLOBALS->pxns:0, liney,(GLOBALS->tims.last<=GLOBALS->tims.end)?(GLOBALS->tims.last-GLOBALS->tims.start)*GLOBALS->pxns:GLOBALS->wavewidth-1, liney); | |
3252 | 3250 | } |
3253 | 3251 | |
3254 | 3252 | if((h)&&(GLOBALS->tims.start==h->time)) |
3995 | 3993 | yu=(_y0+_y1)/2; |
3996 | 3994 | ytext=yu-(GLOBALS->wavefont->ascent/2)+GLOBALS->wavefont->ascent; |
3997 | 3995 | |
3998 | if((GLOBALS->display_grid)&&(GLOBALS->enable_horiz_grid)) | |
3996 | if((GLOBALS->highlight_wavewindow) && (t) && (t->flags & TR_HIGHLIGHT) && (!GLOBALS->black_and_white)) | |
3999 | 3997 | { |
4000 | 3998 | Trptr tn = GiveNextTrace(t); |
4001 | 3999 | if((t->flags & TR_ANALOGMASK) && (tn) && (tn->flags & TR_ANALOG_BLANK_STRETCH)) |
4002 | 4000 | { |
4003 | if((GLOBALS->highlight_wavewindow) && (t) && (t->flags & TR_HIGHLIGHT) && (!GLOBALS->black_and_white)) | |
4004 | { | |
4005 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
4006 | TRUE,0, liney - GLOBALS->fontheight, | |
4007 | GLOBALS->wavewidth, GLOBALS->fontheight); | |
4008 | } | |
4001 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
4002 | TRUE,0, liney - GLOBALS->fontheight, | |
4003 | GLOBALS->wavewidth, GLOBALS->fontheight); | |
4009 | 4004 | } |
4010 | 4005 | else |
4011 | { | |
4012 | if((GLOBALS->highlight_wavewindow) && (t) && (t->flags & TR_HIGHLIGHT) && (!GLOBALS->black_and_white)) | |
4013 | { | |
4014 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
4015 | TRUE,0, liney - GLOBALS->fontheight, | |
4016 | GLOBALS->wavewidth, GLOBALS->fontheight); | |
4017 | } | |
4018 | else | |
4019 | { | |
4020 | gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
4021 | (GLOBALS->tims.start<GLOBALS->tims.first)?(GLOBALS->tims.first-GLOBALS->tims.start)*GLOBALS->pxns:0, liney,(GLOBALS->tims.last<=GLOBALS->tims.end)?(GLOBALS->tims.last-GLOBALS->tims.start)*GLOBALS->pxns:GLOBALS->wavewidth-1, liney); | |
4022 | } | |
4006 | { | |
4007 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
4008 | TRUE,0, liney - GLOBALS->fontheight, | |
4009 | GLOBALS->wavewidth, GLOBALS->fontheight); | |
4010 | } | |
4011 | } | |
4012 | else | |
4013 | if((GLOBALS->display_grid)&&(GLOBALS->enable_horiz_grid)) | |
4014 | { | |
4015 | Trptr tn = GiveNextTrace(t); | |
4016 | if((t->flags & TR_ANALOGMASK) && (tn) && (tn->flags & TR_ANALOG_BLANK_STRETCH)) | |
4017 | { | |
4018 | } | |
4019 | else | |
4020 | { | |
4021 | gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
4022 | (GLOBALS->tims.start<GLOBALS->tims.first)?(GLOBALS->tims.first-GLOBALS->tims.start)*GLOBALS->pxns:0, liney,(GLOBALS->tims.last<=GLOBALS->tims.end)?(GLOBALS->tims.last-GLOBALS->tims.start)*GLOBALS->pxns:GLOBALS->wavewidth-1, liney); | |
4023 | 4023 | } |
4024 | 4024 | } |
4025 | 4025 | |
4816 | 4816 | yu=(_y0+_y1)/2; |
4817 | 4817 | ytext=yu-(GLOBALS->wavefont->ascent/2)+GLOBALS->wavefont->ascent; |
4818 | 4818 | |
4819 | if((GLOBALS->display_grid)&&(GLOBALS->enable_horiz_grid)) | |
4819 | if((GLOBALS->highlight_wavewindow) && (t) && (t->flags & TR_HIGHLIGHT) && (!GLOBALS->black_and_white)) | |
4820 | 4820 | { |
4821 | 4821 | Trptr tn = GiveNextTrace(t); |
4822 | 4822 | if((t->flags & TR_ANALOGMASK) && (tn) && (tn->flags & TR_ANALOG_BLANK_STRETCH)) |
4823 | 4823 | { |
4824 | if((GLOBALS->highlight_wavewindow) && (t) && (t->flags & TR_HIGHLIGHT) && (!GLOBALS->black_and_white)) | |
4825 | { | |
4826 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
4827 | TRUE,0, liney - GLOBALS->fontheight, | |
4828 | GLOBALS->wavewidth, GLOBALS->fontheight); | |
4829 | } | |
4824 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
4825 | TRUE,0, liney - GLOBALS->fontheight, | |
4826 | GLOBALS->wavewidth, GLOBALS->fontheight); | |
4830 | 4827 | } |
4831 | 4828 | else |
4832 | { | |
4833 | if((GLOBALS->highlight_wavewindow) && (t) && (t->flags & TR_HIGHLIGHT) && (!GLOBALS->black_and_white)) | |
4834 | { | |
4835 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
4836 | TRUE,0, liney - GLOBALS->fontheight, | |
4837 | GLOBALS->wavewidth, GLOBALS->fontheight); | |
4838 | } | |
4839 | else | |
4840 | { | |
4841 | gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
4842 | (GLOBALS->tims.start<GLOBALS->tims.first)?(GLOBALS->tims.first-GLOBALS->tims.start)*GLOBALS->pxns:0, liney,(GLOBALS->tims.last<=GLOBALS->tims.end)?(GLOBALS->tims.last-GLOBALS->tims.start)*GLOBALS->pxns:GLOBALS->wavewidth-1, liney); | |
4843 | } | |
4829 | { | |
4830 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
4831 | TRUE,0, liney - GLOBALS->fontheight, | |
4832 | GLOBALS->wavewidth, GLOBALS->fontheight); | |
4833 | } | |
4834 | } | |
4835 | else | |
4836 | if((GLOBALS->display_grid)&&(GLOBALS->enable_horiz_grid)) | |
4837 | { | |
4838 | Trptr tn = GiveNextTrace(t); | |
4839 | if((t->flags & TR_ANALOGMASK) && (tn) && (tn->flags & TR_ANALOG_BLANK_STRETCH)) | |
4840 | { | |
4841 | } | |
4842 | else | |
4843 | { | |
4844 | gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc.gc_grid_wavewindow_c_1, | |
4845 | (GLOBALS->tims.start<GLOBALS->tims.first)?(GLOBALS->tims.first-GLOBALS->tims.start)*GLOBALS->pxns:0, liney,(GLOBALS->tims.last<=GLOBALS->tims.end)?(GLOBALS->tims.last-GLOBALS->tims.start)*GLOBALS->pxns:GLOBALS->wavewidth-1, liney); | |
4844 | 4846 | } |
4845 | 4847 | } |
4846 | 4848 |