Imported Upstream version 3.3.6
أحمد المحمودي (Ahmed El-Mahmoudy)
14 years ago
211 | 211 | accel "/Markers/Delete Primary Marker" <Shift><Alt>M |
212 | 212 | accel "/Markers/<separator>" (null) |
213 | 213 | accel "/Markers/Wave Scrolling" F9 |
214 | accel "/Markers/Locking/Lock to Lesser Named Marker" 1 | |
215 | accel "/Markers/Locking/Lock to Greater Named Marker" 2 | |
216 | accel "/Markers/Locking/Unlock from Named Marker" 0 | |
214 | accel "/Markers/Locking/Lock to Lesser Named Marker" Q | |
215 | accel "/Markers/Locking/Lock to Greater Named Marker" W | |
216 | accel "/Markers/Locking/Unlock from Named Marker" O | |
217 | 217 | accel "/View/Show Grid" <Alt>G |
218 | 218 | accel "/View/<separator>" (null) |
219 | 219 | accel "/View/Show Mouseover" (null) |
801 | 801 | Removed resolve_lxt_alias_to field from struct fac. |
802 | 802 | Removed lxt-only lastchange field from struct fac. |
803 | 803 | Removed unused h field in struct symbol. |
804 | Removed nextinaet field if unused, recoded to symchain | |
805 | when used. | |
804 | Removed nextinaet field if unused, recoded to symchain when | |
805 | used. | |
806 | 806 | Fixed && used in logical operation for generating ExtNode. |
807 | 807 | Removed ExtNode, made inline with Node. |
808 | 808 | Deallocate symbol hash table after no longer needed. |
809 | 809 | Only allocate hash when necessary. |
810 | 810 | Added marker vs maxtime marker conflict check in |
811 | kick_partial_vcd() to ensure signal window values reflect | |
812 | data value rather than x when maxtime scrolls over the | |
813 | marker time and makes the marker visible. | |
811 | kick_partial_vcd() to ensure signal window values reflect data | |
812 | value rather than x when maxtime scrolls over the marker time | |
813 | and makes the marker visible. | |
814 | 814 | More Judy array adds for VCD. |
815 | Removed sym->selected member and replaced with 1-bit | |
816 | Judy array if enabled. | |
815 | Removed sym->selected member and replaced with 1-bit Judy array | |
816 | if enabled. | |
817 | 3.3.6 01may10 Added RealToBits menu options for displaying real numbers as | |
818 | binary values. | |
819 | Added missing break statements to terminate cases in | |
820 | bits2vector(). | |
821 | Fixed cut and paste error on FILE_FILTER_MAX versus | |
822 | PROC_FILTER_MAX. | |
823 | Reduced FILE_FILTER_MAX from 1024 down to 128. | |
824 | Added preliminary transaction filter support. | |
825 | Added transaction parser in examples/ directory. | |
826 | Updated time warp handling. | |
827 | Updated print routine to use populateBuffer(). | |
828 | Added raise to front when filename selected in filter dialogs | |
829 | as this helps with some window managers. | |
830 | Remove color for translated/transaction traces in black and | |
831 | white mode. | |
832 | Copy gc_grid_wavewindow_c_1 from gccache on reload as this was | |
833 | accidentally overwritten with gc_grid2_wavewindow_c_1 without | |
834 | adding back gc_grid_wavewindow_c_1. | |
835 | Added fstWriterSetTimescaleFromString() to fstapi.c which | |
836 | allows usage of strings such as "1ns" for the timescale. | |
837 | Incorporated FST writer optimizations. | |
838 | Incorporated some fixes suggested by cppcheck. |
0 | 0 | ########################################################################## |
1 | 1 | |
2 | GTKWave 3.3.5 Wave Viewer is Copyright (C) 1999-2010 Tony Bybell. | |
2 | GTKWave 3.3.6 Wave Viewer is Copyright (C) 1999-2010 Tony Bybell. | |
3 | 3 | Portions of GTKWave are Copyright (C) 1999-2010 Udi Finkelstein. |
4 | 4 | Context support is Copyright (C) 2007-2010 Kermin Elliott Fleming. |
5 | 5 | Trace group support is Copyright (C) 2009-2010 Donald Baltus. |
Binary diff not shown
0 | 0 | ## -*- makefile -*- |
1 | 1 | ## |
2 | 2 | |
3 | dist_examples_DATA= des.sav des.tcl des.v des.vzt | |
3 | dist_examples_DATA= des.sav des.tcl des.v des.vzt transaction.fst transaction.sav transaction.c | |
4 | 4 | examplesdir= $(pkgdatadir)/examples |
5 | 5 |
172 | 172 | sharedstatedir = @sharedstatedir@ |
173 | 173 | sysconfdir = @sysconfdir@ |
174 | 174 | target_alias = @target_alias@ |
175 | dist_examples_DATA = des.sav des.tcl des.v des.vzt | |
175 | dist_examples_DATA = des.sav des.tcl des.v des.vzt transaction.fst transaction.sav transaction.c | |
176 | 176 | examplesdir = $(pkgdatadir)/examples |
177 | 177 | all: all-am |
178 | 178 |
0 | /* | |
1 | * Copyright (c) 2010 Tony Bybell. | |
2 | * | |
3 | * Permission is hereby granted, free of charge, to any person obtaining a | |
4 | * copy of this software and associated documentation files (the "Software"), | |
5 | * to deal in the Software without restriction, including without limitation | |
6 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
7 | * and/or sell copies of the Software, and to permit persons to whom the | |
8 | * Software is furnished to do so, subject to the following conditions: | |
9 | * | |
10 | * The above copyright notice and this permission notice shall be included in | |
11 | * all copies or substantial portions of the Software. | |
12 | * | |
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
16 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
19 | * DEALINGS IN THE SOFTWARE. | |
20 | */ | |
21 | ||
22 | /* | |
23 | * to compile: gcc -o transaction transaction.c | |
24 | * then in this directory run: gtkwave transaction.fst transaction.sav | |
25 | */ | |
26 | ||
27 | #include <stdio.h> | |
28 | #include <stdlib.h> | |
29 | #include <string.h> | |
30 | #ifdef HAVE_INTTYPES_H | |
31 | #include <inttypes.h> | |
32 | #endif | |
33 | ||
34 | #define OPTIONAL_DEBUG if(1) | |
35 | ||
36 | /* | |
37 | * some structs we'll be using for event harvesting from the VCD that | |
38 | * gtkwave sends via stdin into this executable | |
39 | */ | |
40 | struct tim_t | |
41 | { | |
42 | struct tim_t *next; | |
43 | ||
44 | uint64_t tim; | |
45 | int val; | |
46 | int delta; | |
47 | }; | |
48 | ||
49 | struct event_t | |
50 | { | |
51 | struct event_t *next; | |
52 | ||
53 | uint64_t tim; | |
54 | char *name; | |
55 | }; | |
56 | ||
57 | ||
58 | int main(void) | |
59 | { | |
60 | uint64_t min_time = 0, max_time = 0; | |
61 | uint64_t tim = 0; | |
62 | int prevtim = 0; | |
63 | int prevval = 255; | |
64 | struct tim_t *t_head = NULL, *t_curr = NULL; | |
65 | struct tim_t *t_tmp; | |
66 | int hcnt; | |
67 | uint64_t control_start = 0, control_end = 0; | |
68 | int blks; | |
69 | ||
70 | struct event_t *hdr_head = NULL, *hdr_curr = NULL; | |
71 | struct event_t *data_head = NULL, *data_curr = NULL; | |
72 | ||
73 | OPTIONAL_DEBUG { fprintf(stderr, "*** t_filter executable init ***\n"); } | |
74 | ||
75 | top: /* main control loop */ | |
76 | ||
77 | hcnt = 0; | |
78 | control_start = 0; | |
79 | control_end = 0; | |
80 | blks = 0; | |
81 | ||
82 | while(1) /* reading input from stdin until data_end comment received */ | |
83 | { | |
84 | char buf[1025]; | |
85 | char *pnt = NULL; | |
86 | ||
87 | buf[0] = 0; | |
88 | pnt = fgets(buf, 1024, stdin); /* CACHE (VIA puts()) THIS INPUT TO A FILE TO DEVELOP YOUR CLIENT OFFLINE FROM GTKWAVE! */ | |
89 | ||
90 | if(buf[0]) | |
91 | { | |
92 | pnt = buf; | |
93 | while(*pnt) /* strip off end of line character */ | |
94 | { | |
95 | if(*pnt != '\n') | |
96 | { | |
97 | pnt++; | |
98 | } | |
99 | else | |
100 | { | |
101 | *pnt = 0; | |
102 | break; | |
103 | } | |
104 | } | |
105 | ||
106 | if(buf[0] == '#') /* look for and extract time value */ | |
107 | { | |
108 | char *str = buf+1; | |
109 | unsigned char ch; | |
110 | ||
111 | tim=0; | |
112 | while((ch=*(str++))) | |
113 | { | |
114 | if((ch>='0')&&(ch<='9')) | |
115 | { | |
116 | tim=(tim*10+(ch&15)); | |
117 | } | |
118 | } | |
119 | } | |
120 | else | |
121 | if(buf[0] == 'b') /* extract the binary value of the "val" symbol */ | |
122 | { | |
123 | int collect = 0; | |
124 | pnt = buf+1; | |
125 | ||
126 | while(*pnt && (*pnt != ' ')) | |
127 | { | |
128 | collect <<= 1; | |
129 | collect |= ((*pnt) & 1); | |
130 | pnt++; | |
131 | } | |
132 | ||
133 | if((prevval ^ collect) & 128) | |
134 | { | |
135 | t_tmp = calloc(1, sizeof(struct tim_t)); | |
136 | t_tmp->tim = tim; | |
137 | t_tmp->val = collect; | |
138 | t_tmp->delta = tim - prevtim; | |
139 | ||
140 | prevtim = tim; | |
141 | ||
142 | if(!t_curr) | |
143 | { | |
144 | t_head = t_curr = t_tmp; | |
145 | } | |
146 | else | |
147 | { | |
148 | t_curr = t_curr->next = t_tmp; | |
149 | } | |
150 | } | |
151 | prevval = collect; | |
152 | } | |
153 | else | |
154 | if(buf[0] == '$') /* directive processing */ | |
155 | { | |
156 | if(strstr(buf, "$comment")) | |
157 | { | |
158 | if((pnt = strstr(buf, "min_time"))) | |
159 | { | |
160 | sscanf(pnt + 9, "%"SCNu64, &min_time); | |
161 | OPTIONAL_DEBUG { fprintf(stderr, "min: %d\n", (int)min_time); } | |
162 | } | |
163 | else | |
164 | if((pnt = strstr(buf, "max_time"))) | |
165 | { | |
166 | sscanf(pnt + 9, "%"SCNu64, &max_time); | |
167 | OPTIONAL_DEBUG { fprintf(stderr, "max: %d\n", (int)max_time); } | |
168 | } | |
169 | else | |
170 | if(strstr(buf, "data_end")) | |
171 | { | |
172 | break; | |
173 | } | |
174 | } | |
175 | } | |
176 | } | |
177 | ||
178 | if(feof(stdin)) /* broken pipe coming up */ | |
179 | { | |
180 | OPTIONAL_DEBUG { fprintf(stderr, "*** Terminated t_filter executable\n"); } | |
181 | exit(0); | |
182 | } | |
183 | } | |
184 | ||
185 | printf("$name Decoded FSK\n"); /* 1st trace name */ | |
186 | printf("#0\n"); | |
187 | ||
188 | { | |
189 | uint64_t p_tim = 0; | |
190 | int state = 0; | |
191 | int byte_remain = 0; | |
192 | int bcnt = 0; | |
193 | ||
194 | t_tmp = t_head; | |
195 | while(t_tmp) | |
196 | { | |
197 | if(t_tmp->delta == 16) | |
198 | { | |
199 | int sync_cnt = 0; | |
200 | uint64_t t_start = p_tim; | |
201 | int i; | |
202 | for(i=0;i<16;i++) | |
203 | { | |
204 | if(t_tmp->delta == 16) { sync_cnt++; p_tim = t_tmp->tim; t_tmp = t_tmp->next; } else { break; } | |
205 | } | |
206 | if(sync_cnt==16) | |
207 | { | |
208 | printf("#%"PRIu64" ?darkblue?Sync\n", t_start); /* write out sync xact */ | |
209 | printf("#%"PRIu64"\n", p_tim - 4); /* 'z' midline is no value after time */ | |
210 | printf("MA%"PRIu64" Start\n", t_start); /* set position/name for marker A */ | |
211 | control_start = t_start; | |
212 | goto found_sync; | |
213 | } | |
214 | continue; | |
215 | } | |
216 | p_tim = t_tmp->tim; | |
217 | t_tmp = t_tmp->next; | |
218 | } | |
219 | ||
220 | found_sync: | |
221 | ||
222 | state = 0; byte_remain = 11; | |
223 | /* printf("MB%"PRIu64" Num Blocks\n", p_tim); */ | |
224 | ||
225 | while(t_tmp) | |
226 | { | |
227 | int i; | |
228 | int collect = 0; | |
229 | uint64_t t_start = p_tim; | |
230 | ||
231 | if((state == 0) && (byte_remain == 10)) | |
232 | { | |
233 | struct event_t *evt = calloc(1, sizeof(struct event_t)); | |
234 | char buf[32]; | |
235 | ||
236 | evt->tim = p_tim; | |
237 | sprintf(buf, "H%d", hcnt/2); | |
238 | evt->name = strdup(buf); | |
239 | ||
240 | if(!control_end) { control_end = p_tim; } | |
241 | ||
242 | if(!hdr_head) { hdr_head = hdr_curr = evt; } | |
243 | else { hdr_curr = hdr_curr->next = evt; } | |
244 | ||
245 | /**/ | |
246 | if(data_curr) | |
247 | { | |
248 | evt = calloc(1, sizeof(struct event_t)); | |
249 | evt->tim = p_tim; | |
250 | evt->name = NULL; | |
251 | ||
252 | data_curr = data_curr->next = evt; | |
253 | } | |
254 | } | |
255 | ||
256 | if((state == 1) && (byte_remain == 64)) | |
257 | { | |
258 | struct event_t *evt = calloc(1, sizeof(struct event_t)); | |
259 | char buf[32]; | |
260 | ||
261 | evt->tim = p_tim; | |
262 | sprintf(buf, "D%d:", hcnt/2); | |
263 | evt->name = calloc(1, 74); | |
264 | strcpy(evt->name, buf); | |
265 | ||
266 | if(!data_head) { data_head = data_curr = evt; } | |
267 | else { data_curr = data_curr->next = evt; } | |
268 | ||
269 | /**/ | |
270 | if(hdr_curr) | |
271 | { | |
272 | evt = calloc(1, sizeof(struct event_t)); | |
273 | evt->tim = p_tim; | |
274 | evt->name = NULL; | |
275 | ||
276 | hdr_curr = hdr_curr->next = evt; | |
277 | } | |
278 | ||
279 | hcnt++; | |
280 | } | |
281 | ||
282 | ||
283 | for(i=0;(t_tmp) && (i<8);i++) | |
284 | { | |
285 | collect <<= 1; | |
286 | if(t_tmp->delta == 16) | |
287 | { | |
288 | collect |= 1; | |
289 | t_tmp = t_tmp->next; | |
290 | } | |
291 | else | |
292 | { | |
293 | } | |
294 | ||
295 | p_tim = t_tmp->tim; t_tmp = t_tmp->next; | |
296 | } | |
297 | ||
298 | if(!bcnt) | |
299 | { | |
300 | printf("#%"PRIu64" ?gray24?%02X\n", t_start, collect); | |
301 | blks = collect; | |
302 | bcnt++; | |
303 | } | |
304 | else | |
305 | { | |
306 | if(state == 1) | |
307 | { | |
308 | char conv = ((collect < ' ') || (collect >= 127)) ? '.' : collect; | |
309 | int slen = strlen(data_curr->name); | |
310 | ||
311 | data_curr->name[slen] = conv; | |
312 | ||
313 | if((collect >= ' ') && (collect < 127)) | |
314 | { | |
315 | printf("#%"PRIu64" ?darkgreen?%c\n", t_start, (unsigned char)collect); | |
316 | } | |
317 | else | |
318 | { | |
319 | printf("#%"PRIu64" ?darkred?%02X\n", t_start, collect); | |
320 | } | |
321 | ||
322 | } | |
323 | else | |
324 | { | |
325 | printf("#%"PRIu64" ?purple3?%02X\n", t_start, collect); | |
326 | } | |
327 | } | |
328 | ||
329 | printf("#%"PRIu64"\n", p_tim - 4); | |
330 | ||
331 | byte_remain--; | |
332 | if(!byte_remain) | |
333 | { | |
334 | if(state == 0) | |
335 | { | |
336 | state = 1; byte_remain = 64; | |
337 | } | |
338 | else | |
339 | { | |
340 | state = 0; byte_remain = 10; | |
341 | } | |
342 | } | |
343 | ||
344 | } | |
345 | ||
346 | } | |
347 | ||
348 | t_tmp = t_head; /* free up memory allocated */ | |
349 | while(t_tmp) | |
350 | { | |
351 | t_curr = t_tmp->next; | |
352 | free(t_tmp); | |
353 | t_tmp = t_curr; | |
354 | } | |
355 | t_head = t_curr = NULL; | |
356 | ||
357 | printf("$next\n"); /* indicate there is a next trace */ | |
358 | printf("$name Control\n"); /* next trace name */ | |
359 | printf("#0\n"); | |
360 | printf("#%"PRIu64" ?darkblue?%02X blks\n", control_start, blks); | |
361 | printf("#%"PRIu64"\n", control_end); | |
362 | ||
363 | ||
364 | printf("$next\n"); /* indicate there is a next trace */ | |
365 | printf("$name Headers\n"); /* next trace name */ | |
366 | printf("#0\n"); | |
367 | while(hdr_head) | |
368 | { | |
369 | if(hdr_head->name) | |
370 | { | |
371 | printf("#%"PRIu64" ?purple3?%s\n", hdr_head->tim, hdr_head->name); | |
372 | free(hdr_head->name); | |
373 | } | |
374 | else | |
375 | { | |
376 | printf("#%"PRIu64"\n", hdr_head->tim); | |
377 | } | |
378 | ||
379 | hdr_curr = hdr_head->next; | |
380 | free(hdr_head); | |
381 | hdr_head = hdr_curr; | |
382 | } | |
383 | ||
384 | ||
385 | printf("$next\n"); /* indicate there is a next trace */ | |
386 | printf("$name Data Payload\n"); /* next trace name */ | |
387 | printf("#0\n"); | |
388 | while(data_head) | |
389 | { | |
390 | if(data_head->name) | |
391 | { | |
392 | printf("#%"PRIu64" ?darkgreen?%s\n", data_head->tim, data_head->name); | |
393 | free(data_head->name); | |
394 | } | |
395 | else | |
396 | { | |
397 | printf("#%"PRIu64"\n", data_head->tim); | |
398 | } | |
399 | ||
400 | data_curr = data_head->next; | |
401 | free(data_head); | |
402 | data_head = data_curr; | |
403 | } | |
404 | ||
405 | ||
406 | ||
407 | printf("$finish\n"); /* directive to return control to gtkwave */ | |
408 | fflush(stdout); /* ensure nothing is stuck in output buffers which could hang gtkwave */ | |
409 | ||
410 | OPTIONAL_DEBUG { fprintf(stderr, "back to gtkwave...\n"); } | |
411 | ||
412 | goto top; /* loop forever in order to process next xact query */ | |
413 | ||
414 | return(0); | |
415 | } |
Binary diff not shown
0 | [timestart] 196429 | |
1 | [size] 1000 600 | |
2 | [pos] -1 -1 | |
3 | *-10.463677 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 | |
4 | @90022 | |
5 | top.val[7:0] | |
6 | @20000 | |
7 | - | |
8 | - | |
9 | - | |
10 | - | |
11 | - | |
12 | - | |
13 | @10c00022 | |
14 | ^<1 ./transaction | |
15 | #{top.val[7:0]} (0)top.val[7:0] (1)top.val[7:0] (2)top.val[7:0] (3)top.val[7:0] (4)top.val[7:0] (5)top.val[7:0] (6)top.val[7:0] (7)top.val[7:0] | |
16 | @c00022 | |
17 | top.val[7:0] | |
18 | @28 | |
19 | (0)top.val[7:0] | |
20 | (1)top.val[7:0] | |
21 | (2)top.val[7:0] | |
22 | (3)top.val[7:0] | |
23 | (4)top.val[7:0] | |
24 | (5)top.val[7:0] | |
25 | (6)top.val[7:0] | |
26 | (7)top.val[7:0] | |
27 | @1401200 | |
28 | -group_end | |
29 | -group_end | |
30 | @200 | |
31 | - | |
32 | - | |
33 | - | |
34 | - | |
35 | [pattern_trace] 1 | |
36 | [pattern_trace] 0 |
28 | 28 | regex.c regex_wave.h renderopt.c rgb.c search.c shiftbuttons.c showchange.c \ |
29 | 29 | signalwindow.c simplereq.c splash.c status.c strace.c strace.h symbol.c symbol.h \ |
30 | 30 | tcl_commands.c tcl_helper.c tcl_helper.h tcl_np.c tcl_np.h tcl_support_commands.c tcl_support_commands.h \ |
31 | timeentry.c translate.c translate.h tree.c tree.h treesearch.c vcd.c vcd.h vcd_keywords.c \ | |
31 | timeentry.c translate.c translate.h tree.c tree.h treesearch.c \ | |
32 | ttranslate.c ttranslate.h vcd.c vcd.h vcd_keywords.c \ | |
32 | 33 | vcd_partial.c vcd_recoder.c vcd_saver.c vcd_saver.h vlist.c vlist.h vzt.c vzt.h wavealloca.h \ |
33 | 34 | wavewindow.c zoombuttons.c ./liblzma/libgwlzma.a ./helpers/fst/libfst.a |
34 | 35 |
69 | 69 | tcl_commands.$(OBJEXT) tcl_helper.$(OBJEXT) tcl_np.$(OBJEXT) \ |
70 | 70 | tcl_support_commands.$(OBJEXT) timeentry.$(OBJEXT) \ |
71 | 71 | translate.$(OBJEXT) tree.$(OBJEXT) treesearch.$(OBJEXT) \ |
72 | vcd.$(OBJEXT) vcd_keywords.$(OBJEXT) vcd_partial.$(OBJEXT) \ | |
73 | vcd_recoder.$(OBJEXT) vcd_saver.$(OBJEXT) vlist.$(OBJEXT) \ | |
74 | vzt.$(OBJEXT) wavewindow.$(OBJEXT) zoombuttons.$(OBJEXT) | |
72 | ttranslate.$(OBJEXT) vcd.$(OBJEXT) vcd_keywords.$(OBJEXT) \ | |
73 | vcd_partial.$(OBJEXT) vcd_recoder.$(OBJEXT) \ | |
74 | vcd_saver.$(OBJEXT) vlist.$(OBJEXT) vzt.$(OBJEXT) \ | |
75 | wavewindow.$(OBJEXT) zoombuttons.$(OBJEXT) | |
75 | 76 | gtkwave_OBJECTS = $(am_gtkwave_OBJECTS) |
76 | 77 | am__DEPENDENCIES_1 = |
77 | 78 | am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) |
239 | 240 | regex.c regex_wave.h renderopt.c rgb.c search.c shiftbuttons.c showchange.c \ |
240 | 241 | signalwindow.c simplereq.c splash.c status.c strace.c strace.h symbol.c symbol.h \ |
241 | 242 | tcl_commands.c tcl_helper.c tcl_helper.h tcl_np.c tcl_np.h tcl_support_commands.c tcl_support_commands.h \ |
242 | timeentry.c translate.c translate.h tree.c tree.h treesearch.c vcd.c vcd.h vcd_keywords.c \ | |
243 | timeentry.c translate.c translate.h tree.c tree.h treesearch.c \ | |
244 | ttranslate.c ttranslate.h vcd.c vcd.h vcd_keywords.c \ | |
243 | 245 | vcd_partial.c vcd_recoder.c vcd_saver.c vcd_saver.h vlist.c vlist.h vzt.c vzt.h wavealloca.h \ |
244 | 246 | wavewindow.c zoombuttons.c ./liblzma/libgwlzma.a ./helpers/fst/libfst.a |
245 | 247 | |
386 | 388 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/translate.Po@am__quote@ |
387 | 389 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tree.Po@am__quote@ |
388 | 390 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/treesearch.Po@am__quote@ |
391 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttranslate.Po@am__quote@ | |
389 | 392 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twinwave.Po@am__quote@ |
390 | 393 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcd.Po@am__quote@ |
391 | 394 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcd_keywords.Po@am__quote@ |
9 | 9 | #ifndef WAVE_AE2RDR_H |
10 | 10 | #define WAVE_AE2RDR_H |
11 | 11 | |
12 | #ifndef _MSC_VER | |
12 | #ifdef HAVE_INTTYPES_H | |
13 | 13 | #include <inttypes.h> |
14 | 14 | #endif |
15 | 15 | #include "vcd.h" |
85 | 85 | #endif |
86 | 86 | |
87 | 87 | /* |
88 | * $Id: ae2.h,v 1.6 2008/09/27 19:08:39 gtkwave Exp $ | |
88 | * $Id: ae2.h,v 1.7 2010/04/27 23:10:56 gtkwave Exp $ | |
89 | 89 | * $Log: ae2.h,v $ |
90 | * Revision 1.7 2010/04/27 23:10:56 gtkwave | |
91 | * made inttype.h inclusion conditional | |
92 | * | |
90 | 93 | * Revision 1.6 2008/09/27 19:08:39 gtkwave |
91 | 94 | * compiler warning fixes |
92 | 95 | * |
23 | 23 | #include "strace.h" |
24 | 24 | #include "translate.h" |
25 | 25 | #include "ptranslate.h" |
26 | #include "ttranslate.h" | |
26 | 27 | #include "hierpack.h" |
27 | 28 | #include "analyzer.h" |
28 | 29 | |
29 | 30 | #ifdef _MSC_VER |
30 | 31 | #define strcasecmp _stricmp |
31 | 32 | #endif |
33 | ||
34 | void UpdateTraceSelection(Trptr t); | |
32 | 35 | |
33 | 36 | |
34 | 37 | /* |
229 | 232 | if(GLOBALS->default_flags & TR_PTRANSLATED) |
230 | 233 | { |
231 | 234 | t->p_filter = GLOBALS->current_translate_proc; |
235 | } | |
236 | ||
237 | /* NOT an else! */ | |
238 | if(GLOBALS->default_flags & TR_TTRANSLATED) | |
239 | { | |
240 | t->t_filter = GLOBALS->current_translate_ttrans; | |
241 | traverse_vector_nodes(t); | |
232 | 242 | } |
233 | 243 | |
234 | 244 | if (IsGroupBegin(t)) { |
548 | 558 | if( t == NULL ) |
549 | 559 | { |
550 | 560 | fprintf( stderr, "Out of memory, can't add %s to analyzer\n", |
551 | vec->name ); | |
561 | vec->bvname ); | |
552 | 562 | return( 0 ); |
553 | 563 | } |
554 | 564 | |
559 | 569 | } |
560 | 570 | else |
561 | 571 | { |
562 | t->name = vec->name; | |
572 | t->name = vec->bvname; | |
563 | 573 | } |
564 | 574 | |
565 | 575 | if(GLOBALS->hier_max_level) |
595 | 605 | |
596 | 606 | if(t->vector) |
597 | 607 | { |
598 | bvptr bv; | |
608 | bvptr bv, bv2; | |
599 | 609 | int i; |
600 | 610 | |
601 | 611 | bv=t->n.vec; |
612 | /* back out allocation to revert (if any) */ | |
613 | if(bv->transaction_cache) | |
614 | { | |
615 | t->n.vec = bv->transaction_cache; | |
616 | ||
617 | while(bv) | |
618 | { | |
619 | bv2 = bv->transaction_chain; | |
620 | if(bv->bvname) { free_2(bv->bvname); } | |
621 | ||
622 | for(i=0;i<bv->numregions;i++) | |
623 | { | |
624 | free_2(bv->vectors[i]); | |
625 | } | |
626 | ||
627 | free_2(bv); | |
628 | bv = bv2; | |
629 | } | |
630 | ||
631 | bv=t->n.vec; | |
632 | } | |
633 | ||
634 | /* normal vector deallocation */ | |
602 | 635 | for(i=0;i<bv->numregions;i++) |
603 | 636 | { |
604 | 637 | if(bv->vectors[i]) free_2(bv->vectors[i]); |
615 | 648 | free_2(bv->bits); |
616 | 649 | } |
617 | 650 | |
618 | if(bv->name) free_2(bv->name); | |
651 | if(bv->bvname) free_2(bv->bvname); | |
619 | 652 | if(t->n.vec) free_2(t->n.vec); |
620 | 653 | } |
621 | 654 | else |
1214 | 1247 | return(1); |
1215 | 1248 | } |
1216 | 1249 | |
1217 | /* propogate selection info down into groups */ | |
1218 | void UpdateTraceSelection(Trptr t) | |
1219 | { | |
1220 | if ((t->t_match) && (IsGroupBegin(t) || IsGroupEnd(t)) && (IsSelected(t) || IsSelected(t->t_match))) | |
1221 | { | |
1222 | t->flags |= TR_HIGHLIGHT; | |
1223 | t->t_match->flags |= TR_HIGHLIGHT; | |
1224 | } | |
1225 | if ((t->t_grp) && IsSelected(t->t_grp)) | |
1226 | { | |
1227 | t->flags |= TR_HIGHLIGHT; | |
1228 | } | |
1229 | } | |
1230 | 1250 | |
1231 | 1251 | Trptr GiveNextTrace(Trptr t) |
1232 | 1252 | { |
1253 | if(!t) return(t); /* should not happen */ | |
1254 | ||
1233 | 1255 | /* if(t->name) { printf("NEXT: %s %x\n", t->name, t->flags); } */ |
1234 | 1256 | UpdateTraceSelection(t); |
1235 | 1257 | if (IsGroupBegin(t) && IsClosed(t)) |
1248 | 1270 | } |
1249 | 1271 | } |
1250 | 1272 | |
1251 | Trptr GivePrevTrace(Trptr t) | |
1252 | { | |
1273 | static Trptr GivePrevTraceSkipUpdate(Trptr t, int skip) | |
1274 | { | |
1275 | if(!t) return(t); /* should not happen */ | |
1276 | ||
1253 | 1277 | /* if(t->name) { printf("PREV: %s\n", t->name); } */ |
1254 | UpdateTraceSelection(t); | |
1278 | if(!skip) { UpdateTraceSelection(t); } | |
1255 | 1279 | if (IsGroupEnd(t) && IsClosed(t)) |
1256 | 1280 | { |
1257 | 1281 | Trptr prev = t->t_match; |
1268 | 1292 | } |
1269 | 1293 | } |
1270 | 1294 | |
1295 | Trptr GivePrevTrace(Trptr t) | |
1296 | { | |
1297 | return(GivePrevTraceSkipUpdate(t, 0)); | |
1298 | } | |
1299 | ||
1300 | ||
1301 | /* propogate selection info down into groups */ | |
1302 | void UpdateTraceSelection(Trptr t) | |
1303 | { | |
1304 | if ((t->t_match) && (IsGroupBegin(t) || IsGroupEnd(t)) && (IsSelected(t) || IsSelected(t->t_match))) | |
1305 | { | |
1306 | t->flags |= TR_HIGHLIGHT; | |
1307 | t->t_match->flags |= TR_HIGHLIGHT; | |
1308 | } | |
1309 | else | |
1310 | if ((t->t_grp) && IsSelected(t->t_grp)) | |
1311 | { | |
1312 | t->flags |= TR_HIGHLIGHT; | |
1313 | } | |
1314 | else | |
1315 | if(t->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH)) /* seek to real xact trace if present... */ | |
1316 | { | |
1317 | if(!(t->flags & TR_HIGHLIGHT)) | |
1318 | { | |
1319 | Trptr tscan = t; | |
1320 | int bcnt = 0; | |
1321 | while((tscan) && (tscan = GivePrevTraceSkipUpdate(tscan, 1))) | |
1322 | { | |
1323 | if(!(tscan->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH))) | |
1324 | { | |
1325 | if(tscan->flags & TR_TTRANSLATED) | |
1326 | { | |
1327 | break; /* found it */ | |
1328 | } | |
1329 | else | |
1330 | { | |
1331 | tscan = NULL; | |
1332 | } | |
1333 | } | |
1334 | else | |
1335 | { | |
1336 | bcnt++; /* bcnt is number of blank traces */ | |
1337 | } | |
1338 | } | |
1339 | ||
1340 | if((tscan)&&(tscan->vector)&&(IsSelected(tscan))) | |
1341 | { | |
1342 | bvptr bv = tscan->n.vec; | |
1343 | do | |
1344 | { | |
1345 | bv = bv->transaction_chain; /* correlate to blank trace */ | |
1346 | } while(bv && (bcnt--)); | |
1347 | if(bv) | |
1348 | { | |
1349 | t->flags |= TR_HIGHLIGHT; | |
1350 | } | |
1351 | } | |
1352 | } | |
1353 | } | |
1354 | } | |
1271 | 1355 | |
1272 | 1356 | |
1273 | 1357 | int UpdateTracesVisible(void) |
1332 | 1416 | } |
1333 | 1417 | else if (t->vector) |
1334 | 1418 | { |
1335 | return (t->n.vec->name); | |
1419 | return (t->n.vec->bvname); | |
1336 | 1420 | |
1337 | 1421 | } |
1338 | 1422 | else |
1408 | 1492 | } |
1409 | 1493 | |
1410 | 1494 | /* |
1411 | * $Id: analyzer.c,v 1.18 2010/03/14 07:09:49 gtkwave Exp $ | |
1495 | * $Id: analyzer.c,v 1.26 2010/04/15 00:30:23 gtkwave Exp $ | |
1412 | 1496 | * $Log: analyzer.c,v $ |
1497 | * Revision 1.26 2010/04/15 00:30:23 gtkwave | |
1498 | * don't propagate ttranslate filter into groups | |
1499 | * | |
1500 | * Revision 1.25 2010/04/13 18:11:42 gtkwave | |
1501 | * propagate trace highlighting into transactions | |
1502 | * | |
1503 | * Revision 1.24 2010/04/07 01:50:45 gtkwave | |
1504 | * improved name handling for bvname, add $next transaction operation | |
1505 | * | |
1506 | * Revision 1.23 2010/04/06 06:19:06 gtkwave | |
1507 | * deallocate transaction trace name | |
1508 | * | |
1509 | * Revision 1.22 2010/04/04 19:09:57 gtkwave | |
1510 | * rename name->bvname in struct BitVector for easier grep tracking | |
1511 | * | |
1512 | * Revision 1.21 2010/04/04 07:12:40 gtkwave | |
1513 | * deallocate transaction cache on FreeTrace | |
1514 | * | |
1515 | * Revision 1.20 2010/03/31 16:32:20 gtkwave | |
1516 | * stale marker fix for ttranslate on save file loads before GUI initialized | |
1517 | * | |
1518 | * Revision 1.19 2010/03/31 15:42:47 gtkwave | |
1519 | * added preliminary transaction filter support | |
1520 | * | |
1413 | 1521 | * Revision 1.18 2010/03/14 07:09:49 gtkwave |
1414 | 1522 | * removed ExtNode and merged with Node |
1415 | 1523 | * |
25 | 25 | gfloat value, oldvalue; |
26 | 26 | } SearchProgressData; |
27 | 27 | |
28 | ||
29 | #define BITATTRIBUTES_MAX 32768 | |
28 | 30 | |
29 | 31 | typedef struct ExpandInfo *eptr; |
30 | 32 | typedef struct ExpandReferences *exptr; |
232 | 234 | typedef struct Bits |
233 | 235 | { |
234 | 236 | char *name; /* name of this vector of bits */ |
235 | int nbits; /* number of bits in this vector */ | |
237 | int nnbits; /* number of bits in this vector */ | |
236 | 238 | baptr attribs; /* for keeping track of combined timeshifts and inversions (and for savefile) */ |
237 | 239 | |
238 | 240 | nptr nodes[1]; /* pointers to the bits (nodes) */ |
240 | 242 | |
241 | 243 | typedef struct BitVector |
242 | 244 | { |
243 | char *name; /* name of this vector of bits */ | |
245 | bvptr transaction_cache; /* for TR_TTRANSLATED traces */ | |
246 | bvptr transaction_chain; /* for TR_TTRANSLATED traces */ | |
247 | ||
248 | char *bvname; /* name of this vector of bits */ | |
244 | 249 | int nbits; /* number of bits in this vector */ |
245 | 250 | int numregions; /* number of regions that follow */ |
246 | 251 | bptr bits; /* pointer to Bits structs for save file */ |
303 | 308 | TimeType shift; /* offset added to all entries in the trace */ |
304 | 309 | TimeType shift_drag; /* cached initial offset for CTRL+LMB drag on highlighted */ |
305 | 310 | |
311 | double d_minval, d_maxval; /* cached value for when auto scaling is turned off */ | |
312 | ||
313 | union | |
314 | { | |
315 | nptr nd; /* what makes up this trace */ | |
316 | bvptr vec; | |
317 | } n; | |
318 | ||
319 | unsigned int flags; /* see def below in TraceEntFlagBits */ | |
320 | unsigned int cached_flags; /* used for tcl for saving flags during cut and paste */ | |
321 | ||
306 | 322 | int f_filter; /* file filter */ |
307 | 323 | int p_filter; /* process filter */ |
308 | ||
309 | double d_minval, d_maxval; /* cached value for when auto scaling is turned off */ | |
324 | int t_filter; /* transaction process filter */ | |
310 | 325 | |
311 | 326 | unsigned is_alias : 1; /* set when it's an alias (safe to free t->name then) */ |
312 | 327 | unsigned is_depacked : 1; /* set when it's been depacked from a compressed entry (safe to free t->name then) */ |
315 | 330 | unsigned interactive_vector_needs_regeneration : 1; /* for interactive VCDs */ |
316 | 331 | unsigned minmax_valid : 1; /* for d_minval, d_maxval */ |
317 | 332 | unsigned is_sort_group : 1; /* only used for sorting purposes */ |
318 | ||
319 | unsigned int flags; /* see def below in TraceEntFlagBits */ | |
320 | unsigned int cached_flags; /* used for tcl for saving flags during cut and paste */ | |
321 | ||
322 | union | |
323 | { | |
324 | nptr nd; /* what makes up this trace */ | |
325 | bvptr vec; | |
326 | } n; | |
333 | unsigned t_filter_converted : 1; /* used to mark that data conversion already occurred if t_filter != 0*/ | |
327 | 334 | } TraceEnt; |
328 | 335 | |
329 | 336 | |
335 | 342 | TR_ANALOG_INTERPOLATED_B, TR_ANALOG_BLANK_STRETCH_B, TR_REAL_B, TR_ANALOG_FULLSCALE_B, |
336 | 343 | TR_ZEROFILL_B, TR_ONEFILL_B, TR_CLOSED_B, TR_GRP_BEGIN_B, |
337 | 344 | TR_GRP_END_B, |
338 | TR_BINGRAY_B, TR_GRAYBIN_B | |
345 | TR_BINGRAY_B, TR_GRAYBIN_B, | |
346 | TR_REAL2BITS_B, TR_TTRANSLATED_B | |
339 | 347 | }; |
340 | 348 | |
341 | 349 | #define TR_HIGHLIGHT (1<<TR_HIGHLIGHT_B) |
367 | 375 | #define TR_GRAYBIN (1<<TR_GRAYBIN_B) |
368 | 376 | #define TR_GRAYMASK (TR_BINGRAY|TR_GRAYBIN) |
369 | 377 | |
378 | #define TR_REAL2BITS (1<<TR_REAL2BITS_B) | |
379 | ||
370 | 380 | #define TR_NUMMASK (TR_ASCII|TR_HEX|TR_DEC|TR_BIN|TR_OCT|TR_SIGNED|TR_REAL) |
371 | 381 | |
372 | 382 | #define TR_COLLAPSED (1<<TR_COLLAPSED_B) |
374 | 384 | |
375 | 385 | #define TR_FTRANSLATED (1<<TR_FTRANSLATED_B) |
376 | 386 | #define TR_PTRANSLATED (1<<TR_PTRANSLATED_B) |
387 | #define TR_TTRANSLATED (1<<TR_TTRANSLATED_B) | |
377 | 388 | |
378 | 389 | #define TR_ANALOGMASK (TR_ANALOG_STEP|TR_ANALOG_INTERPOLATED) |
379 | 390 | |
435 | 446 | #endif |
436 | 447 | |
437 | 448 | /* |
438 | * $Id: analyzer.h,v 1.24 2010/03/14 07:09:49 gtkwave Exp $ | |
449 | * $Id: analyzer.h,v 1.28 2010/04/07 01:50:45 gtkwave Exp $ | |
439 | 450 | * $Log: analyzer.h,v $ |
451 | * Revision 1.28 2010/04/07 01:50:45 gtkwave | |
452 | * improved name handling for bvname, add $next transaction operation | |
453 | * | |
454 | * Revision 1.27 2010/04/04 19:09:57 gtkwave | |
455 | * rename name->bvname in struct BitVector for easier grep tracking | |
456 | * | |
457 | * Revision 1.26 2010/03/31 15:42:47 gtkwave | |
458 | * added preliminary transaction filter support | |
459 | * | |
460 | * Revision 1.25 2010/03/24 23:05:09 gtkwave | |
461 | * added RealToBits menu option | |
462 | * | |
440 | 463 | * Revision 1.24 2010/03/14 07:09:49 gtkwave |
441 | 464 | * removed ExtNode and merged with Node |
442 | 465 | * |
20 | 20 | #include "debug.h" |
21 | 21 | #include "translate.h" |
22 | 22 | #include "ptranslate.h" |
23 | #include "ttranslate.h" | |
23 | 24 | #include "pipeio.h" |
24 | 25 | |
25 | 26 | #ifdef _MSC_VER |
635 | 636 | /* |
636 | 637 | * convert trptr+hptr vectorstring into an ascii string |
637 | 638 | */ |
638 | char *convert_ascii_real(double *d) | |
639 | char *convert_ascii_real(Trptr t, double *d) | |
639 | 640 | { |
640 | 641 | char *rv; |
641 | 642 | |
642 | rv=malloc_2(24); /* enough for .16e format */ | |
643 | ||
644 | if(d) | |
645 | { | |
646 | sprintf(rv,"%.16g",*d); | |
647 | } | |
648 | else | |
649 | { | |
650 | strcpy(rv,"UNDEF"); | |
643 | if(t && (t->flags & TR_REAL2BITS) && d) /* "real2bits" also allows other filters such as "bits2real" on top of it */ | |
644 | { | |
645 | struct TraceEnt t2; | |
646 | char vec[64]; | |
647 | int i; | |
648 | guint64 swapmem; | |
649 | ||
650 | memcpy(&swapmem, d, sizeof(guint64)); | |
651 | for(i=0;i<64;i++) | |
652 | { | |
653 | if(swapmem & (ULLDescriptor(1)<<(63-i))) | |
654 | { | |
655 | vec[i] = AN_1; | |
656 | } | |
657 | else | |
658 | { | |
659 | vec[i] = AN_0; | |
660 | } | |
661 | } | |
662 | ||
663 | memcpy(&t2, t, sizeof(struct TraceEnt)); | |
664 | ||
665 | t2.n.nd->msi = 63; | |
666 | t2.n.nd->lsi = 0; | |
667 | t2.flags &= ~(TR_REAL2BITS); /* to avoid possible recursion in the future */ | |
668 | ||
669 | rv = convert_ascii_vec_2(&t2, vec); | |
670 | } | |
671 | else | |
672 | { | |
673 | rv=malloc_2(24); /* enough for .16e format */ | |
674 | ||
675 | if(d) | |
676 | { | |
677 | sprintf(rv,"%.16g",*d); | |
678 | } | |
679 | else | |
680 | { | |
681 | strcpy(rv,"UNDEF"); | |
682 | } | |
651 | 683 | } |
652 | 684 | |
653 | 685 | return(rv); |
701 | 733 | int i, nbits, res; |
702 | 734 | char *vec=(char *)v->v; |
703 | 735 | |
704 | if (vec == NULL) | |
705 | return(1); | |
736 | if(!t->t_filter_converted) | |
737 | { | |
738 | if (vec == NULL) | |
739 | return(AN_X); | |
740 | } | |
741 | else | |
742 | { | |
743 | return ( ((vec == NULL) || (vec[0] == 0)) ? AN_Z : AN_0 ); | |
744 | } | |
745 | ||
706 | 746 | nbits=t->n.vec->nbits; |
707 | 747 | res = AN_1; |
708 | 748 | for (i = 0; i < nbits; i++) |
727 | 767 | /* |
728 | 768 | * convert trptr+hptr vectorstring into an ascii string |
729 | 769 | */ |
730 | static char *convert_ascii_vec_2(Trptr t, char *vec) | |
770 | char *convert_ascii_vec_2(Trptr t, char *vec) | |
731 | 771 | { |
732 | 772 | Ulong flags; |
733 | 773 | int nbits; |
1348 | 1388 | |
1349 | 1389 | char *convert_ascii(Trptr t, vptr v) |
1350 | 1390 | { |
1351 | char *s = convert_ascii_2(t, v); | |
1391 | char *s; | |
1392 | ||
1393 | if(!t->t_filter_converted) | |
1394 | { | |
1395 | s = convert_ascii_2(t, v); | |
1396 | } | |
1397 | else | |
1398 | { | |
1399 | s = strdup_2(v->v); | |
1400 | ||
1401 | if((*s == '?') && (!GLOBALS->color_active_in_filter)) | |
1402 | { | |
1403 | char *s2a; | |
1404 | char *s2 = strchr(s+1, '?'); | |
1405 | if(s2) | |
1406 | { | |
1407 | s2++; | |
1408 | s2a = malloc_2(strlen(s2)+1); | |
1409 | strcpy(s2a, s2); | |
1410 | free_2(s); | |
1411 | s = s2a; | |
1412 | } | |
1413 | } | |
1414 | } | |
1352 | 1415 | |
1353 | 1416 | #if defined _MSC_VER || defined __MINGW32__ |
1354 | 1417 | |
1654 | 1717 | } |
1655 | 1718 | |
1656 | 1719 | /* |
1657 | * $Id: baseconvert.c,v 1.13 2010/03/14 07:09:49 gtkwave Exp $ | |
1720 | * $Id: baseconvert.c,v 1.16 2010/03/31 16:32:20 gtkwave Exp $ | |
1658 | 1721 | * $Log: baseconvert.c,v $ |
1722 | * Revision 1.16 2010/03/31 16:32:20 gtkwave | |
1723 | * stale marker fix for ttranslate on save file loads before GUI initialized | |
1724 | * | |
1725 | * Revision 1.15 2010/03/31 15:42:47 gtkwave | |
1726 | * added preliminary transaction filter support | |
1727 | * | |
1728 | * Revision 1.14 2010/03/24 23:05:09 gtkwave | |
1729 | * added RealToBits menu option | |
1730 | * | |
1659 | 1731 | * Revision 1.13 2010/03/14 07:09:49 gtkwave |
1660 | 1732 | * removed ExtNode and merged with Node |
1661 | 1733 | * |
25 | 25 | #include "strace.h" |
26 | 26 | #include "translate.h" |
27 | 27 | #include "ptranslate.h" |
28 | #include "ttranslate.h" | |
28 | 29 | #include "main.h" |
29 | 30 | #include "menu.h" |
30 | 31 | #include "busy.h" |
243 | 244 | |
244 | 245 | if(!b) return(NULL); |
245 | 246 | |
246 | h=(hptr *)calloc_2(b->nbits, sizeof(hptr)); | |
247 | ||
248 | numextrabytes=(b->nbits)-1; | |
249 | ||
250 | for(i=0;i<b->nbits;i++) | |
247 | h=(hptr *)calloc_2(b->nnbits, sizeof(hptr)); | |
248 | ||
249 | numextrabytes=(b->nnbits)-1; | |
250 | ||
251 | for(i=0;i<b->nnbits;i++) | |
251 | 252 | { |
252 | 253 | n=b->nodes[i]; |
253 | 254 | h[i]=&(n->head); |
259 | 260 | |
260 | 261 | vadd=(vptr)calloc_2(1,sizeof(struct VectorEnt)+numextrabytes); |
261 | 262 | |
262 | for(i=0;i<b->nbits;i++) /* was 1...big mistake */ | |
263 | for(i=0;i<b->nnbits;i++) /* was 1...big mistake */ | |
263 | 264 | { |
264 | 265 | tshift = (b->attribs) ? b->attribs[i].shift : 0; |
265 | 266 | |
288 | 289 | |
289 | 290 | regions++; |
290 | 291 | |
291 | for(i=0;i<b->nbits;i++) | |
292 | for(i=0;i<b->nnbits;i++) | |
292 | 293 | { |
293 | 294 | unsigned char enc; |
294 | 295 | |
315 | 316 | enc = AN_X; break; |
316 | 317 | |
317 | 318 | case 'z': case 'Z': |
318 | enc = AN_Z; | |
319 | enc = AN_Z; break; | |
319 | 320 | |
320 | 321 | case 'u': case 'U': |
321 | enc = AN_U; | |
322 | enc = AN_U; break; | |
322 | 323 | |
323 | 324 | case 'w': case 'W': |
324 | enc = AN_W; | |
325 | enc = AN_W; break; | |
325 | 326 | |
326 | 327 | default: enc = enc & AN_MSK; break; |
327 | 328 | } |
380 | 381 | bitvec=(bvptr)calloc_2(1,sizeof(struct BitVector)+ |
381 | 382 | (regions*sizeof(vptr))); |
382 | 383 | |
383 | strcpy(bitvec->name=(char *)malloc_2(strlen(b->name)+1),b->name); | |
384 | bitvec->nbits=b->nbits; | |
384 | strcpy(bitvec->bvname=(char *)malloc_2(strlen(b->name)+1),b->name); | |
385 | bitvec->nbits=b->nnbits; | |
385 | 386 | bitvec->numregions=regions; |
386 | 387 | |
387 | 388 | vcurr=vhead; |
505 | 506 | char ch, ch2, wild_active; |
506 | 507 | int len, nodepnt=0; |
507 | 508 | int i; |
508 | struct Node *n[512]; | |
509 | struct Node *n[BITATTRIBUTES_MAX]; | |
509 | 510 | struct Bits *b=NULL; |
510 | 511 | unsigned int rows = 0; |
511 | 512 | |
560 | 561 | if(nexp) |
561 | 562 | { |
562 | 563 | n[nodepnt++]=nexp; |
563 | if(nodepnt==512) { free_2(wild); goto ifnode; } | |
564 | if(nodepnt==BITATTRIBUTES_MAX) { free_2(wild); goto ifnode; } | |
564 | 565 | } |
565 | 566 | } |
566 | 567 | break; |
572 | 573 | if((s=symfind(wild, &rows))) |
573 | 574 | { |
574 | 575 | n[nodepnt++]=&s->n[rows]; |
575 | if(nodepnt==512) { free_2(wild); goto ifnode; } | |
576 | if(nodepnt==BITATTRIBUTES_MAX) { free_2(wild); goto ifnode; } | |
576 | 577 | } |
577 | 578 | } |
578 | 579 | } |
584 | 585 | if(wave_regex_match(GLOBALS->facs[i]->name, WAVE_REGEX_WILD)) |
585 | 586 | { |
586 | 587 | n[nodepnt++]=GLOBALS->facs[i]->n; |
587 | if(nodepnt==512) { free_2(wild); goto ifnode; } | |
588 | if(nodepnt==BITATTRIBUTES_MAX) { free_2(wild); goto ifnode; } | |
588 | 589 | } |
589 | 590 | } |
590 | 591 | } |
607 | 608 | if(n[i]->mv.mvlfac) import_trace(n[i]); |
608 | 609 | } |
609 | 610 | |
610 | b->nbits=nodepnt; | |
611 | b->nnbits=nodepnt; | |
611 | 612 | strcpy(b->name=(char *)malloc_2(strlen(vec)+1),vec); |
612 | 613 | } |
613 | 614 | |
623 | 624 | char ch; |
624 | 625 | int len, nodepnt=0; |
625 | 626 | int i; |
626 | struct Node *n[512]; | |
627 | struct BitAttributes ba[512]; | |
627 | struct Node *n[BITATTRIBUTES_MAX]; | |
628 | struct BitAttributes ba[BITATTRIBUTES_MAX]; | |
628 | 629 | struct Bits *b=NULL; |
629 | 630 | int state = 0; |
630 | 631 | unsigned int rows = 0; |
668 | 669 | { |
669 | 670 | struct symbol *s; |
670 | 671 | |
671 | if(nodepnt==512) { free_2(wild); goto ifnode; } | |
672 | if(nodepnt==BITATTRIBUTES_MAX) { free_2(wild); goto ifnode; } | |
672 | 673 | |
673 | 674 | if(wild[0]=='(') |
674 | 675 | { |
687 | 688 | if(nexp) |
688 | 689 | { |
689 | 690 | n[nodepnt++]=nexp; |
690 | if(nodepnt==512) { free_2(wild); goto ifnode; } | |
691 | if(nodepnt==BITATTRIBUTES_MAX) { free_2(wild); goto ifnode; } | |
691 | 692 | } |
692 | 693 | } |
693 | 694 | break; |
727 | 728 | b->attribs[i].flags = ba[i].flags; |
728 | 729 | } |
729 | 730 | |
730 | b->nbits=nodepnt; | |
731 | b->nnbits=nodepnt; | |
731 | 732 | strcpy(b->name=(char *)malloc_2(strlen(vec)+1),vec); |
732 | 733 | } |
733 | 734 | |
742 | 743 | { |
743 | 744 | int nodepnt=0; |
744 | 745 | int i; |
745 | struct Node *n[512]; | |
746 | struct Node *n[BITATTRIBUTES_MAX]; | |
746 | 747 | struct Bits *b=NULL; |
747 | 748 | |
748 | 749 | if(!direction) |
751 | 752 | if(get_s_selected(GLOBALS->facs[i])) |
752 | 753 | { |
753 | 754 | n[nodepnt++]=GLOBALS->facs[i]->n; |
754 | if((nodepnt==512)||(numrows==nodepnt)) break; | |
755 | if((nodepnt==BITATTRIBUTES_MAX)||(numrows==nodepnt)) break; | |
755 | 756 | } |
756 | 757 | } |
757 | 758 | else |
760 | 761 | if(get_s_selected(GLOBALS->facs[i])) |
761 | 762 | { |
762 | 763 | n[nodepnt++]=GLOBALS->facs[i]->n; |
763 | if((nodepnt==512)||(numrows==nodepnt)) break; | |
764 | if((nodepnt==BITATTRIBUTES_MAX)||(numrows==nodepnt)) break; | |
764 | 765 | } |
765 | 766 | } |
766 | 767 | |
775 | 776 | if(n[i]->mv.mvlfac) import_trace(n[i]); |
776 | 777 | } |
777 | 778 | |
778 | b->nbits=nodepnt; | |
779 | b->nnbits=nodepnt; | |
779 | 780 | strcpy(b->name=(char *)malloc_2(strlen(vec)+1),vec); |
780 | 781 | } |
781 | 782 | |
871 | 872 | if(n[i]->mv.mvlfac) import_trace(n[i]); |
872 | 873 | } |
873 | 874 | |
874 | b->nbits=nodepnt; | |
875 | b->nnbits=nodepnt; | |
875 | 876 | |
876 | 877 | if(vec) |
877 | 878 | { |
1042 | 1043 | { |
1043 | 1044 | int nodepnt=0; |
1044 | 1045 | int i; |
1045 | struct Node *n[512]; | |
1046 | struct Node *n[BITATTRIBUTES_MAX]; | |
1046 | 1047 | struct Bits *b=NULL; |
1047 | 1048 | |
1048 | 1049 | if(!direction) |
1049 | 1050 | for(i=hi;i>=lo;i--) /* to keep vectors in hi..lo order */ |
1050 | 1051 | { |
1051 | 1052 | n[nodepnt++]=GLOBALS->facs[i]->n; |
1052 | if(nodepnt==512) break; | |
1053 | if(nodepnt==BITATTRIBUTES_MAX) break; | |
1053 | 1054 | } |
1054 | 1055 | else |
1055 | 1056 | for(i=lo;i<=hi;i++) /* to keep vectors in lo..hi order */ |
1056 | 1057 | { |
1057 | 1058 | n[nodepnt++]=GLOBALS->facs[i]->n; |
1058 | if(nodepnt==512) break; | |
1059 | if(nodepnt==BITATTRIBUTES_MAX) break; | |
1059 | 1060 | } |
1060 | 1061 | |
1061 | 1062 | if(nodepnt) |
1069 | 1070 | if(n[i]->mv.mvlfac) import_trace(n[i]); |
1070 | 1071 | } |
1071 | 1072 | |
1072 | b->nbits=nodepnt; | |
1073 | b->nnbits=nodepnt; | |
1073 | 1074 | |
1074 | 1075 | if(vec) |
1075 | 1076 | { |
2475 | 2476 | } |
2476 | 2477 | } |
2477 | 2478 | } |
2479 | else | |
2480 | if(*(w2+1) == '<') | |
2481 | { | |
2482 | GLOBALS->current_translate_ttrans = 0; /* will overwrite if loadable/translatable */ | |
2483 | ||
2484 | if(*(w2+2) != '0') | |
2485 | { | |
2486 | /* char *fn = strstr(w2+3, " "); */ | |
2487 | char *fn = w2+3; | |
2488 | if(fn) | |
2489 | { | |
2490 | while(*fn && isspace(*fn)) fn++; | |
2491 | if(*fn && !isspace(*fn)) | |
2492 | { | |
2493 | set_current_translate_ttrans(fn); | |
2494 | } | |
2495 | } | |
2496 | } | |
2497 | } | |
2478 | 2498 | else |
2479 | 2499 | { |
2480 | 2500 | GLOBALS->current_translate_file = 0; /* will overwrite if loadable/translatable */ |
3054 | 3074 | /****************/ |
3055 | 3075 | |
3056 | 3076 | /* |
3057 | * $Id: bitvec.c,v 1.22 2010/03/18 17:12:37 gtkwave Exp $ | |
3077 | * $Id: bitvec.c,v 1.25 2010/04/04 19:09:57 gtkwave Exp $ | |
3058 | 3078 | * $Log: bitvec.c,v $ |
3079 | * Revision 1.25 2010/04/04 19:09:57 gtkwave | |
3080 | * rename name->bvname in struct BitVector for easier grep tracking | |
3081 | * | |
3082 | * Revision 1.24 2010/03/31 15:42:47 gtkwave | |
3083 | * added preliminary transaction filter support | |
3084 | * | |
3085 | * Revision 1.23 2010/03/26 16:11:48 gtkwave | |
3086 | * added missing break statements in bits2vector switch cases | |
3087 | * | |
3059 | 3088 | * Revision 1.22 2010/03/18 17:12:37 gtkwave |
3060 | 3089 | * pedantic warning cleanups |
3061 | 3090 | * |
43 | 43 | { |
44 | 44 | void *bsearch_dummy_rv; |
45 | 45 | |
46 | GLOBALS->max_compare_time_tc_bsearch_c_1=-2+GLOBALS->shift_timebase; GLOBALS->max_compare_pos_tc_bsearch_c_1=NULL; | |
46 | GLOBALS->max_compare_time_tc_bsearch_c_1=-2; GLOBALS->max_compare_pos_tc_bsearch_c_1=NULL; | |
47 | 47 | |
48 | 48 | if(!GLOBALS->strace_ctx->timearray) return(-1); |
49 | 49 | |
84 | 84 | int rv; |
85 | 85 | |
86 | 86 | key=*((TimeType *)s1); |
87 | obj=(cpos=(*((hptr *)s2)))->time+GLOBALS->shift_timebase; | |
87 | obj=(cpos=(*((hptr *)s2)))->time; | |
88 | 88 | |
89 | 89 | if((obj<=key)&&(obj>GLOBALS->max_compare_time_bsearch_c_1)) |
90 | 90 | { |
105 | 105 | { |
106 | 106 | void *bsearch_dummy_rv; |
107 | 107 | |
108 | GLOBALS->max_compare_time_bsearch_c_1=-2+GLOBALS->shift_timebase; GLOBALS->max_compare_pos_bsearch_c_1=NULL; GLOBALS->max_compare_index=NULL; | |
108 | GLOBALS->max_compare_time_bsearch_c_1=-2; GLOBALS->max_compare_pos_bsearch_c_1=NULL; GLOBALS->max_compare_index=NULL; | |
109 | 109 | |
110 | 110 | bsearch_dummy_rv = bsearch(&key, n->harray, n->numhist, sizeof(hptr), compar_histent); |
111 | if((!GLOBALS->max_compare_pos_bsearch_c_1)||(GLOBALS->max_compare_time_bsearch_c_1<GLOBALS->shift_timebase)) | |
111 | if((!GLOBALS->max_compare_pos_bsearch_c_1)||(GLOBALS->max_compare_time_bsearch_c_1<LLDescriptor(0))) | |
112 | 112 | { |
113 | 113 | GLOBALS->max_compare_pos_bsearch_c_1=n->harray[1]; /* aix bsearch fix */ |
114 | 114 | GLOBALS->max_compare_index=&(n->harray[1]); |
127 | 127 | int rv; |
128 | 128 | |
129 | 129 | key=*((TimeType *)s1); |
130 | obj=(cpos=(*((vptr *)s2)))->time+GLOBALS->shift_timebase; | |
130 | /* obj=(cpos=(*((vptr *)s2)))->time+GLOBALS->shift_timebase; */ | |
131 | ||
132 | obj=(cpos=(*((vptr *)s2)))->time; | |
131 | 133 | |
132 | 134 | if((obj<=key)&&(obj>GLOBALS->vmax_compare_time_bsearch_c_1)) |
133 | 135 | { |
148 | 150 | { |
149 | 151 | void *bsearch_dummy_rv; |
150 | 152 | |
151 | GLOBALS->vmax_compare_time_bsearch_c_1=-2+GLOBALS->shift_timebase; GLOBALS->vmax_compare_pos_bsearch_c_1=NULL; GLOBALS->vmax_compare_index=NULL; | |
153 | GLOBALS->vmax_compare_time_bsearch_c_1=-2; GLOBALS->vmax_compare_pos_bsearch_c_1=NULL; GLOBALS->vmax_compare_index=NULL; | |
152 | 154 | |
153 | 155 | bsearch_dummy_rv = bsearch(&key, b->vectors, b->numregions, sizeof(vptr), compar_vectorent); |
154 | if((!GLOBALS->vmax_compare_pos_bsearch_c_1)||(GLOBALS->vmax_compare_time_bsearch_c_1<GLOBALS->shift_timebase)) | |
156 | if((!GLOBALS->vmax_compare_pos_bsearch_c_1)||(GLOBALS->vmax_compare_time_bsearch_c_1<LLDescriptor(0))) | |
155 | 157 | { |
156 | 158 | GLOBALS->vmax_compare_pos_bsearch_c_1=b->vectors[1]; /* aix bsearch fix */ |
157 | 159 | GLOBALS->vmax_compare_index=&(b->vectors[1]); |
270 | 272 | } |
271 | 273 | |
272 | 274 | /* |
273 | * $Id: bsearch.c,v 1.7 2010/01/22 02:10:49 gtkwave Exp $ | |
275 | * $Id: bsearch.c,v 1.9 2010/04/01 19:52:20 gtkwave Exp $ | |
274 | 276 | * $Log: bsearch.c,v $ |
277 | * Revision 1.9 2010/04/01 19:52:20 gtkwave | |
278 | * time warp fixes | |
279 | * | |
280 | * Revision 1.8 2010/04/01 03:10:58 gtkwave | |
281 | * time warp fixes | |
282 | * | |
275 | 283 | * Revision 1.7 2010/01/22 02:10:49 gtkwave |
276 | 284 | * added second pattern search capability |
277 | 285 | * |
19 | 19 | #include "regex_wave.h" |
20 | 20 | #include "translate.h" |
21 | 21 | |
22 | #define WAVE_VERSION_INFO "GTKWave Analyzer v3.3.5 (w)1999-2010 BSI" | |
22 | #define WAVE_VERSION_INFO "GTKWave Analyzer v3.3.6 (w)1999-2010 BSI" | |
23 | 23 | |
24 | 24 | #define WAVE_INF_SCALING (0.5) |
25 | 25 | #define WAVE_SI_UNITS " munpfaz" |
44 | 44 | void fractional_timescale_fix(char *); |
45 | 45 | char *convert_ascii(Trptr t, vptr v); |
46 | 46 | char *convert_ascii_vec(Trptr t, char *vec); |
47 | char *convert_ascii_real(double *d); | |
47 | char *convert_ascii_real(Trptr t, double *d); | |
48 | 48 | char *convert_ascii_string(char *s); |
49 | char *convert_ascii_vec_2(Trptr t, char *vec); | |
49 | 50 | double convert_real_vec(Trptr t, char *vec); |
50 | 51 | double convert_real(Trptr t, vptr v); |
51 | 52 | |
64 | 65 | void MaxSignalLength(void); |
65 | 66 | void RenderSigs(int trtarget, int update_waves); |
66 | 67 | int RenderSig(Trptr t, int i, int dobackground); |
68 | void populateBuffer(Trptr t, char *altname, char* buf); | |
67 | 69 | void calczoom(double z0); |
68 | 70 | void fix_wavehadj(void); |
69 | 71 | void service_zoom_in(GtkWidget *text, gpointer data); |
173 | 175 | #endif |
174 | 176 | |
175 | 177 | /* |
176 | * $Id: currenttime.h,v 1.72 2010/03/19 16:36:47 gtkwave Exp $ | |
178 | * $Id: currenttime.h,v 1.75 2010/05/03 21:42:16 gtkwave Exp $ | |
177 | 179 | * $Log: currenttime.h,v $ |
180 | * Revision 1.75 2010/05/03 21:42:16 gtkwave | |
181 | * version bump | |
182 | * | |
183 | * Revision 1.74 2010/04/14 04:21:46 gtkwave | |
184 | * update populateBuffer() usage | |
185 | * | |
186 | * Revision 1.73 2010/03/24 23:05:09 gtkwave | |
187 | * added RealToBits menu option | |
188 | * | |
178 | 189 | * Revision 1.72 2010/03/19 16:36:47 gtkwave |
179 | 190 | * version bump |
180 | 191 | * |
28 | 28 | int rcValue; |
29 | 29 | Word_t Index; |
30 | 30 | JError_t JError; |
31 | #ifdef DEBUG_PRINTF | |
31 | 32 | int ctr = 0; |
32 | 33 | |
33 | #ifdef DEBUG_PRINTF | |
34 | 34 | printf("\n*** cleanup ***\n"); |
35 | 35 | printf("Freeing %d chunks\n", GLOBALS->outstanding); |
36 | 36 | system("date"); |
45 | 45 | for (rcValue = Judy1First(PJArray, &Index, &JError); rcValue != 0; rcValue = Judy1Next(PJArray, &Index, &JError)) |
46 | 46 | { |
47 | 47 | free((void *)Index); |
48 | #ifdef DEBUG_PRINTF | |
48 | 49 | ctr++; |
50 | #endif | |
49 | 51 | } |
50 | 52 | Judy1FreeArray(&PJArray, &JError); |
51 | 53 | |
485 | 487 | } |
486 | 488 | |
487 | 489 | /* |
488 | * $Id: debug.c,v 1.13 2010/03/16 21:01:08 gtkwave Exp $ | |
490 | * $Id: debug.c,v 1.14 2010/05/01 19:20:56 gtkwave Exp $ | |
489 | 491 | * $Log: debug.c,v $ |
492 | * Revision 1.14 2010/05/01 19:20:56 gtkwave | |
493 | * cppcheck warnings fixes | |
494 | * | |
490 | 495 | * Revision 1.13 2010/03/16 21:01:08 gtkwave |
491 | 496 | * remove selected member of struct symbol |
492 | 497 | * |
66 | 66 | struct strace *s_head, *s; |
67 | 67 | TimeType basetime, maxbase, sttim, fintim; |
68 | 68 | Trptr t = find_first_highlighted_trace(); |
69 | int totaltraces, passcount; | |
69 | int totaltraces; | |
70 | #ifdef DEBUG_PRINTF | |
71 | int passcount; | |
72 | #endif | |
70 | 73 | int whichpass; |
71 | 74 | TimeType middle=0, width; |
72 | 75 | |
132 | 135 | UTimeType utt; |
133 | 136 | TimeType tt; |
134 | 137 | |
135 | h=bsearch_node(t->n.nd, basetime); | |
138 | h=bsearch_node(t->n.nd, basetime - t->shift); | |
136 | 139 | hp=GLOBALS->max_compare_index; |
137 | 140 | if((hp==&(t->n.nd->harray[1]))||(hp==&(t->n.nd->harray[0]))) return; |
138 | 141 | if(basetime == ((*hp)->time+GLOBALS->shift_timebase)) hp--; |
148 | 151 | UTimeType utt; |
149 | 152 | TimeType tt; |
150 | 153 | |
151 | v=bsearch_vector(t->n.vec, basetime); | |
154 | v=bsearch_vector(t->n.vec, basetime - t->shift); | |
152 | 155 | vp=GLOBALS->vmax_compare_index; |
153 | 156 | if((vp==&(t->n.vec->vectors[1]))||(vp==&(t->n.vec->vectors[0]))) return; |
154 | 157 | if(basetime == ((*vp)->time+GLOBALS->shift_timebase)) vp--; |
175 | 178 | UTimeType utt; |
176 | 179 | TimeType tt; |
177 | 180 | |
178 | h=bsearch_node(t->n.nd, basetime); | |
181 | h=bsearch_node(t->n.nd, basetime - t->shift); | |
179 | 182 | while(h->next && h->time==h->next->time) h=h->next; |
180 | 183 | if((whichpass)||(GLOBALS->tims.marker>=0)) h=h->next; |
181 | 184 | if(!h) return; |
189 | 192 | UTimeType utt; |
190 | 193 | TimeType tt; |
191 | 194 | |
192 | v=bsearch_vector(t->n.vec, basetime); | |
195 | v=bsearch_vector(t->n.vec, basetime - t->shift); | |
193 | 196 | while(v->next && v->time==v->next->time) v=v->next; |
194 | 197 | if((whichpass)||(GLOBALS->tims.marker>=0)) v=v->next; |
195 | 198 | if(!v) return; |
215 | 218 | { |
216 | 219 | if(strace_adjust(s->his.h->time,GLOBALS->shift_timebase)!=maxbase) |
217 | 220 | { |
218 | s->his.h=bsearch_node(t->n.nd, maxbase); | |
221 | s->his.h=bsearch_node(t->n.nd, maxbase - t->shift); | |
219 | 222 | while(s->his.h->next && s->his.h->time==s->his.h->next->time) s->his.h=s->his.h->next; |
220 | 223 | } |
221 | 224 | if(t->flags&TR_INVERT) |
295 | 298 | { |
296 | 299 | if(strace_adjust(s->his.v->time,GLOBALS->shift_timebase)!=maxbase) |
297 | 300 | { |
298 | s->his.v=bsearch_vector(t->n.vec, maxbase); | |
301 | s->his.v=bsearch_vector(t->n.vec, maxbase - t->shift); | |
299 | 302 | while(s->his.v->next && s->his.v->time==s->his.v->next->time) s->his.v=s->his.v->next; |
300 | 303 | } |
301 | 304 | chval=convert_ascii(t,s->his.v); |
304 | 307 | { |
305 | 308 | if(strace_adjust(s->his.h->time,GLOBALS->shift_timebase)!=maxbase) |
306 | 309 | { |
307 | s->his.h=bsearch_node(t->n.nd, maxbase); | |
310 | s->his.h=bsearch_node(t->n.nd, maxbase - t->shift); | |
308 | 311 | while(s->his.h->next && s->his.h->time==s->his.h->next->time) s->his.h=s->his.h->next; |
309 | 312 | } |
310 | 313 | if(s->his.h->flags&HIST_REAL) |
311 | 314 | { |
312 | 315 | if(!(s->his.h->flags&HIST_STRING)) |
313 | 316 | { |
314 | chval=convert_ascii_real((double *)s->his.h->v.h_vector); | |
317 | chval=convert_ascii_real(t, (double *)s->his.h->v.h_vector); | |
315 | 318 | } |
316 | 319 | else |
317 | 320 | { |
428 | 431 | |
429 | 432 | if((maxbase<sttim)||(maxbase>fintim)) return; |
430 | 433 | |
434 | #ifdef DEBUG_PRINTF | |
431 | 435 | DEBUG(printf("Maxbase: "TTFormat", total traces: %d\n",maxbase, totaltraces)); |
432 | 436 | s=s_head; |
433 | 437 | passcount=0; |
437 | 441 | if(s->search_result) passcount++; |
438 | 442 | s=s->next; |
439 | 443 | } |
444 | #endif | |
440 | 445 | |
441 | 446 | if(totaltraces) |
442 | 447 | { |
572 | 577 | } |
573 | 578 | |
574 | 579 | /* |
575 | * $Id: edgebuttons.c,v 1.8 2010/03/14 07:09:49 gtkwave Exp $ | |
580 | * $Id: edgebuttons.c,v 1.11 2010/05/01 19:46:28 gtkwave Exp $ | |
576 | 581 | * $Log: edgebuttons.c,v $ |
582 | * Revision 1.11 2010/05/01 19:46:28 gtkwave | |
583 | * cppcheck warning fixes | |
584 | * | |
585 | * Revision 1.10 2010/04/01 03:10:58 gtkwave | |
586 | * time warp fixes | |
587 | * | |
588 | * Revision 1.9 2010/03/24 23:05:09 gtkwave | |
589 | * added RealToBits menu option | |
590 | * | |
577 | 591 | * Revision 1.8 2010/03/14 07:09:49 gtkwave |
578 | 592 | * removed ExtNode and merged with Node |
579 | 593 | * |
11 | 11 | #ifndef WAVE_EXTRDR_H |
12 | 12 | #define WAVE_EXTRDR_H |
13 | 13 | |
14 | #ifndef _MSC_VER | |
14 | #ifdef HAVE_INTTYPES_H | |
15 | 15 | #include <inttypes.h> |
16 | 16 | #endif |
17 | 17 | |
25 | 25 | #endif |
26 | 26 | |
27 | 27 | /* |
28 | * $Id: extload.h,v 1.1 2009/01/27 07:04:28 gtkwave Exp $ | |
28 | * $Id: extload.h,v 1.2 2010/04/27 23:10:56 gtkwave Exp $ | |
29 | 29 | * $Log: extload.h,v $ |
30 | * Revision 1.2 2010/04/27 23:10:56 gtkwave | |
31 | * made inttype.h inclusion conditional | |
32 | * | |
30 | 33 | * Revision 1.1 2009/01/27 07:04:28 gtkwave |
31 | 34 | * added extload external process loader capability |
32 | 35 | * |
11 | 11 | #ifndef WAVE_FSTRDR_H |
12 | 12 | #define WAVE_FSTRDR_H |
13 | 13 | |
14 | #ifndef _MSC_VER | |
14 | #ifdef HAVE_INTTYPES_H | |
15 | 15 | #include <inttypes.h> |
16 | 16 | #endif |
17 | 17 | |
26 | 26 | #endif |
27 | 27 | |
28 | 28 | /* |
29 | * $Id: fst.h,v 1.1 2009/08/06 20:03:15 gtkwave Exp $ | |
29 | * $Id: fst.h,v 1.2 2010/04/27 23:10:56 gtkwave Exp $ | |
30 | 30 | * $Log: fst.h,v $ |
31 | * Revision 1.2 2010/04/27 23:10:56 gtkwave | |
32 | * made inttype.h inclusion conditional | |
33 | * | |
31 | 34 | * Revision 1.1 2009/08/06 20:03:15 gtkwave |
32 | 35 | * creation |
33 | 36 | * |
24 | 24 | #include <stdlib.h> |
25 | 25 | |
26 | 26 | |
27 | #if HAVE_INTTYPES_H | |
27 | #ifdef HAVE_INTTYPES_H | |
28 | 28 | #include <inttypes.h> |
29 | 29 | #define GHWLLD "%"PRId64 |
30 | 30 | #define GHWLD "%"PRId32 |
39 | 39 | #define GHWLD "%d" |
40 | 40 | #else |
41 | 41 | #define GHWLLD "%lld" |
42 | #define GHWLLD "%ld" | |
42 | #define GHWLD "%ld" | |
43 | 43 | #endif |
44 | 44 | #endif |
45 | 45 | #endif |
421 | 421 | #endif /* _GHWLIB_H_ */ |
422 | 422 | |
423 | 423 | /* |
424 | * $Id: ghwlib.h,v 1.5 2009/12/29 07:07:49 gtkwave Exp $ | |
424 | * $Id: ghwlib.h,v 1.7 2010/04/27 23:10:56 gtkwave Exp $ | |
425 | 425 | * $Log: ghwlib.h,v $ |
426 | * Revision 1.7 2010/04/27 23:10:56 gtkwave | |
427 | * made inttype.h inclusion conditional | |
428 | * | |
429 | * Revision 1.6 2010/04/25 01:04:21 gtkwave | |
430 | * typo fix | |
431 | * | |
426 | 432 | * Revision 1.5 2009/12/29 07:07:49 gtkwave |
427 | 433 | * fixes for ghw files |
428 | 434 | * |
28 | 28 | #include "pixmaps.h" |
29 | 29 | #include "print.h" |
30 | 30 | #include "ptranslate.h" |
31 | #include "ttranslate.h" | |
31 | 32 | #include "rc.h" |
32 | 33 | #include "regex_wave.h" |
33 | 34 | #include "strace.h" |
927 | 928 | 0, /* dnd_tgt_on_wavearea_treesearch_gtk2_c_1 */ |
928 | 929 | NULL, /* dnd_sigview */ |
929 | 930 | |
931 | ||
932 | /* | |
933 | * ttranslate.c | |
934 | */ | |
935 | 0, /* current_translate_ttrans */ | |
936 | 0, /* current_filter_ttranslate_c_1 */ | |
937 | 0, /* num_ttrans_filters */ | |
938 | NULL, /* ttranssel_filter */ | |
939 | NULL, /* ttrans_filter */ | |
940 | 0, /* is_active_ttranslate_c_2 */ | |
941 | NULL, /* fcurr_ttranslate_c_1 */ | |
942 | NULL, /* window_ttranslate_c_5 */ | |
943 | NULL, /* clist_ttranslate_c_2 */ | |
944 | ||
945 | ||
930 | 946 | /* |
931 | 947 | * vcd.c |
932 | 948 | */ |
1107 | 1123 | */ |
1108 | 1124 | 0, /* use_scrollwheel_as_y */ |
1109 | 1125 | 0, /* m1x_wavewindow_c_1 589 */ |
1110 | 0, /* m2x */ | |
1126 | 0, /* m2x_wavewindow_c_1 */ | |
1127 | 0, /* black_and_white */ | |
1111 | 1128 | 1, /* signalwindow_width_dirty 590 */ |
1112 | 1129 | 1, /* enable_ghost_marker 591 */ |
1113 | 1130 | 1, /* enable_horiz_grid 592 */ |
1378 | 1395 | |
1379 | 1396 | /* Kill any open processes */ |
1380 | 1397 | remove_all_proc_filters(); |
1398 | remove_all_ttrans_filters(); | |
1381 | 1399 | |
1382 | 1400 | /* Instantiate new global status */ |
1383 | 1401 | new_globals = initialize_globals(); |
1432 | 1450 | new_globals->signalpixmap = GLOBALS->signalpixmap; |
1433 | 1451 | new_globals->wave_splash_pixmap = GLOBALS->wave_splash_pixmap; |
1434 | 1452 | new_globals->wave_splash_mask = GLOBALS->wave_splash_mask; |
1453 | ||
1454 | new_globals->black_and_white = GLOBALS->black_and_white; | |
1435 | 1455 | |
1436 | 1456 | new_globals->gc_white = GLOBALS->gc_white; |
1437 | 1457 | new_globals->gc_black = GLOBALS->gc_black; |
1482 | 1502 | new_globals->gccache_gmstrd = GLOBALS->gccache_gmstrd; |
1483 | 1503 | new_globals->gccache_back_wavewindow_c_1 = GLOBALS->gccache_back_wavewindow_c_1; |
1484 | 1504 | new_globals->gccache_baseline_wavewindow_c_1 = GLOBALS->gccache_baseline_wavewindow_c_1; |
1505 | new_globals->gccache_grid_wavewindow_c_1 = GLOBALS->gccache_grid_wavewindow_c_1; | |
1485 | 1506 | new_globals->gccache_grid2_wavewindow_c_1 = GLOBALS->gccache_grid2_wavewindow_c_1; |
1486 | 1507 | new_globals->gccache_time_wavewindow_c_1 = GLOBALS->gccache_time_wavewindow_c_1; |
1487 | 1508 | new_globals->gccache_timeb_wavewindow_c_1 = GLOBALS->gccache_timeb_wavewindow_c_1; |
1715 | 1736 | strcpy2_into_new_context(new_globals, &new_globals->stems_name, &GLOBALS->stems_name); /* remaining fileselbox() vars not handled elsewhere */ |
1716 | 1737 | strcpy2_into_new_context(new_globals, &new_globals->filesel_logfile_menu_c_1, &GLOBALS->filesel_logfile_menu_c_1); |
1717 | 1738 | strcpy2_into_new_context(new_globals, &new_globals->filesel_scriptfile_menu, &GLOBALS->filesel_scriptfile_menu); |
1739 | strcpy2_into_new_context(new_globals, &new_globals->fcurr_ttranslate_c_1, &GLOBALS->fcurr_ttranslate_c_1); | |
1718 | 1740 | strcpy2_into_new_context(new_globals, &new_globals->fcurr_ptranslate_c_1, &GLOBALS->fcurr_ptranslate_c_1); |
1719 | 1741 | strcpy2_into_new_context(new_globals, &new_globals->fcurr_translate_c_2, &GLOBALS->fcurr_translate_c_2); |
1720 | 1742 | |
1927 | 1949 | |
1928 | 1950 | init_filetrans_data(); |
1929 | 1951 | init_proctrans_data(); |
1952 | init_ttrans_data(); | |
1930 | 1953 | /* load_all_fonts(); */ |
1931 | 1954 | |
1932 | 1955 | /* attempt to reload file and recover on loader errors until successful */ |
2006 | 2029 | Index = 0; |
2007 | 2030 | for (rcValue = Judy1First(PJArray, &Index, &JError); rcValue != 0; rcValue = Judy1Next(PJArray, &Index, &JError)) |
2008 | 2031 | { |
2009 | JError_t JError; | |
2010 | 2032 | Judy1Set ((Pvoid_t)&GLOBALS->alloc2_chain, Index, &JError); |
2011 | 2033 | } |
2012 | 2034 |
41 | 41 | #include "pixmaps.h" |
42 | 42 | #include "print.h" |
43 | 43 | #include "ptranslate.h" |
44 | #include "ttranslate.h" | |
44 | 45 | #include "rc.h" |
45 | 46 | #include "regex_wave.h" |
46 | 47 | #include "strace.h" |
910 | 911 | unsigned char dnd_tgt_on_wavearea_treesearch_gtk2_c_1; /* from treesearch_gtk2.c */ |
911 | 912 | GtkWidget *dnd_sigview; /* from treesearch_gtk2.c */ |
912 | 913 | |
914 | ||
915 | /* | |
916 | * ttranslate.c | |
917 | */ | |
918 | int current_translate_ttrans; | |
919 | int current_filter_ttranslate_c_1; | |
920 | int num_ttrans_filters; | |
921 | char **ttranssel_filter; | |
922 | struct pipe_ctx **ttrans_filter; | |
923 | int is_active_ttranslate_c_2; | |
924 | char *fcurr_ttranslate_c_1; | |
925 | GtkWidget *window_ttranslate_c_5; | |
926 | GtkWidget *clist_ttranslate_c_2; | |
927 | ||
928 | ||
913 | 929 | /* |
914 | 930 | * vcd.c |
915 | 931 | */ |
1091 | 1107 | char use_scrollwheel_as_y; /* fromwavewindow.c */ |
1092 | 1108 | int m1x_wavewindow_c_1; /* from wavewindow.c 642 */ |
1093 | 1109 | int m2x_wavewindow_c_1; /* from wavewindow.c 643 */ |
1110 | char black_and_white; /* from wavewindow.c */ | |
1094 | 1111 | char signalwindow_width_dirty; /* from wavewindow.c 644 */ |
1095 | 1112 | char enable_ghost_marker; /* from wavewindow.c 645 */ |
1096 | 1113 | char enable_horiz_grid; /* from wavewindow.c 646 */ |
31 | 31 | #include <stdlib.h> |
32 | 32 | #include <string.h> |
33 | 33 | #include <ctype.h> |
34 | #ifdef HAVE_INTTYPES_H | |
34 | 35 | #include <inttypes.h> |
36 | #endif | |
35 | 37 | #include <unistd.h> |
36 | 38 | |
37 | 39 | size_t getline_replace(char **buf, size_t *len, FILE *f) |
498 | 500 | } |
499 | 501 | |
500 | 502 | /* |
501 | * $Id: evcd2vcd.c,v 1.2 2009/08/06 20:03:31 gtkwave Exp $ | |
503 | * $Id: evcd2vcd.c,v 1.3 2010/04/27 23:10:56 gtkwave Exp $ | |
502 | 504 | * $Log: evcd2vcd.c,v $ |
505 | * Revision 1.3 2010/04/27 23:10:56 gtkwave | |
506 | * made inttype.h inclusion conditional | |
507 | * | |
503 | 508 | * Revision 1.2 2009/08/06 20:03:31 gtkwave |
504 | 509 | * warnings fixes |
505 | 510 | * |
228 | 228 | } |
229 | 229 | |
230 | 230 | |
231 | static int fstCopyVarint32(unsigned char *pnt, uint32_t v) | |
232 | { | |
233 | unsigned char *spnt = pnt; | |
231 | static unsigned char *fstCopyVarint32ToLeft(unsigned char *pnt, uint32_t v) | |
232 | { | |
233 | unsigned char buf[5]; | |
234 | unsigned char *spnt = buf; | |
234 | 235 | uint32_t nxt; |
235 | 236 | |
236 | 237 | while((nxt = v>>7)) |
237 | 238 | { |
238 | *(pnt++) = (v&0x7f) | 0x80; | |
239 | *(spnt++) = (v&0x7f) | 0x80; | |
239 | 240 | v = nxt; |
240 | 241 | } |
241 | *(pnt++) = (v&0x7f); | |
242 | ||
243 | return(pnt - spnt); | |
244 | } | |
245 | ||
242 | *(spnt++) = (v&0x7f); | |
243 | ||
244 | do { | |
245 | *(--pnt) = *(--spnt); | |
246 | } while(spnt != buf); | |
247 | ||
248 | return(pnt); | |
249 | } | |
250 | ||
246 | 251 | |
247 | 252 | static uint64_t fstGetVarint64(unsigned char *mem, int *skiplen) |
248 | 253 | { |
410 | 415 | unsigned char *curval_mem; |
411 | 416 | |
412 | 417 | char *filename; |
413 | time_t simdate; | |
414 | 418 | |
415 | 419 | fstHandle maxhandle; |
416 | 420 | fstHandle numsigs; |
442 | 446 | unsigned repack_on_close : 1; |
443 | 447 | unsigned skip_writing_section_hdr : 1; |
444 | 448 | unsigned size_limit_locked : 1; |
449 | ||
450 | /* should really be semaphores, but are bytes to cut down on read-modify-write window size */ | |
451 | unsigned char already_in_flush; /* in case control-c handlers interrupt */ | |
452 | unsigned char already_in_close; /* in case control-c handlers interrupt */ | |
445 | 453 | }; |
446 | 454 | |
447 | 455 | |
614 | 622 | void fstWriterClose(void *ctx) |
615 | 623 | { |
616 | 624 | struct fstWriterContext *xc = (struct fstWriterContext *)ctx; |
617 | if(xc) | |
625 | if(xc && !xc->already_in_close && !xc->already_in_flush) | |
618 | 626 | { |
619 | 627 | unsigned char *tmem; |
620 | 628 | off_t fixup_offs, tlen, hlen; |
629 | ||
630 | xc->already_in_close = 1; /* never need to zero this out as it is freed at bottom */ | |
621 | 631 | |
622 | 632 | xc->skip_writing_section_hdr = 1; |
623 | 633 | if(!xc->size_limit_locked) |
902 | 912 | |
903 | 913 | void fstWriterFlushContext(void *ctx) |
904 | 914 | { |
915 | #ifdef FST_DEBUG | |
905 | 916 | int cnt = 0; |
917 | #endif | |
906 | 918 | int i; |
907 | 919 | unsigned char *vchg_mem; |
908 | 920 | FILE *f; |
914 | 926 | unsigned char *tmem; |
915 | 927 | off_t tlen; |
916 | 928 | off_t unc_memreq = 0; /* for reader */ |
929 | unsigned char *packmem; | |
930 | unsigned int packmemlen; | |
931 | uint32_t *vm4ip; | |
917 | 932 | |
918 | 933 | struct fstWriterContext *xc = (struct fstWriterContext *)ctx; |
919 | 934 | |
920 | if((!xc)||(xc->vchn_siz <= 1)) return; | |
935 | if((!xc)||(xc->vchn_siz <= 1)||(xc->already_in_flush)) return; | |
936 | xc->already_in_flush = 1; /* should really do this with a semaphore */ | |
921 | 937 | |
922 | 938 | scratchpad = malloc(xc->vchn_siz); |
923 | 939 | |
929 | 945 | fputc(xc->fastpack ? 'F' : 'Z', f); |
930 | 946 | fpos = 1; |
931 | 947 | |
948 | packmemlen = 1024; /* maintain a running "longest" allocation to */ | |
949 | packmem = malloc(packmemlen); /* prevent continual malloc...free every loop iter */ | |
950 | ||
932 | 951 | for(i=0;i<xc->maxhandle;i++) |
933 | 952 | { |
934 | if(xc->valpos_mem[4*i+2]) | |
935 | { | |
936 | uint32_t offs = xc->valpos_mem[4*i+2]; | |
937 | uint32_t next_offs = 0; | |
953 | vm4ip = &(xc->valpos_mem[4*i]); | |
954 | ||
955 | if(vm4ip[2]) | |
956 | { | |
957 | uint32_t offs = vm4ip[2]; | |
958 | uint32_t next_offs; | |
938 | 959 | int wrlen; |
939 | uint32_t offs2; | |
940 | ||
941 | while(offs) /* go backwards and relink forwards */ | |
942 | { | |
943 | offs2 = fstGetUint32(vchg_mem + offs); | |
944 | fstWriterSetUint32(vchg_mem + offs, next_offs); | |
945 | next_offs = offs; | |
946 | offs = offs2; | |
947 | } | |
948 | ||
949 | xc->valpos_mem[4*i+2] = fpos; | |
950 | ||
951 | offs = next_offs; | |
952 | scratchpnt = scratchpad; | |
953 | if(xc->valpos_mem[4*i+1] == 1) | |
960 | ||
961 | vm4ip[2] = fpos; | |
962 | ||
963 | scratchpnt = scratchpad + xc->vchn_siz; /* build this buffer backwards */ | |
964 | if(vm4ip[1] == 1) | |
954 | 965 | { |
955 | 966 | while(offs) |
956 | 967 | { |
961 | 972 | |
962 | 973 | time_delta = fstGetVarint32(vchg_mem + offs, &wrlen); |
963 | 974 | val = vchg_mem[offs+wrlen]; |
975 | offs = next_offs; | |
964 | 976 | |
965 | 977 | switch(val) |
966 | 978 | { |
977 | 989 | default: rcv = FST_RCV_D | (time_delta<<4); break; |
978 | 990 | } |
979 | 991 | |
980 | scratchpnt += fstCopyVarint32(scratchpnt, rcv); | |
981 | offs = next_offs; | |
992 | scratchpnt = fstCopyVarint32ToLeft(scratchpnt, rcv); | |
982 | 993 | } |
983 | 994 | } |
984 | 995 | else |
996 | 1007 | time_delta = fstGetVarint32(vchg_mem + offs, &wrlen); |
997 | 1008 | |
998 | 1009 | pnt = vchg_mem+offs+wrlen; |
999 | for(idx=0;idx<xc->valpos_mem[4*i+1];idx++) | |
1010 | offs = next_offs; | |
1011 | ||
1012 | for(idx=0;idx<vm4ip[1];idx++) | |
1000 | 1013 | { |
1001 | 1014 | if((pnt[idx] == '0') || (pnt[idx] == '1')) |
1002 | 1015 | { |
1012 | 1025 | if(is_binary) |
1013 | 1026 | { |
1014 | 1027 | unsigned char acc = 0; |
1015 | int shift = 7; | |
1016 | scratchpnt += fstCopyVarint32(scratchpnt, (time_delta << 1)); | |
1017 | for(idx=0;idx<xc->valpos_mem[4*i+1];idx++) | |
1028 | int shift = 7 - ((vm4ip[1]-1) & 7); | |
1029 | for(idx=vm4ip[1]-1;idx>=0;idx--) | |
1018 | 1030 | { |
1019 | 1031 | acc |= (pnt[idx] & 1) << shift; |
1020 | shift--; | |
1021 | if(shift < 0) | |
1032 | shift++; | |
1033 | if(shift == 8) | |
1022 | 1034 | { |
1023 | *(scratchpnt++) = acc; | |
1024 | shift = 7; | |
1035 | *(--scratchpnt) = acc; | |
1036 | shift = 0; | |
1025 | 1037 | acc = 0; |
1026 | 1038 | } |
1027 | 1039 | } |
1028 | if(shift != 7) | |
1029 | { | |
1030 | *(scratchpnt++) = acc; | |
1031 | } | |
1040 | ||
1041 | scratchpnt = fstCopyVarint32ToLeft(scratchpnt, (time_delta << 1)); | |
1032 | 1042 | } |
1033 | 1043 | else |
1034 | 1044 | { |
1035 | scratchpnt += fstCopyVarint32(scratchpnt, (time_delta << 1) | 1); | |
1036 | memcpy(scratchpnt, pnt, xc->valpos_mem[4*i+1]); | |
1037 | scratchpnt += xc->valpos_mem[4*i+1]; | |
1045 | scratchpnt -= vm4ip[1]; | |
1046 | memcpy(scratchpnt, pnt, vm4ip[1]); | |
1047 | ||
1048 | scratchpnt = fstCopyVarint32ToLeft(scratchpnt, (time_delta << 1) | 1); | |
1038 | 1049 | } |
1039 | ||
1040 | offs = next_offs; | |
1041 | 1050 | } |
1042 | 1051 | } |
1043 | 1052 | |
1044 | wrlen = scratchpnt - scratchpad; | |
1053 | wrlen = scratchpad + xc->vchn_siz - scratchpnt; | |
1045 | 1054 | unc_memreq += wrlen; |
1046 | 1055 | if(wrlen > 32) |
1047 | 1056 | { |
1051 | 1060 | |
1052 | 1061 | if(!xc->fastpack) |
1053 | 1062 | { |
1054 | dmem = malloc(wrlen); | |
1055 | rc = compress2(dmem, &destlen, scratchpad, wrlen, 4); | |
1063 | if(wrlen <= packmemlen) | |
1064 | { | |
1065 | dmem = packmem; | |
1066 | } | |
1067 | else | |
1068 | { | |
1069 | free(packmem); | |
1070 | dmem = packmem = malloc(packmemlen = wrlen); | |
1071 | } | |
1072 | ||
1073 | rc = compress2(dmem, &destlen, scratchpnt, wrlen, 4); | |
1056 | 1074 | if(rc == Z_OK) |
1057 | 1075 | { |
1058 | 1076 | fpos += fstWriterVarint(f, wrlen); |
1063 | 1081 | { |
1064 | 1082 | fpos += fstWriterVarint(f, 0); |
1065 | 1083 | fpos += wrlen; |
1066 | fstFwrite(scratchpad, wrlen, 1, f); | |
1084 | fstFwrite(scratchpnt, wrlen, 1, f); | |
1067 | 1085 | } |
1068 | free(dmem); | |
1069 | 1086 | } |
1070 | 1087 | else |
1071 | 1088 | { |
1072 | dmem = malloc((wrlen * 2) + 2); | |
1073 | rc = fastlz_compress(scratchpad, wrlen, dmem); | |
1089 | if(((wrlen * 2) + 2) <= packmemlen) | |
1090 | { | |
1091 | dmem = packmem; | |
1092 | } | |
1093 | else | |
1094 | { | |
1095 | free(packmem); | |
1096 | dmem = packmem = malloc(packmemlen = (wrlen * 2) + 2); | |
1097 | } | |
1098 | ||
1099 | rc = fastlz_compress(scratchpnt, wrlen, dmem); | |
1074 | 1100 | if(rc < destlen) |
1075 | 1101 | { |
1076 | 1102 | fpos += fstWriterVarint(f, wrlen); |
1081 | 1107 | { |
1082 | 1108 | fpos += fstWriterVarint(f, 0); |
1083 | 1109 | fpos += wrlen; |
1084 | fstFwrite(scratchpad, wrlen, 1, f); | |
1110 | fstFwrite(scratchpnt, wrlen, 1, f); | |
1085 | 1111 | } |
1086 | free(dmem); | |
1087 | 1112 | } |
1088 | 1113 | } |
1089 | 1114 | else |
1090 | 1115 | { |
1091 | 1116 | fpos += fstWriterVarint(f, 0); |
1092 | 1117 | fpos += wrlen; |
1093 | fstFwrite(scratchpad, wrlen, 1, f); | |
1094 | } | |
1095 | ||
1096 | xc->valpos_mem[4*i+3] = 0; | |
1118 | fstFwrite(scratchpnt, wrlen, 1, f); | |
1119 | } | |
1120 | ||
1121 | vm4ip[3] = 0; | |
1122 | #ifdef FST_DEBUG | |
1097 | 1123 | cnt++; |
1098 | } | |
1099 | } | |
1124 | #endif | |
1125 | } | |
1126 | } | |
1127 | ||
1128 | free(packmem); packmem = NULL; packmemlen = 0; | |
1100 | 1129 | |
1101 | 1130 | prevpos = 0; zerocnt = 0; |
1102 | 1131 | free(scratchpad); scratchpad = NULL; |
1106 | 1135 | |
1107 | 1136 | for(i=0;i<xc->maxhandle;i++) |
1108 | 1137 | { |
1109 | if(xc->valpos_mem[4*i+2]) | |
1138 | vm4ip = &(xc->valpos_mem[4*i]); | |
1139 | ||
1140 | if(vm4ip[2]) | |
1110 | 1141 | { |
1111 | 1142 | if(zerocnt) |
1112 | 1143 | { |
1114 | 1145 | zerocnt = 0; |
1115 | 1146 | } |
1116 | 1147 | |
1117 | fpos += fstWriterVarint(f, ((xc->valpos_mem[4*i+2] - prevpos) << 1) | 1); | |
1118 | prevpos = xc->valpos_mem[4*i+2]; | |
1119 | xc->valpos_mem[4*i+2] = 0; | |
1120 | xc->valpos_mem[4*i+3] = 0; /* clear out tchn idx */ | |
1148 | fpos += fstWriterVarint(f, ((vm4ip[2] - prevpos) << 1) | 1); | |
1149 | prevpos = vm4ip[2]; | |
1150 | vm4ip[2] = 0; | |
1151 | vm4ip[3] = 0; /* clear out tchn idx */ | |
1121 | 1152 | } |
1122 | 1153 | else |
1123 | 1154 | { |
1209 | 1240 | fstWriterEmitSectionHeader(xc); /* emit next section header */ |
1210 | 1241 | } |
1211 | 1242 | fflush(xc->handle); |
1243 | ||
1244 | xc->already_in_flush = 0; | |
1212 | 1245 | } |
1213 | 1246 | |
1214 | 1247 | |
1267 | 1300 | } |
1268 | 1301 | |
1269 | 1302 | |
1303 | void fstWriterSetTimescaleFromString(void *ctx, const char *s) | |
1304 | { | |
1305 | struct fstWriterContext *xc = (struct fstWriterContext *)ctx; | |
1306 | if(xc && s) | |
1307 | { | |
1308 | int mat = 0; | |
1309 | int exp = -9; | |
1310 | int tv = atoi(s); | |
1311 | const char *pnt = s; | |
1312 | ||
1313 | while(*pnt) | |
1314 | { | |
1315 | switch(*pnt) | |
1316 | { | |
1317 | case 'm': exp = -3; mat = 1; break; | |
1318 | case 'u': exp = -6; mat = 1; break; | |
1319 | case 'n': exp = -9; mat = 1; break; | |
1320 | case 'p': exp = -12; mat = 1; break; | |
1321 | case 'f': exp = -15; mat = 1; break; | |
1322 | case 'a': exp = -18; mat = 1; break; | |
1323 | case 'z': exp = -21; mat = 1; break; | |
1324 | case 's': exp = -0; mat = 1; break; | |
1325 | default: break; | |
1326 | } | |
1327 | ||
1328 | if(mat) break; | |
1329 | pnt++; | |
1330 | } | |
1331 | ||
1332 | if(tv == 10) | |
1333 | { | |
1334 | exp++; | |
1335 | } | |
1336 | else | |
1337 | if(tv == 100) | |
1338 | { | |
1339 | exp+=2; | |
1340 | } | |
1341 | ||
1342 | fstWriterSetTimescale(ctx, exp); | |
1343 | } | |
1344 | } | |
1345 | ||
1346 | ||
1270 | 1347 | void fstWriterSetPackType(void *ctx, int typ) |
1271 | 1348 | { |
1272 | 1349 | struct fstWriterContext *xc = (struct fstWriterContext *)ctx; |
1427 | 1504 | { |
1428 | 1505 | uint32_t prev_chg; |
1429 | 1506 | uint32_t fpos; |
1507 | uint32_t *vm4ip; | |
1430 | 1508 | |
1431 | 1509 | if(!xc->valpos_mem) |
1432 | 1510 | { |
1511 | xc->vc_emitted = 1; | |
1433 | 1512 | fstWriterCreateMmaps(xc); |
1434 | 1513 | } |
1435 | 1514 | |
1436 | xc->vc_emitted = 1; | |
1437 | ||
1438 | 1515 | handle--; /* move starting at 1 index to starting at 0 */ |
1439 | offs = xc->valpos_mem[4*handle]; | |
1440 | len = xc->valpos_mem[4*handle+1]; | |
1516 | vm4ip = &(xc->valpos_mem[4*handle]); | |
1517 | offs = vm4ip[0]; | |
1518 | len = vm4ip[1]; | |
1441 | 1519 | memcpy(xc->curval_mem + offs, buf, len); |
1442 | 1520 | |
1443 | 1521 | if(!xc->is_initial_time) |
1444 | 1522 | { |
1445 | prev_chg = xc->valpos_mem[4*handle+2]; | |
1523 | prev_chg = vm4ip[2]; | |
1446 | 1524 | fpos = xc->vchn_siz; |
1447 | 1525 | |
1448 | 1526 | fstFwrite(&prev_chg, 1, sizeof(uint32_t), xc->vchn_handle); |
1449 | 1527 | xc->vchn_siz += 4; |
1450 | xc->valpos_mem[4*handle+2] = fpos; | |
1451 | xc->vchn_siz += fstWriterVarint(xc->vchn_handle, xc->tchn_idx - xc->valpos_mem[4*handle+3]); | |
1452 | xc->valpos_mem[4*handle+3] = xc->tchn_idx; | |
1528 | xc->vchn_siz += fstWriterVarint(xc->vchn_handle, xc->tchn_idx - vm4ip[3]); | |
1453 | 1529 | fstFwrite(buf, len, 1, xc->vchn_handle); |
1454 | 1530 | xc->vchn_siz += len; |
1531 | vm4ip[3] = xc->tchn_idx; | |
1532 | vm4ip[2] = fpos; | |
1455 | 1533 | } |
1456 | 1534 | } |
1457 | 1535 | } |
2340 | 2418 | case FST_VT_VCD_ARRAY: |
2341 | 2419 | case FST_VT_VCD_REALTIME: |
2342 | 2420 | vartype = tag; |
2343 | vardir = fgetc(xc->fh); | |
2421 | vardir = fgetc(xc->fh); /* unused in VCD reader */ | |
2344 | 2422 | pnt = str; |
2345 | 2423 | while((ch = fgetc(xc->fh))) |
2346 | 2424 | { |
151 | 151 | void fstWriterSetDate(void *ctx, const char *dat); |
152 | 152 | void fstWriterSetVersion(void *ctx, const char *vers); |
153 | 153 | void fstWriterSetTimescale(void *ctx, int ts); |
154 | void fstWriterSetTimescaleFromString(void *ctx, const char *s); | |
154 | 155 | void fstWriterSetScope(void *ctx, enum fstScopeType scopetype, |
155 | 156 | const char *scopename, const char *scopecomp); |
156 | 157 | void fstWriterSetUpscope(void *ctx); |
727 | 727 | lt->numfacs = facs_encountered; /* don't process alias value changes ever */ |
728 | 728 | } |
729 | 729 | |
730 | if(aliascache) free(aliascache); | |
730 | free(aliascache); | |
731 | 731 | } |
732 | 732 | } |
733 | 733 | |
2149 | 2149 | |
2150 | 2150 | while(s) |
2151 | 2151 | { |
2152 | if(s->name) { free(s->name); } | |
2153 | if(s->value) { free(s->value); } | |
2152 | free(s->name); | |
2153 | free(s->value); | |
2154 | 2154 | s2=s->symchain; |
2155 | 2155 | free(s); |
2156 | 2156 | s=s2; |
2180 | 2180 | } |
2181 | 2181 | |
2182 | 2182 | /* |
2183 | * $Id: lxt2_write.c,v 1.2 2008/12/20 05:08:26 gtkwave Exp $ | |
2183 | * $Id: lxt2_write.c,v 1.3 2010/05/03 20:11:03 gtkwave Exp $ | |
2184 | 2184 | * $Log: lxt2_write.c,v $ |
2185 | * Revision 1.3 2010/05/03 20:11:03 gtkwave | |
2186 | * cppcheck warning fixes | |
2187 | * | |
2185 | 2188 | * Revision 1.2 2008/12/20 05:08:26 gtkwave |
2186 | 2189 | * -Wshadow warning cleanups |
2187 | 2190 | * |
32 | 32 | #include <ctype.h> |
33 | 33 | #include <errno.h> |
34 | 34 | #include <unistd.h> |
35 | #ifdef HAVE_INTTYPES_H | |
35 | 36 | #include <inttypes.h> |
37 | #endif | |
36 | 38 | #include <zlib.h> |
37 | 39 | |
38 | 40 | #ifndef HAVE_FSEEKO |
310 | 312 | #endif |
311 | 313 | |
312 | 314 | /* |
313 | * $Id: lxt2_write.h,v 1.2 2010/02/18 17:27:07 gtkwave Exp $ | |
315 | * $Id: lxt2_write.h,v 1.3 2010/04/27 23:10:56 gtkwave Exp $ | |
314 | 316 | * $Log: lxt2_write.h,v $ |
317 | * Revision 1.3 2010/04/27 23:10:56 gtkwave | |
318 | * made inttype.h inclusion conditional | |
319 | * | |
315 | 320 | * Revision 1.2 2010/02/18 17:27:07 gtkwave |
316 | 321 | * extern "C" headers / version bump |
317 | 322 | * |
1101 | 1101 | lt_emitfacs(lt); |
1102 | 1102 | if(lt->dict) lt_finalize_dictionary(lt); |
1103 | 1103 | |
1104 | if(lt->timebuff) | |
1105 | { | |
1106 | free(lt->timebuff); | |
1107 | lt->timebuff=NULL; | |
1108 | } | |
1104 | free(lt->timebuff); | |
1105 | lt->timebuff=NULL; | |
1106 | ||
1109 | 1107 | if(lt->timehead) |
1110 | 1108 | { |
1111 | 1109 | struct lt_timetrail *t=lt->timehead; |
1407 | 1405 | lt->mintime = lt->maxtime = timeval; |
1408 | 1406 | } |
1409 | 1407 | |
1410 | if(lt->timebuff) | |
1411 | { | |
1412 | free(lt->timebuff); | |
1413 | } | |
1408 | free(lt->timebuff); | |
1414 | 1409 | lt->timebuff = trl; |
1415 | 1410 | lt->timeval = timeval; |
1416 | 1411 | rc=1; |
2813 | 2808 | } |
2814 | 2809 | |
2815 | 2810 | /* |
2816 | * $Id: lxt_write.c,v 1.4 2009/03/29 00:50:00 gtkwave Exp $ | |
2811 | * $Id: lxt_write.c,v 1.5 2010/05/03 20:11:03 gtkwave Exp $ | |
2817 | 2812 | * $Log: lxt_write.c,v $ |
2813 | * Revision 1.5 2010/05/03 20:11:03 gtkwave | |
2814 | * cppcheck warning fixes | |
2815 | * | |
2818 | 2816 | * Revision 1.4 2009/03/29 00:50:00 gtkwave |
2819 | 2817 | * update lt_close() to zero out written section offset/size. |
2820 | 2818 | * |
34 | 34 | #include <unistd.h> |
35 | 35 | #include <zlib.h> |
36 | 36 | #include <bzlib.h> |
37 | #ifdef HAVE_INTTYPES_H | |
37 | 38 | #include <inttypes.h> |
39 | #endif | |
38 | 40 | |
39 | 41 | #ifndef HAVE_FSEEKO |
40 | 42 | #define fseeko fseek |
263 | 265 | #endif |
264 | 266 | |
265 | 267 | /* |
266 | * $Id: lxt_write.h,v 1.3 2010/03/18 17:12:37 gtkwave Exp $ | |
268 | * $Id: lxt_write.h,v 1.4 2010/04/27 23:10:56 gtkwave Exp $ | |
267 | 269 | * $Log: lxt_write.h,v $ |
270 | * Revision 1.4 2010/04/27 23:10:56 gtkwave | |
271 | * made inttype.h inclusion conditional | |
272 | * | |
268 | 273 | * Revision 1.3 2010/03/18 17:12:37 gtkwave |
269 | 274 | * pedantic warning cleanups |
270 | 275 | * |
34 | 34 | |
35 | 35 | #ifndef _MSC_VER |
36 | 36 | #include <unistd.h> |
37 | #ifdef HAVE_INTTYPES_H | |
37 | 38 | #include <inttypes.h> |
39 | #endif | |
38 | 40 | #else |
39 | 41 | typedef long off_t; |
40 | 42 | #include <windows.h> |
289 | 291 | #endif |
290 | 292 | |
291 | 293 | /* |
292 | * $Id: vzt_read.h,v 1.5 2010/02/18 17:27:07 gtkwave Exp $ | |
294 | * $Id: vzt_read.h,v 1.6 2010/04/27 23:10:56 gtkwave Exp $ | |
293 | 295 | * $Log: vzt_read.h,v $ |
296 | * Revision 1.6 2010/04/27 23:10:56 gtkwave | |
297 | * made inttype.h inclusion conditional | |
298 | * | |
294 | 299 | * Revision 1.5 2010/02/18 17:27:07 gtkwave |
295 | 300 | * extern "C" headers / version bump |
296 | 301 | * |
32 | 32 | #include <ctype.h> |
33 | 33 | #include <errno.h> |
34 | 34 | #include <unistd.h> |
35 | #ifdef HAVE_INTTYPES_H | |
35 | 36 | #include <inttypes.h> |
37 | #endif | |
36 | 38 | #include <zlib.h> |
37 | 39 | #include <bzlib.h> |
38 | 40 | #include <LzmaLib.h> |
294 | 296 | #endif |
295 | 297 | |
296 | 298 | /* |
297 | * $Id: vzt_write.h,v 1.3 2010/02/18 17:27:07 gtkwave Exp $ | |
299 | * $Id: vzt_write.h,v 1.4 2010/04/27 23:10:56 gtkwave Exp $ | |
298 | 300 | * $Log: vzt_write.h,v $ |
301 | * Revision 1.4 2010/04/27 23:10:56 gtkwave | |
302 | * made inttype.h inclusion conditional | |
303 | * | |
299 | 304 | * Revision 1.3 2010/02/18 17:27:07 gtkwave |
300 | 305 | * extern "C" headers / version bump |
301 | 306 | * |
11 | 11 | #ifndef WAVE_LX2RDR_H |
12 | 12 | #define WAVE_LX2RDR_H |
13 | 13 | |
14 | #ifndef _MSC_VER | |
14 | #ifdef HAVE_INTTYPES_H | |
15 | 15 | #include <inttypes.h> |
16 | 16 | #endif |
17 | 17 | |
36 | 36 | #endif |
37 | 37 | |
38 | 38 | /* |
39 | * $Id: lx2.h,v 1.3 2009/06/07 08:40:44 gtkwave Exp $ | |
39 | * $Id: lx2.h,v 1.4 2010/04/27 23:10:56 gtkwave Exp $ | |
40 | 40 | * $Log: lx2.h,v $ |
41 | * Revision 1.4 2010/04/27 23:10:56 gtkwave | |
42 | * made inttype.h inclusion conditional | |
43 | * | |
41 | 44 | * Revision 1.3 2009/06/07 08:40:44 gtkwave |
42 | 45 | * adding FST support |
43 | 46 | * |
66 | 66 | #include "rc.h" |
67 | 67 | #include "translate.h" |
68 | 68 | #include "ptranslate.h" |
69 | #include "ttranslate.h" | |
69 | 70 | |
70 | 71 | #include "tcl_helper.h" |
71 | 72 | #if defined(HAVE_LIBTCL) |
610 | 611 | |
611 | 612 | init_filetrans_data(); /* for file translation splay trees */ |
612 | 613 | init_proctrans_data(); /* for proc translation structs */ |
614 | init_ttrans_data(); /* for transaction proc translation structs */ | |
613 | 615 | if(!mainwindow_already_built) |
614 | 616 | { |
615 | 617 | atexit(remove_all_proc_filters); |
618 | atexit(remove_all_ttrans_filters); | |
616 | 619 | #if defined __MINGW32__ |
617 | 620 | atexit(close_all_fst_files); |
618 | 621 | #endif |
2650 | 2653 | #endif |
2651 | 2654 | |
2652 | 2655 | /* |
2653 | * $Id: main.c,v 1.97 2010/03/15 15:57:28 gtkwave Exp $ | |
2656 | * $Id: main.c,v 1.98 2010/03/31 15:42:47 gtkwave Exp $ | |
2654 | 2657 | * $Log: main.c,v $ |
2658 | * Revision 1.98 2010/03/31 15:42:47 gtkwave | |
2659 | * added preliminary transaction filter support | |
2660 | * | |
2655 | 2661 | * Revision 1.97 2010/03/15 15:57:28 gtkwave |
2656 | 2662 | * only allocate hash when necessary |
2657 | 2663 | * |
22 | 22 | #include "vcd_saver.h" |
23 | 23 | #include "translate.h" |
24 | 24 | #include "ptranslate.h" |
25 | #include "ttranslate.h" | |
25 | 26 | #include "lx2.h" |
26 | 27 | #include "hierpack.h" |
27 | 28 | #include "tcl_helper.h" |
305 | 306 | } |
306 | 307 | } |
307 | 308 | |
309 | ||
310 | /********** transaction procsel filter install ********/ | |
311 | ||
312 | #if !defined __MINGW32__ && !defined _MSC_VER | |
313 | void menu_dataformat_xlate_ttrans_1(GtkWidget *widget, gpointer data) | |
314 | { | |
315 | if(GLOBALS->helpbox_is_active) | |
316 | { | |
317 | help_text_bold("\n\nTransaction Filter Process"); | |
318 | help_text( | |
319 | " will enable transaction filtering on marked traces using a filter process. A requester will appear to get the filter filename." | |
320 | ); | |
321 | return; | |
322 | } | |
323 | ||
324 | ttrans_searchbox("Select Transaction Filter Process"); | |
325 | } | |
326 | ||
327 | void menu_dataformat_xlate_ttrans_0(GtkWidget *widget, gpointer data) | |
328 | { | |
329 | if(GLOBALS->helpbox_is_active) | |
330 | { | |
331 | help_text_bold("\n\nTransaction Filter Process Disable"); | |
332 | help_text( | |
333 | " will remove transaction filtering." | |
334 | ); | |
335 | return; | |
336 | } | |
337 | ||
338 | install_ttrans_filter(0); /* disable, 0 is always NULL */ | |
339 | } | |
340 | #endif | |
308 | 341 | |
309 | 342 | /********** procsel filter install ********/ |
310 | 343 | |
916 | 949 | } |
917 | 950 | else if(t->vector==TRUE) |
918 | 951 | { |
919 | t->name = t->n.vec->name; | |
952 | t->name = t->n.vec->bvname; | |
920 | 953 | if(GLOBALS->hier_max_level) |
921 | 954 | t->name = hier_extract(t->name, GLOBALS->hier_max_level); |
922 | 955 | } |
1851 | 1884 | bits=t->n.vec->bits; |
1852 | 1885 | if(!(t->flags&TR_REVERSE)) |
1853 | 1886 | { |
1854 | for(i=0;i<bits->nbits;i++) | |
1887 | for(i=0;i<bits->nnbits;i++) | |
1855 | 1888 | { |
1856 | 1889 | if(bits->nodes[i]->expansion) bits->nodes[i]->expansion->refcnt++; |
1857 | 1890 | AddNodeTraceReturn(bits->nodes[i],NULL, &tfix); |
1863 | 1896 | } |
1864 | 1897 | else |
1865 | 1898 | { |
1866 | for(i=(bits->nbits-1);i>-1;i--) | |
1899 | for(i=(bits->nnbits-1);i>-1;i--) | |
1867 | 1900 | { |
1868 | 1901 | if(bits->nodes[i]->expansion) bits->nodes[i]->expansion->refcnt++; |
1869 | 1902 | AddNodeTraceReturn(bits->nodes[i],NULL, &tfix); |
2117 | 2150 | free_2(t->name_full); |
2118 | 2151 | t->name_full = NULL; |
2119 | 2152 | } |
2120 | if (t->n.vec->name) | |
2153 | if (t->n.vec->bvname) | |
2121 | 2154 | { |
2122 | free_2(t->n.vec->name); | |
2155 | free_2(t->n.vec->bvname); | |
2123 | 2156 | } |
2124 | 2157 | |
2125 | t->n.vec->name = (char *)malloc_2(1+strlen(GLOBALS->entrybox_text)); | |
2126 | strcpy(t->n.vec->name, GLOBALS->entrybox_text); | |
2127 | t->name = t->n.vec->name; | |
2158 | t->n.vec->bvname = (char *)malloc_2(1+strlen(GLOBALS->entrybox_text)); | |
2159 | strcpy(t->n.vec->bvname, GLOBALS->entrybox_text); | |
2160 | t->name = t->n.vec->bvname; | |
2128 | 2161 | if(GLOBALS->hier_max_level) |
2129 | 2162 | t->name = hier_extract(t->name, GLOBALS->hier_max_level); |
2130 | 2163 | |
2174 | 2207 | } |
2175 | 2208 | } |
2176 | 2209 | |
2177 | static bvptr combine_traces(int direction) | |
2210 | ||
2211 | bvptr combine_traces(int direction, Trptr single_trace_only) | |
2178 | 2212 | { |
2179 | 2213 | Trptr t, tmp; |
2180 | 2214 | int tmpi,dirty=0, attrib_reqd=0; |
2183 | 2217 | |
2184 | 2218 | DEBUG(printf("Combine Traces\n")); |
2185 | 2219 | |
2186 | t=GLOBALS->traces.first; | |
2220 | t=single_trace_only ? single_trace_only : GLOBALS->traces.first; | |
2187 | 2221 | while(t) |
2188 | 2222 | { |
2189 | 2223 | if((t->flags&TR_HIGHLIGHT)&&(!(t->flags&(TR_BLANK|TR_ANALOG_BLANK_STRETCH)))) |
2208 | 2242 | } |
2209 | 2243 | } |
2210 | 2244 | } |
2245 | if(t == single_trace_only) break; | |
2211 | 2246 | t=t->t_next; |
2212 | 2247 | } |
2213 | 2248 | |
2214 | 2249 | if(!dirty) |
2215 | 2250 | { |
2216 | must_sel_nb(); | |
2251 | if(!single_trace_only) must_sel_nb(); | |
2217 | 2252 | return NULL; |
2218 | 2253 | } |
2219 | if(dirty>512) | |
2254 | if(dirty>BITATTRIBUTES_MAX) | |
2220 | 2255 | { |
2221 | char buf[512]; | |
2222 | ||
2223 | sprintf(buf,"%d bits selected, please use <= 512.\n",dirty); | |
2224 | status_text(buf); | |
2256 | char buf[128]; | |
2257 | ||
2258 | if(!single_trace_only) | |
2259 | { | |
2260 | sprintf(buf, "%d bits selected, please use <= %d.\n", dirty, BITATTRIBUTES_MAX); | |
2261 | status_text(buf); | |
2262 | } | |
2225 | 2263 | return NULL; |
2226 | 2264 | } |
2227 | 2265 | else |
2228 | 2266 | { |
2229 | 2267 | int i,nodepnt=0; |
2230 | struct Node *n[512]; | |
2231 | struct BitAttributes ba[512]; | |
2268 | struct Node *n[BITATTRIBUTES_MAX]; | |
2269 | struct BitAttributes ba[BITATTRIBUTES_MAX]; | |
2232 | 2270 | struct Bits *b=NULL; |
2233 | 2271 | bvptr v=NULL; |
2234 | 2272 | |
2235 | FreeCutBuffer(); | |
2236 | GLOBALS->traces.buffer=GLOBALS->traces.first; | |
2237 | GLOBALS->traces.bufferlast=GLOBALS->traces.last; | |
2238 | GLOBALS->traces.buffercount=GLOBALS->traces.total; | |
2239 | ||
2240 | GLOBALS->traces.first=GLOBALS->traces.last=NULL; GLOBALS->traces.total=0; | |
2241 | ||
2242 | t=GLOBALS->traces.buffer; | |
2273 | if(!single_trace_only) | |
2274 | { | |
2275 | FreeCutBuffer(); | |
2276 | GLOBALS->traces.buffer=GLOBALS->traces.first; | |
2277 | GLOBALS->traces.bufferlast=GLOBALS->traces.last; | |
2278 | GLOBALS->traces.buffercount=GLOBALS->traces.total; | |
2279 | ||
2280 | GLOBALS->traces.first=GLOBALS->traces.last=NULL; GLOBALS->traces.total=0; | |
2281 | ||
2282 | t=GLOBALS->traces.buffer; | |
2283 | } | |
2284 | else | |
2285 | { | |
2286 | t = single_trace_only; | |
2287 | } | |
2243 | 2288 | |
2244 | 2289 | while(t) |
2245 | 2290 | { |
2261 | 2306 | |
2262 | 2307 | if(!(t->flags&TR_REVERSE)) |
2263 | 2308 | { |
2264 | for(ix=0;ix<bits->nbits;ix++) | |
2309 | for(ix=0;ix<bits->nnbits;ix++) | |
2265 | 2310 | { |
2266 | 2311 | if(bits->nodes[ix]->expansion) bits->nodes[ix]->expansion->refcnt++; |
2267 | 2312 | ba[nodepnt].shift = t->shift + (oldba ? oldba[ix].shift : 0); |
2271 | 2316 | } |
2272 | 2317 | else |
2273 | 2318 | { |
2274 | for(ix=(bits->nbits-1);ix>-1;ix--) | |
2319 | for(ix=(bits->nnbits-1);ix>-1;ix--) | |
2275 | 2320 | { |
2276 | 2321 | if(bits->nodes[ix]->expansion) bits->nodes[ix]->expansion->refcnt++; |
2277 | 2322 | ba[nodepnt].shift = t->shift + (oldba ? oldba[ix].shift : 0); |
2307 | 2352 | } |
2308 | 2353 | } |
2309 | 2354 | if(nodepnt==dirty) break; |
2355 | if(t == single_trace_only) break; | |
2310 | 2356 | t=t->t_next; |
2311 | 2357 | } |
2312 | 2358 | |
2411 | 2457 | } |
2412 | 2458 | } |
2413 | 2459 | |
2414 | b->nbits=nodepnt; | |
2460 | b->nnbits=nodepnt; | |
2415 | 2461 | |
2416 | 2462 | if(!bitblast_parent) |
2417 | 2463 | { |
2506 | 2552 | return NULL; |
2507 | 2553 | } |
2508 | 2554 | |
2509 | tmp=GLOBALS->traces.buffer; GLOBALS->traces.buffer=GLOBALS->traces.first; GLOBALS->traces.first=tmp; | |
2510 | tmp=GLOBALS->traces.bufferlast; GLOBALS->traces.bufferlast=GLOBALS->traces.last; GLOBALS->traces.last=tmp; | |
2511 | tmpi=GLOBALS->traces.buffercount; GLOBALS->traces.buffercount=GLOBALS->traces.total; | |
2512 | GLOBALS->traces.total=tmpi; | |
2513 | PasteBuffer(); | |
2555 | if(!single_trace_only) | |
2556 | { | |
2557 | tmp=GLOBALS->traces.buffer; GLOBALS->traces.buffer=GLOBALS->traces.first; GLOBALS->traces.first=tmp; | |
2558 | tmp=GLOBALS->traces.bufferlast; GLOBALS->traces.bufferlast=GLOBALS->traces.last; GLOBALS->traces.last=tmp; | |
2559 | tmpi=GLOBALS->traces.buffercount; GLOBALS->traces.buffercount=GLOBALS->traces.total; | |
2560 | GLOBALS->traces.total=tmpi; | |
2561 | PasteBuffer(); | |
2562 | } | |
2514 | 2563 | |
2515 | 2564 | return v; |
2516 | ||
2517 | 2565 | } |
2518 | 2566 | } |
2519 | 2567 | |
2537 | 2585 | } |
2538 | 2586 | |
2539 | 2587 | if(GLOBALS->dnd_state) { dnd_error(); return; } /* don't mess with sigs when dnd active */ |
2540 | v = combine_traces(1); /* down */ | |
2588 | v = combine_traces(1, NULL); /* down */ | |
2541 | 2589 | |
2542 | 2590 | if (v) |
2543 | 2591 | { |
2587 | 2635 | } |
2588 | 2636 | |
2589 | 2637 | if(GLOBALS->dnd_state) { dnd_error(); return; } /* don't mess with sigs when dnd active */ |
2590 | v = combine_traces(0); /* up */ | |
2638 | v = combine_traces(0, NULL); /* up */ | |
2591 | 2639 | |
2592 | 2640 | if (v) |
2593 | 2641 | { |
2618 | 2666 | } |
2619 | 2667 | |
2620 | 2668 | /**/ |
2621 | #if 0 | |
2622 | /* this function should be obsolete with the new group handling, so commented out... */ | |
2623 | ||
2624 | void | |
2625 | menu_reduce_singlebit_vex(GtkWidget *widget, gpointer data) | |
2626 | { | |
2627 | Trptr t, tmp; | |
2628 | int tmpi,dirty=0; | |
2629 | ||
2630 | if(GLOBALS->helpbox_is_active) | |
2631 | { | |
2632 | help_text_bold("\n\nReduce Single Bit Vectors"); | |
2633 | help_text( | |
2634 | " decomposes the highlighted traces into their individual" | |
2635 | " bits only if the highlighted traces are one bit wide vectors." | |
2636 | " In effect, this function allows single-bit vectors" | |
2637 | " to be viewed as signals." | |
2638 | " The resulting bits are converted to traces and inserted after the" | |
2639 | " last converted trace with the pre-conversion traces" | |
2640 | " being placed in the cut buffer." | |
2641 | ); | |
2642 | return; | |
2643 | } | |
2644 | ||
2645 | ||
2646 | if(GLOBALS->dnd_state) { dnd_error(); return; } /* don't mess with sigs when dnd active */ | |
2647 | ||
2648 | DEBUG(printf("Reduce Singlebit Vex\n")); | |
2649 | ||
2650 | t=GLOBALS->traces.first; | |
2651 | while(t) | |
2652 | { | |
2653 | if((t->flags&TR_HIGHLIGHT)&&(!(t->flags&(TR_BLANK|TR_ANALOG_BLANK_STRETCH)))) | |
2654 | { | |
2655 | dirty=1; | |
2656 | break; | |
2657 | } | |
2658 | t=t->t_next; | |
2659 | } | |
2660 | ||
2661 | if(dirty) | |
2662 | { | |
2663 | FreeCutBuffer(); | |
2664 | GLOBALS->traces.buffer=GLOBALS->traces.first; | |
2665 | GLOBALS->traces.bufferlast=GLOBALS->traces.last; | |
2666 | GLOBALS->traces.buffercount=GLOBALS->traces.total; | |
2667 | ||
2668 | GLOBALS->traces.first=GLOBALS->traces.last=NULL; GLOBALS->traces.total=0; | |
2669 | ||
2670 | t=GLOBALS->traces.buffer; | |
2671 | ||
2672 | while(t) | |
2673 | { | |
2674 | if(t->flags&TR_HIGHLIGHT) | |
2675 | { | |
2676 | if(t->flags&(TR_BLANK|TR_ANALOG_BLANK_STRETCH)) | |
2677 | { | |
2678 | AddBlankTrace(t->name); | |
2679 | } | |
2680 | else | |
2681 | { | |
2682 | if(t->vector) | |
2683 | { | |
2684 | bptr bits; | |
2685 | bits=t->n.vec->bits; | |
2686 | if(bits->nbits==1) | |
2687 | { | |
2688 | AddNode(bits->nodes[0],NULL); | |
2689 | } | |
2690 | else | |
2691 | { | |
2692 | /* reset the cut criteria */ | |
2693 | t->flags&=(~TR_HIGHLIGHT); | |
2694 | } | |
2695 | } | |
2696 | else | |
2697 | { | |
2698 | AddNode(t->n.nd,NULL); | |
2699 | } | |
2700 | } | |
2701 | } | |
2702 | t=t->t_next; | |
2703 | } | |
2704 | ||
2705 | tmp=GLOBALS->traces.buffer; GLOBALS->traces.buffer=GLOBALS->traces.first; GLOBALS->traces.first=tmp; | |
2706 | tmp=GLOBALS->traces.bufferlast; GLOBALS->traces.bufferlast=GLOBALS->traces.last; GLOBALS->traces.last=tmp; | |
2707 | tmpi=GLOBALS->traces.buffercount; GLOBALS->traces.buffercount=GLOBALS->traces.total; | |
2708 | GLOBALS->traces.total=tmpi; | |
2709 | PasteBuffer(); | |
2710 | /* CutBuffer(); */ | |
2711 | ||
2712 | GLOBALS->signalwindow_width_dirty=1; | |
2713 | MaxSignalLength(); | |
2714 | signalarea_configure_event(GLOBALS->signalarea, NULL); | |
2715 | wavearea_configure_event(GLOBALS->wavearea, NULL); | |
2716 | } | |
2717 | else | |
2718 | { | |
2719 | must_sel_nb(); | |
2720 | } | |
2721 | } | |
2722 | #endif | |
2723 | ||
2724 | /**/ | |
2669 | ||
2725 | 2670 | void menu_tracesearchbox_callback(GtkWidget *widget, gpointer data) |
2726 | 2671 | { |
2727 | 2672 | } |
2859 | 2804 | g_now->vcd_jmp_buf = NULL; |
2860 | 2805 | |
2861 | 2806 | /* copy old file req strings into new context */ |
2807 | strcpy2_into_new_context(GLOBALS, &GLOBALS->fcurr_ttranslate_c_1, &g_old->fcurr_ttranslate_c_1); | |
2862 | 2808 | strcpy2_into_new_context(GLOBALS, &GLOBALS->fcurr_ptranslate_c_1, &g_old->fcurr_ptranslate_c_1); |
2863 | 2809 | strcpy2_into_new_context(GLOBALS, &GLOBALS->fcurr_translate_c_2, &g_old->fcurr_translate_c_2); |
2864 | 2810 | |
3314 | 3260 | free_2(t->name_full); |
3315 | 3261 | t->name_full = NULL; |
3316 | 3262 | |
3317 | name_full = (t->vector) ? t->n.vec->name : t->n.nd->nname; | |
3263 | name_full = (t->vector) ? t->n.vec->bvname : t->n.nd->nname; | |
3318 | 3264 | t->name = name_full; |
3319 | 3265 | if (GLOBALS->hier_max_level) |
3320 | 3266 | t->name = hier_extract(t->name, GLOBALS->hier_max_level); |
3659 | 3605 | { |
3660 | 3606 | if((t->flags & TR_PTRANSLATED) && (!t->p_filter)) t->flags &= (~TR_PTRANSLATED); |
3661 | 3607 | if((t->flags & TR_FTRANSLATED) && (!t->f_filter)) t->flags &= (~TR_FTRANSLATED); |
3608 | if((t->flags & TR_TTRANSLATED) && (!t->t_filter)) t->flags &= (~TR_TTRANSLATED); | |
3662 | 3609 | fprintf(wave,"@%x\n",def=t->flags); |
3663 | 3610 | } |
3664 | 3611 | |
3694 | 3641 | } |
3695 | 3642 | } |
3696 | 3643 | |
3644 | /* NOT an else! */ | |
3645 | if(t->flags & TR_TTRANSLATED) | |
3646 | { | |
3647 | if(t->t_filter && GLOBALS->ttranssel_filter[t->t_filter]) | |
3648 | { | |
3649 | fprintf(wave, "^<%d %s\n", t->t_filter, GLOBALS->ttranssel_filter[t->t_filter]); | |
3650 | } | |
3651 | else | |
3652 | { | |
3653 | fprintf(wave, "^<%d %s\n", 0, "disabled"); | |
3654 | } | |
3655 | } | |
3656 | ||
3697 | 3657 | if(t->vector) |
3698 | 3658 | { |
3699 | 3659 | int ix; |
3705 | 3665 | bits = t->n.vec->bits; |
3706 | 3666 | ba = bits ? bits->attribs : NULL; |
3707 | 3667 | |
3708 | fprintf(wave,"%c{%s}", ba ? ':' : '#', t->n.vec->name); | |
3668 | fprintf(wave,"%c{%s}", ba ? ':' : '#', | |
3669 | t->n.vec->transaction_cache ? t->n.vec->transaction_cache->bvname : t->n.vec->bvname); | |
3709 | 3670 | |
3710 | 3671 | nodes=t->n.vec->bits->nodes; |
3711 | for(ix=0;ix<t->n.vec->nbits;ix++) | |
3672 | for(ix=0;ix<t->n.vec->bits->nnbits;ix++) | |
3712 | 3673 | { |
3713 | 3674 | if(nodes[ix]->expansion) |
3714 | 3675 | { |
3793 | 3754 | { |
3794 | 3755 | if((t->flags & TR_FTRANSLATED) && (!t->f_filter)) t->flags &= (~TR_FTRANSLATED); |
3795 | 3756 | if((t->flags & TR_PTRANSLATED) && (!t->p_filter)) t->flags &= (~TR_PTRANSLATED); |
3757 | if((t->flags & TR_TTRANSLATED) && (!t->t_filter)) t->flags &= (~TR_TTRANSLATED); | |
3796 | 3758 | fprintf(wave,"@%x\n",def=t->flags); |
3797 | 3759 | } |
3798 | 3760 | |
3828 | 3790 | } |
3829 | 3791 | } |
3830 | 3792 | |
3793 | /* NOT an else! */ | |
3794 | if(t->flags & TR_TTRANSLATED) | |
3795 | { | |
3796 | if(t->t_filter && GLOBALS->ttranssel_filter[t->t_filter]) | |
3797 | { | |
3798 | fprintf(wave, "^<%d %s\n", t->t_filter, GLOBALS->ttranssel_filter[t->t_filter]); | |
3799 | } | |
3800 | else | |
3801 | { | |
3802 | fprintf(wave, "^<%d %s\n", 0, "disabled"); | |
3803 | } | |
3804 | } | |
3805 | ||
3806 | ||
3831 | 3807 | if(t->vector) |
3832 | 3808 | { |
3833 | 3809 | int ix; |
3840 | 3816 | bits = t->n.vec->bits; |
3841 | 3817 | ba = bits ? bits->attribs : NULL; |
3842 | 3818 | |
3843 | fprintf(wave,"%c{%s}", ba ? ':' : '#', t->n.vec->name); | |
3819 | fprintf(wave,"%c{%s}", ba ? ':' : '#', | |
3820 | t->n.vec->transaction_cache ? t->n.vec->transaction_cache->bvname : t->n.vec->bvname); | |
3844 | 3821 | |
3845 | 3822 | nodes=t->n.vec->bits->nodes; |
3846 | for(ix=0;ix<t->n.vec->nbits;ix++) | |
3823 | for(ix=0;ix<t->n.vec->bits->nnbits;ix++) | |
3847 | 3824 | { |
3848 | 3825 | if(nodes[ix]->expansion) |
3849 | 3826 | { |
4639 | 4616 | } |
4640 | 4617 | |
4641 | 4618 | void |
4619 | menu_dataformat_real2bon(GtkWidget *widget, gpointer data) | |
4620 | { | |
4621 | if(GLOBALS->helpbox_is_active) | |
4622 | { | |
4623 | help_text_bold("\n\nData Format-RealToBits On"); | |
4624 | help_text( | |
4625 | " will step through all highlighted traces and ensure that" | |
4626 | " Real vectors with this qualifier will be displayed as Hex" | |
4627 | " values. Note that this only works for Real quantities" | |
4628 | " and other ones will remain to display as binary. This is a pre-filter" | |
4629 | " so it is possible to invert, reverse, apply Decimal, etc. It will not be" | |
4630 | " possible however to expand those values into their constituent bits." | |
4631 | ); | |
4632 | return; | |
4633 | } | |
4634 | ||
4635 | dataformat( ~(TR_REAL2BITS|TR_NUMMASK), TR_REAL2BITS|TR_HEX ); | |
4636 | } | |
4637 | ||
4638 | void | |
4639 | menu_dataformat_real2boff(GtkWidget *widget, gpointer data) | |
4640 | { | |
4641 | if(GLOBALS->helpbox_is_active) | |
4642 | { | |
4643 | help_text_bold("\n\nData Format-RealToBits Off"); | |
4644 | help_text( | |
4645 | " will step through all highlighted traces and ensure that" | |
4646 | " the Real To Bits qualifier is removed from those traces." | |
4647 | ); | |
4648 | return; | |
4649 | } | |
4650 | ||
4651 | dataformat( ~(TR_REAL2BITS), 0 ); | |
4652 | } | |
4653 | ||
4654 | void | |
4642 | 4655 | menu_dataformat_hex(GtkWidget *widget, gpointer data) |
4643 | 4656 | { |
4644 | 4657 | if(GLOBALS->helpbox_is_active) |
5446 | 5459 | " S = Analog Step\n" |
5447 | 5460 | " I = Analog Interpolated\n" |
5448 | 5461 | " R = Real\n" |
5462 | " r = Real To Bits\n" | |
5449 | 5463 | " 0 = Range Fill with 0s\n" |
5450 | 5464 | " 1 = Range Fill with 1s\n" |
5451 | 5465 | " G = Binary to Gray\n" |
5543 | 5557 | WAVE_GTKIFE("/Edit/Data Format/Octal", "<Alt>O", menu_dataformat_oct, WV_MENU_EDFO, "<Item>"), |
5544 | 5558 | WAVE_GTKIFE("/Edit/Data Format/ASCII", NULL, menu_dataformat_ascii, WV_MENU_EDFA, "<Item>"), |
5545 | 5559 | WAVE_GTKIFE("/Edit/Data Format/BitsToReal", NULL, menu_dataformat_real, WV_MENU_EDRL, "<Item>"), |
5560 | WAVE_GTKIFE("/Edit/Data Format/RealToBits/On", NULL, menu_dataformat_real2bon, WV_MENU_EDR2BON, "<Item>"), | |
5561 | WAVE_GTKIFE("/Edit/Data Format/RealToBits/Off", NULL, menu_dataformat_real2boff, WV_MENU_EDR2BOFF, "<Item>"), | |
5546 | 5562 | WAVE_GTKIFE("/Edit/Data Format/Right Justify/On", "<Alt>J", menu_dataformat_rjustify_on, WV_MENU_EDFRJON, "<Item>"), |
5547 | 5563 | WAVE_GTKIFE("/Edit/Data Format/Right Justify/Off", "<Shift><Alt>J", menu_dataformat_rjustify_off, WV_MENU_EDFRJOFF, "<Item>"), |
5548 | 5564 | WAVE_GTKIFE("/Edit/Data Format/Invert/On", "<Alt>I", menu_dataformat_invert_on, WV_MENU_EDFION, "<Item>"), |
5555 | 5571 | #if !defined __MINGW32__ && !defined _MSC_VER |
5556 | 5572 | WAVE_GTKIFE("/Edit/Data Format/Translate Filter Process/Disable", NULL, menu_dataformat_xlate_proc_0, WV_MENU_XLP_0, "<Item>"), |
5557 | 5573 | WAVE_GTKIFE("/Edit/Data Format/Translate Filter Process/Enable and Select", NULL, menu_dataformat_xlate_proc_1, WV_MENU_XLP_1, "<Item>"), |
5574 | WAVE_GTKIFE("/Edit/Data Format/Transaction Filter Process/Disable", NULL, menu_dataformat_xlate_ttrans_0, WV_MENU_TTXLP_0, "<Item>"), | |
5575 | WAVE_GTKIFE("/Edit/Data Format/Transaction Filter Process/Enable and Select", NULL, menu_dataformat_xlate_ttrans_1, WV_MENU_TTXLP_1, "<Item>"), | |
5558 | 5576 | #endif |
5559 | 5577 | WAVE_GTKIFE("/Edit/Data Format/Analog/Off", NULL, menu_dataformat_analog_off, WV_MENU_EDFAOFF, "<Item>"), |
5560 | 5578 | WAVE_GTKIFE("/Edit/Data Format/Analog/Step", NULL, menu_dataformat_analog_step, WV_MENU_EDFASTEP, "<Item>"), |
5640 | 5658 | WAVE_GTKIFE("/Markers/<separator>", NULL, NULL, WV_MENU_SEP8, "<Separator>"), |
5641 | 5659 | WAVE_GTKIFE("/Markers/Wave Scrolling", "F9", wave_scrolling_on, WV_MENU_MWSON, "<ToggleItem>"), |
5642 | 5660 | |
5643 | WAVE_GTKIFE("/Markers/Locking/Lock to Lesser Named Marker", "1", lock_marker_left, WV_MENU_MLKLT, "<Item>"), | |
5644 | WAVE_GTKIFE("/Markers/Locking/Lock to Greater Named Marker", "2", lock_marker_right, WV_MENU_MLKRT, "<Item>"), | |
5645 | WAVE_GTKIFE("/Markers/Locking/Unlock from Named Marker", "0", unlock_marker, WV_MENU_MLKOFF, "<Item>"), | |
5661 | WAVE_GTKIFE("/Markers/Locking/Lock to Lesser Named Marker", "Q", lock_marker_left, WV_MENU_MLKLT, "<Item>"), | |
5662 | WAVE_GTKIFE("/Markers/Locking/Lock to Greater Named Marker", "W", lock_marker_right, WV_MENU_MLKRT, "<Item>"), | |
5663 | WAVE_GTKIFE("/Markers/Locking/Unlock from Named Marker", "O", unlock_marker, WV_MENU_MLKOFF, "<Item>"), | |
5646 | 5664 | |
5647 | 5665 | WAVE_GTKIFE("/View/Show Grid", "<Alt>G", menu_show_grid, WV_MENU_VSG, "<ToggleItem>"), |
5648 | 5666 | WAVE_GTKIFE("/View/<separator>", NULL, NULL, WV_MENU_SEP9, "<Separator>"), |
6053 | 6071 | WAVE_GTKIFE("/Data Format/Octal", NULL, menu_dataformat_oct, WV_MENU_EDFO, "<Item>"), |
6054 | 6072 | WAVE_GTKIFE("/Data Format/ASCII", NULL, menu_dataformat_ascii, WV_MENU_EDFA, "<Item>"), |
6055 | 6073 | WAVE_GTKIFE("/Data Format/BitsToReal", NULL, menu_dataformat_real, WV_MENU_EDRL, "<Item>"), |
6074 | WAVE_GTKIFE("/Data Format/RealToBits/On", NULL, menu_dataformat_real2bon, WV_MENU_EDR2BON, "<Item>"), | |
6075 | WAVE_GTKIFE("/Data Format/RealToBits/Off", NULL, menu_dataformat_real2boff, WV_MENU_EDR2BOFF, "<Item>"), | |
6056 | 6076 | WAVE_GTKIFE("/Data Format/Right Justify/On", NULL, menu_dataformat_rjustify_on, WV_MENU_EDFRJON, "<Item>"), |
6057 | 6077 | WAVE_GTKIFE("/Data Format/Right Justify/Off", NULL, menu_dataformat_rjustify_off, WV_MENU_EDFRJOFF, "<Item>"), |
6058 | 6078 | WAVE_GTKIFE("/Data Format/Invert/On", NULL, menu_dataformat_invert_on, WV_MENU_EDFION, "<Item>"), |
6064 | 6084 | #if !defined __MINGW32__ && !defined _MSC_VER |
6065 | 6085 | WAVE_GTKIFE("/Data Format/Translate Filter Process/Disable", NULL, menu_dataformat_xlate_proc_0, WV_MENU_XLP_0, "<Item>"), |
6066 | 6086 | WAVE_GTKIFE("/Data Format/Translate Filter Process/Enable and Select", NULL, menu_dataformat_xlate_proc_1, WV_MENU_XLP_1, "<Item>"), |
6087 | WAVE_GTKIFE("/Data Format/Transaction Filter Process/Disable", NULL, menu_dataformat_xlate_ttrans_0, WV_MENU_TTXLP_0, "<Item>"), | |
6088 | WAVE_GTKIFE("/Data Format/Transaction Filter Process/Enable and Select", NULL, menu_dataformat_xlate_ttrans_1, WV_MENU_TTXLP_1, "<Item>"), | |
6067 | 6089 | #endif |
6068 | 6090 | WAVE_GTKIFE("/Data Format/Analog/Off", NULL, menu_dataformat_analog_off, WV_MENU_EDFAOFF, "<Item>"), |
6069 | 6091 | WAVE_GTKIFE("/Data Format/Analog/Step", NULL, menu_dataformat_analog_step, WV_MENU_EDFASTEP, "<Item>"), |
6165 | 6187 | } |
6166 | 6188 | |
6167 | 6189 | /* |
6168 | * $Id: menu.c,v 1.98 2010/03/18 17:12:37 gtkwave Exp $ | |
6190 | * $Id: menu.c,v 1.105 2010/04/14 07:45:12 gtkwave Exp $ | |
6169 | 6191 | * $Log: menu.c,v $ |
6192 | * Revision 1.105 2010/04/14 07:45:12 gtkwave | |
6193 | * P -> O to avoid accelerator conflict with psec | |
6194 | * | |
6195 | * Revision 1.104 2010/04/14 03:28:39 gtkwave | |
6196 | * change lock/unlock from 1/2/0 to Q/W/P | |
6197 | * | |
6198 | * Revision 1.103 2010/04/12 23:07:12 gtkwave | |
6199 | * add ability to make single signals transactions | |
6200 | * | |
6201 | * Revision 1.102 2010/04/07 01:50:45 gtkwave | |
6202 | * improved name handling for bvname, add $next transaction operation | |
6203 | * | |
6204 | * Revision 1.101 2010/04/04 19:09:57 gtkwave | |
6205 | * rename name->bvname in struct BitVector for easier grep tracking | |
6206 | * | |
6207 | * Revision 1.100 2010/03/31 15:42:47 gtkwave | |
6208 | * added preliminary transaction filter support | |
6209 | * | |
6210 | * Revision 1.99 2010/03/24 23:05:09 gtkwave | |
6211 | * added RealToBits menu option | |
6212 | * | |
6170 | 6213 | * Revision 1.98 2010/03/18 17:12:37 gtkwave |
6171 | 6214 | * pedantic warning cleanups |
6172 | 6215 | * |
95 | 95 | WV_MENU_EDFO, |
96 | 96 | WV_MENU_EDFA, |
97 | 97 | WV_MENU_EDRL, |
98 | WV_MENU_EDR2BON, | |
99 | WV_MENU_EDR2BOFF, | |
98 | 100 | WV_MENU_EDFRJON, |
99 | 101 | WV_MENU_EDFRJOFF, |
100 | 102 | WV_MENU_EDFION, |
106 | 108 | #if !defined __MINGW32__ && !defined _MSC_VER |
107 | 109 | WV_MENU_XLP_0, |
108 | 110 | WV_MENU_XLP_1, |
111 | WV_MENU_TTXLP_0, | |
112 | WV_MENU_TTXLP_1, | |
109 | 113 | #endif |
110 | 114 | WV_MENU_EDFAOFF, |
111 | 115 | WV_MENU_EDFASTEP, |
339 | 343 | |
340 | 344 | void SetTraceScrollbarRowValue(int row, unsigned center); |
341 | 345 | |
346 | bvptr combine_traces(int direction, Trptr single_trace_only); | |
347 | ||
342 | 348 | #endif |
343 | 349 | |
344 | 350 | /* |
345 | * $Id: menu.h,v 1.33 2010/02/24 18:06:14 gtkwave Exp $ | |
351 | * $Id: menu.h,v 1.36 2010/04/12 23:07:12 gtkwave Exp $ | |
346 | 352 | * $Log: menu.h,v $ |
353 | * Revision 1.36 2010/04/12 23:07:12 gtkwave | |
354 | * add ability to make single signals transactions | |
355 | * | |
356 | * Revision 1.35 2010/03/31 15:42:47 gtkwave | |
357 | * added preliminary transaction filter support | |
358 | * | |
359 | * Revision 1.34 2010/03/24 23:05:10 gtkwave | |
360 | * added RealToBits menu option | |
361 | * | |
347 | 362 | * Revision 1.33 2010/02/24 18:06:14 gtkwave |
348 | 363 | * removed reduce single bit vectors |
349 | 364 | * |
59 | 59 | if((flags & TR_REAL) != 0) { ch[pos++] = 'R'; } |
60 | 60 | |
61 | 61 | /* [7] */ |
62 | if((flags & TR_REAL2BITS) != 0) { ch[pos++] = 'r'; } | |
63 | ||
64 | /* [8] */ | |
62 | 65 | if((flags & TR_ZEROFILL) != 0) { ch[pos++] = '0'; } |
63 | 66 | else |
64 | 67 | if((flags & TR_ONEFILL) != 0) { ch[pos++] = '1'; } |
65 | 68 | |
66 | /* [8] */ | |
69 | /* [9] */ | |
67 | 70 | if((flags & TR_BINGRAY) != 0) { ch[pos++] = 'G'; } |
68 | /* [9] */ | |
71 | ||
72 | /* [10] (at worst case this needs 11 characters) */ | |
69 | 73 | if((flags & TR_GRAYBIN) != 0) { ch[pos++] = 'g'; } |
70 | 74 | |
71 | /* [10] (at worst case this needs 11 characters) */ | |
75 | /* [11] (at worst case this needs 12 characters) */ | |
72 | 76 | ch[pos] = 0; |
73 | 77 | |
74 | 78 | return(pos); |
94 | 98 | char *str; |
95 | 99 | vptr v; |
96 | 100 | |
97 | v=bsearch_vector(t->n.vec,tim); | |
101 | v=bsearch_vector(t->n.vec,tim - t->shift); | |
98 | 102 | str=convert_ascii(t,v); |
99 | 103 | if(str) |
100 | 104 | { |
112 | 116 | { |
113 | 117 | char *str; |
114 | 118 | hptr h_ptr; |
115 | if((h_ptr=bsearch_node(t->n.nd,tim))) | |
119 | if((h_ptr=bsearch_node(t->n.nd,tim - t->shift))) | |
116 | 120 | { |
117 | 121 | if(!t->n.nd->extvals) |
118 | 122 | { |
140 | 144 | { |
141 | 145 | if(!(h_ptr->flags&HIST_STRING)) |
142 | 146 | { |
143 | str=convert_ascii_real((double *)h_ptr->v.h_vector); | |
147 | str=convert_ascii_real(t, (double *)h_ptr->v.h_vector); | |
144 | 148 | } |
145 | 149 | else |
146 | 150 | { |
250 | 254 | char *flagged_name = NULL; |
251 | 255 | char *alternate_name = NULL; |
252 | 256 | int fh; |
253 | char flag_string[11]; | |
257 | char flag_string[65]; | |
254 | 258 | |
255 | 259 | if(GLOBALS->disable_mouseover) |
256 | 260 | { |
395 | 399 | } |
396 | 400 | |
397 | 401 | /* |
398 | * $Id: mouseover.c,v 1.13 2010/03/14 07:09:49 gtkwave Exp $ | |
402 | * $Id: mouseover.c,v 1.15 2010/04/01 03:10:58 gtkwave Exp $ | |
399 | 403 | * $Log: mouseover.c,v $ |
404 | * Revision 1.15 2010/04/01 03:10:58 gtkwave | |
405 | * time warp fixes | |
406 | * | |
407 | * Revision 1.14 2010/03/24 23:05:10 gtkwave | |
408 | * added RealToBits menu option | |
409 | * | |
400 | 410 | * Revision 1.13 2010/03/14 07:09:49 gtkwave |
401 | 411 | * removed ExtNode and merged with Node |
402 | 412 | * |
34 | 34 | { |
35 | 35 | if(t->vector==TRUE) |
36 | 36 | { |
37 | s = strdup_2(t->n.vec->name); | |
37 | s = strdup_2(t->n.vec->bvname); | |
38 | 38 | } |
39 | 39 | else |
40 | 40 | { |
87 | 87 | if((flags & TR_REAL) != 0) { ch[pos++] = 'R'; } |
88 | 88 | |
89 | 89 | /* [7] */ |
90 | if((flags & TR_REAL2BITS) != 0) { ch[pos++] = 'r'; } | |
91 | ||
92 | /* [8] */ | |
90 | 93 | if((flags & TR_ZEROFILL) != 0) { ch[pos++] = '0'; } |
91 | 94 | else |
92 | 95 | if((flags & TR_ONEFILL) != 0) { ch[pos++] = '1'; } |
93 | 96 | |
94 | /* [8] */ | |
97 | /* [9] */ | |
95 | 98 | if((flags & TR_BINGRAY) != 0) { ch[pos++] = 'G'; } |
96 | /* [9] */ | |
99 | /* [10] */ | |
97 | 100 | if((flags & TR_GRAYBIN) != 0) { ch[pos++] = 'g'; } |
98 | 101 | |
99 | /* [10] (at worst case this front part needs 11 characters) */ | |
102 | /* [11] (at worst case this front part needs 12 characters) */ | |
100 | 103 | ch[pos] = 0; |
101 | 104 | |
102 | 105 | if(!t->vector) |
139 | 142 | char *str; |
140 | 143 | vptr v; |
141 | 144 | |
142 | v=bsearch_vector(t->n.vec,tim); | |
145 | v=bsearch_vector(t->n.vec,tim - t->shift); | |
143 | 146 | str=convert_ascii(t,v); |
144 | 147 | if(str) |
145 | 148 | { |
157 | 160 | { |
158 | 161 | char *str; |
159 | 162 | hptr h_ptr; |
160 | if((h_ptr=bsearch_node(t->n.nd,tim))) | |
163 | if((h_ptr=bsearch_node(t->n.nd,tim - t->shift))) | |
161 | 164 | { |
162 | 165 | if(!t->n.nd->extvals) |
163 | 166 | { |
185 | 188 | { |
186 | 189 | if(!(h_ptr->flags&HIST_STRING)) |
187 | 190 | { |
188 | str=convert_ascii_real((double *)h_ptr->v.h_vector); | |
191 | str=convert_ascii_real(t, (double *)h_ptr->v.h_vector); | |
189 | 192 | } |
190 | 193 | else |
191 | 194 | { |
442 | 445 | } |
443 | 446 | |
444 | 447 | /* |
445 | * $Id: mouseover_sigs.c,v 1.7 2010/03/14 07:09:49 gtkwave Exp $ | |
448 | * $Id: mouseover_sigs.c,v 1.10 2010/04/04 19:09:57 gtkwave Exp $ | |
446 | 449 | * $Log: mouseover_sigs.c,v $ |
450 | * Revision 1.10 2010/04/04 19:09:57 gtkwave | |
451 | * rename name->bvname in struct BitVector for easier grep tracking | |
452 | * | |
453 | * Revision 1.9 2010/04/01 03:10:58 gtkwave | |
454 | * time warp fixes | |
455 | * | |
456 | * Revision 1.8 2010/03/24 23:05:10 gtkwave | |
457 | * added RealToBits menu option | |
458 | * | |
447 | 459 | * Revision 1.7 2010/03/14 07:09:49 gtkwave |
448 | 460 | * removed ExtNode and merged with Node |
449 | 461 | * |
566 | 566 | int vlen = 0; |
567 | 567 | int i, trwhich, trtarget, num_traces_displayable; |
568 | 568 | GtkAdjustment *sadj; |
569 | char sbuf[128]; | |
570 | int bufxlen; | |
571 | int bufclen; | |
569 | char buf[2048]; | |
570 | bvptr bv; | |
571 | Trptr tscan; | |
572 | ||
572 | 573 | |
573 | 574 | GLOBALS->ps_nummaxchars_print_c_1 = 7; /* allows a good spacing if 60 pixel default |
574 | 575 | * is used */ |
596 | 597 | |
597 | 598 | for (i = 0; (i < num_traces_displayable) && (t); i++) |
598 | 599 | { |
599 | ||
600 | sbuf[0] = 0; | |
601 | bufxlen = bufclen = 0; | |
602 | if ((GLOBALS->shift_timebase = t->shift)) | |
603 | { | |
604 | sbuf[0] = '('; | |
605 | reformat_time (sbuf + 1, t->shift, GLOBALS->time_dimension); | |
606 | strcpy (sbuf + (bufclen = strlen (sbuf + 1) + 1), ")"); | |
607 | bufclen++; | |
608 | bufxlen = font_engine_string_measure (GLOBALS->signalfont, sbuf); | |
609 | } | |
610 | ||
611 | if ((!t->vector) && (t->n.nd) && (t->n.nd->array_height)) | |
612 | { | |
613 | bufclen += | |
614 | sprintf (sbuf + strlen (sbuf), "{%d}", t->n.nd->this_row); | |
615 | bufxlen = font_engine_string_measure (GLOBALS->signalfont, sbuf); | |
616 | } | |
617 | ||
618 | if (t->flags & (TR_BLANK | TR_ANALOG_BLANK_STRETCH)) | |
619 | { | |
620 | if (t->name) | |
600 | char *subname = NULL; | |
601 | bv = NULL; | |
602 | tscan = NULL; | |
603 | ||
604 | if(t->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH)) /* seek to real xact trace if present... */ | |
605 | { | |
606 | int bcnt = 0; | |
607 | tscan = t; | |
608 | while((tscan) && (tscan = GivePrevTrace(tscan))) | |
609 | { | |
610 | if(!(tscan->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH))) | |
611 | { | |
612 | if(tscan->flags & TR_TTRANSLATED) | |
613 | { | |
614 | break; /* found it */ | |
615 | } | |
616 | else | |
617 | { | |
618 | tscan = NULL; | |
619 | } | |
620 | } | |
621 | else | |
622 | { | |
623 | bcnt++; /* bcnt is number of blank traces */ | |
624 | } | |
625 | } | |
626 | ||
627 | if((tscan)&&(tscan->vector)) | |
628 | { | |
629 | bv = tscan->n.vec; | |
630 | do | |
631 | { | |
632 | bv = bv->transaction_chain; /* correlate to blank trace */ | |
633 | } while(bv && (bcnt--)); | |
634 | if(bv) | |
635 | { | |
636 | subname = bv->bvname; | |
637 | if(GLOBALS->hier_max_level) | |
638 | subname = hier_extract(subname, GLOBALS->hier_max_level); | |
639 | } | |
640 | } | |
641 | } | |
642 | ||
643 | populateBuffer(t, subname, buf); | |
644 | ||
645 | if (!bv && (t->flags & (TR_BLANK | TR_ANALOG_BLANK_STRETCH))) /* for "comment" style blank traces */ | |
646 | { | |
647 | if (buf[0]) | |
621 | 648 | { |
622 | 649 | len = |
623 | font_engine_string_measure (GLOBALS->signalfont, t->name) + bufxlen; | |
624 | numchars = strlen (t->name) + bufclen; | |
650 | font_engine_string_measure (GLOBALS->signalfont, buf); | |
651 | numchars = strlen (buf); | |
625 | 652 | |
626 | 653 | if (len > maxlen) |
627 | 654 | maxlen = len; |
628 | 655 | if (numchars > GLOBALS->ps_nummaxchars_print_c_1) |
629 | 656 | GLOBALS->ps_nummaxchars_print_c_1 = numchars; |
630 | } | |
631 | } | |
632 | else if (t->name) | |
633 | { | |
634 | len = font_engine_string_measure (GLOBALS->signalfont, t->name) + bufxlen; | |
635 | numchars = strlen (t->name) + bufclen; | |
657 | ||
658 | if(t->asciivalue) | |
659 | { | |
660 | free_2(t->asciivalue); t->asciivalue = NULL; | |
661 | } | |
662 | } | |
663 | } | |
664 | else if (buf[0] || subname) | |
665 | { | |
666 | len = font_engine_string_measure (GLOBALS->signalfont, buf); | |
667 | numchars = strlen (buf); | |
636 | 668 | if ((GLOBALS->tims.marker != -1) && (!(t->flags & TR_EXCLUDE))) |
637 | 669 | { |
638 | 670 | t->asciitime = GLOBALS->tims.marker; |
639 | 671 | if (t->asciivalue) |
640 | 672 | free_2 (t->asciivalue); |
641 | 673 | |
642 | if (t->vector) | |
674 | if (bv || t->vector) | |
643 | 675 | { |
644 | 676 | char *str, *str2; |
645 | 677 | vptr v; |
646 | ||
647 | v = bsearch_vector (t->n.vec, GLOBALS->tims.marker); | |
648 | str = convert_ascii (t, v); | |
678 | Trptr ts; | |
679 | TraceEnt t_temp; | |
680 | ||
681 | if(bv) | |
682 | { | |
683 | ts = &t_temp; | |
684 | memcpy(ts, tscan, sizeof(TraceEnt)); | |
685 | ts->vector = 1; | |
686 | ts->n.vec = bv; | |
687 | } | |
688 | else | |
689 | { | |
690 | ts = t; | |
691 | bv = t->n.vec; | |
692 | } | |
693 | ||
694 | v = bsearch_vector (bv, GLOBALS->tims.marker - ts->shift); | |
695 | str = convert_ascii (ts, v); | |
649 | 696 | if (str) |
650 | 697 | { |
651 | 698 | int slen; |
682 | 729 | char *str; |
683 | 730 | hptr h_ptr; |
684 | 731 | |
685 | if ((h_ptr = bsearch_node (t->n.nd, GLOBALS->tims.marker))) | |
732 | if ((h_ptr = bsearch_node (t->n.nd, GLOBALS->tims.marker - t->shift))) | |
686 | 733 | { |
687 | 734 | if (!t->n.nd->extvals) |
688 | 735 | { |
716 | 763 | if (!(h_ptr->flags & HIST_STRING)) |
717 | 764 | { |
718 | 765 | str = |
719 | convert_ascii_real ((double *) h_ptr->v. | |
766 | convert_ascii_real (t, (double *) h_ptr->v. | |
720 | 767 | h_vector); |
721 | 768 | } |
722 | 769 | else |
1839 | 1886 | h = h->next; |
1840 | 1887 | lasttype = type; |
1841 | 1888 | } |
1842 | ||
1843 | GLOBALS->tims.start += GLOBALS->shift_timebase; | |
1844 | GLOBALS->tims.end += GLOBALS->shift_timebase; | |
1845 | 1889 | } |
1846 | 1890 | |
1847 | 1891 | static void |
1921 | 1965 | } |
1922 | 1966 | |
1923 | 1967 | pr_draw_hptr_trace_vector_analog (prc, t, h, which, ext); |
1968 | GLOBALS->tims.start -= GLOBALS->shift_timebase; | |
1969 | GLOBALS->tims.end -= GLOBALS->shift_timebase; | |
1924 | 1970 | return; |
1925 | 1971 | } |
1926 | 1972 | |
2034 | 2080 | |
2035 | 2081 | if (width > GLOBALS->vector_padding) |
2036 | 2082 | { |
2083 | char *t_ascii; /* to skip past color ? ? string */ | |
2084 | ||
2037 | 2085 | if (h->flags & HIST_REAL) |
2038 | 2086 | { |
2039 | 2087 | if (!(h->flags & HIST_STRING)) |
2040 | 2088 | { |
2041 | 2089 | ascii = |
2042 | convert_ascii_real ((double *) h->v.h_vector); | |
2090 | convert_ascii_real (t, (double *) h->v.h_vector); | |
2043 | 2091 | } |
2044 | 2092 | else |
2045 | 2093 | { |
2052 | 2100 | ascii = convert_ascii_vec (t, h->v.h_vector); |
2053 | 2101 | } |
2054 | 2102 | |
2103 | if((*ascii=='?')&&((t_ascii=strchr(ascii+1, '?')))) { t_ascii++; } else { t_ascii = ascii; } | |
2055 | 2104 | |
2056 | 2105 | if (((pixlen = |
2057 | 2106 | font_engine_string_measure (GLOBALS->wavefont, |
2058 | ascii)) + | |
2107 | t_ascii)) + | |
2059 | 2108 | GLOBALS->vector_padding <= width) |
2060 | 2109 | || ((_x1 >= GLOBALS->wavewidth) |
2061 | 2110 | && (prc->gpd == &ps_print_device))) |
2062 | 2111 | { |
2063 | pr_draw_string (prc, _x0 + 2, ytext, ascii, pixlen, | |
2112 | pr_draw_string (prc, _x0 + 2, ytext, t_ascii, pixlen, | |
2064 | 2113 | ysiz); |
2065 | 2114 | } |
2066 | 2115 | else |
2068 | 2117 | char *mod; |
2069 | 2118 | |
2070 | 2119 | mod = |
2071 | bsearch_trunc (ascii, | |
2120 | bsearch_trunc (t_ascii, | |
2072 | 2121 | width - GLOBALS->vector_padding); |
2073 | 2122 | if (mod) |
2074 | 2123 | { |
2075 | 2124 | *mod = '+'; |
2076 | 2125 | *(mod + 1) = 0; |
2077 | pr_draw_string (prc, _x0 + 2, ytext, ascii, | |
2126 | pr_draw_string (prc, _x0 + 2, ytext, t_ascii, | |
2078 | 2127 | GLOBALS->maxlen_trunc, ysiz); |
2079 | 2128 | } |
2080 | 2129 | } |
2473 | 2522 | GLOBALS->tims.start -= GLOBALS->shift_timebase; |
2474 | 2523 | GLOBALS->tims.end -= GLOBALS->shift_timebase; |
2475 | 2524 | |
2476 | h = v; | |
2477 | 2525 | liney = ((which + 2) * GLOBALS->fontheight) - 2; |
2478 | 2526 | _y1 = ((which + 1) * GLOBALS->fontheight) + 2; |
2479 | 2527 | _y0 = liney - 2; |
2506 | 2554 | } |
2507 | 2555 | } |
2508 | 2556 | |
2557 | h = v; | |
2558 | ||
2509 | 2559 | if (t->flags & TR_ANALOGMASK) |
2510 | 2560 | { |
2511 | 2561 | Trptr te = GiveNextTrace(t); |
2525 | 2575 | } |
2526 | 2576 | |
2527 | 2577 | pr_draw_vptr_trace_analog (prc, t, v, which, ext); |
2578 | ||
2579 | GLOBALS->tims.start+=GLOBALS->shift_timebase; | |
2580 | GLOBALS->tims.end+=GLOBALS->shift_timebase; | |
2528 | 2581 | return; |
2529 | 2582 | } |
2530 | 2583 | |
2633 | 2686 | |
2634 | 2687 | if (width > GLOBALS->vector_padding) |
2635 | 2688 | { |
2689 | char *t_ascii; | |
2636 | 2690 | ascii = convert_ascii (t, h); |
2691 | ||
2692 | if((*ascii=='?')&&((t_ascii=strchr(ascii+1, '?')))) { t_ascii++; } else { t_ascii = ascii; } | |
2637 | 2693 | |
2638 | 2694 | if (((pixlen = |
2639 | 2695 | font_engine_string_measure (GLOBALS->wavefont, |
2640 | ascii)) + | |
2696 | t_ascii)) + | |
2641 | 2697 | GLOBALS->vector_padding <= width) |
2642 | 2698 | || ((_x1 >= GLOBALS->wavewidth) |
2643 | 2699 | && (prc->gpd == &ps_print_device))) |
2644 | 2700 | { |
2645 | pr_draw_string (prc, _x0 + 2, ytext, ascii, pixlen, | |
2701 | pr_draw_string (prc, _x0 + 2, ytext, t_ascii, pixlen, | |
2646 | 2702 | ysiz); |
2647 | 2703 | } |
2648 | 2704 | else |
2650 | 2706 | char *mod; |
2651 | 2707 | |
2652 | 2708 | mod = |
2653 | bsearch_trunc (ascii, | |
2709 | bsearch_trunc (t_ascii, | |
2654 | 2710 | width - GLOBALS->vector_padding); |
2655 | 2711 | if (mod) |
2656 | 2712 | { |
2657 | 2713 | *mod = '+'; |
2658 | 2714 | *(mod + 1) = 0; |
2659 | 2715 | |
2660 | pr_draw_string (prc, _x0 + 2, ytext, ascii, | |
2716 | pr_draw_string (prc, _x0 + 2, ytext, t_ascii, | |
2661 | 2717 | GLOBALS->maxlen_trunc, ysiz); |
2662 | 2718 | } |
2663 | 2719 | } |
2698 | 2754 | } |
2699 | 2755 | if (GLOBALS->topmost_trace) |
2700 | 2756 | { |
2701 | Trptr t; | |
2757 | Trptr t = GLOBALS->topmost_trace; | |
2758 | Trptr tback = t; | |
2702 | 2759 | hptr h; |
2703 | 2760 | vptr v; |
2704 | int i, num_traces_displayable; | |
2761 | int i = 0, num_traces_displayable; | |
2762 | int iback = 0; | |
2705 | 2763 | |
2706 | 2764 | num_traces_displayable = |
2707 | 2765 | GLOBALS->wavearea->allocation.height / (GLOBALS->fontheight); |
2708 | 2766 | num_traces_displayable--; /* for the time trace that is |
2709 | 2767 | * always there */ |
2710 | 2768 | |
2711 | t = GLOBALS->topmost_trace; | |
2712 | for (i = 0; ((i < num_traces_displayable) && (t)); i++) | |
2769 | /* ensure that transaction traces are visible even if the topmost traces are blanks */ | |
2770 | while(tback) | |
2771 | { | |
2772 | if(tback->flags&(TR_BLANK|TR_ANALOG_BLANK_STRETCH)) | |
2773 | { | |
2774 | tback = GivePrevTrace(tback); | |
2775 | iback--; | |
2776 | } | |
2777 | else if(tback->flags & TR_TTRANSLATED) | |
2778 | { | |
2779 | if(tback != t) | |
2780 | { | |
2781 | t = tback; | |
2782 | i = iback; | |
2783 | } | |
2784 | break; | |
2785 | } | |
2786 | else | |
2787 | { | |
2788 | break; | |
2789 | } | |
2790 | } | |
2791 | ||
2792 | for (; ((i < num_traces_displayable) && (t)); i++) | |
2713 | 2793 | { |
2714 | 2794 | if (!(t->flags & (TR_EXCLUDE | TR_BLANK | TR_ANALOG_BLANK_STRETCH))) |
2715 | 2795 | { |
2716 | 2796 | GLOBALS->shift_timebase = t->shift; |
2717 | 2797 | if (!t->vector) |
2718 | 2798 | { |
2719 | h = bsearch_node (t->n.nd, GLOBALS->tims.start); | |
2799 | h = bsearch_node (t->n.nd, GLOBALS->tims.start - t->shift); | |
2720 | 2800 | DEBUG (printf |
2721 | 2801 | ("Bit Trace: %s, %s\n", t->name, t->n.nd->nname)); |
2722 | 2802 | DEBUG (printf |
2725 | 2805 | |
2726 | 2806 | if (!t->n.nd->extvals) |
2727 | 2807 | { |
2728 | pr_draw_hptr_trace (prc, t, h, i, 1, 0); | |
2808 | if(i>=0) pr_draw_hptr_trace (prc, t, h, i, 1, 0); | |
2729 | 2809 | } |
2730 | 2810 | else |
2731 | 2811 | { |
2732 | pr_draw_hptr_trace_vector (prc, t, h, i); | |
2812 | if(i>=0) pr_draw_hptr_trace_vector (prc, t, h, i); | |
2733 | 2813 | } |
2734 | 2814 | } |
2735 | 2815 | else |
2736 | 2816 | { |
2737 | v = bsearch_vector (t->n.vec, GLOBALS->tims.start); | |
2738 | DEBUG (printf | |
2817 | Trptr t_orig, tn; | |
2818 | bvptr bv = t->n.vec; | |
2819 | ||
2820 | v = bsearch_vector (bv, GLOBALS->tims.start - t->shift); | |
2821 | DEBUG (printf | |
2739 | 2822 | ("Vector Trace: %s, %s\n", t->name, t->n.vec->name)); |
2740 | DEBUG (printf | |
2823 | DEBUG (printf | |
2741 | 2824 | ("Start time: " TTFormat ", Vectorent time: " |
2742 | 2825 | TTFormat "\n", tims.start, |
2743 | 2826 | (v->time + shift_timebase))); |
2744 | pr_draw_vptr_trace (prc, t, v, i); | |
2827 | if(i>=0) pr_draw_vptr_trace (prc, t, v, i); | |
2828 | ||
2829 | if((bv->transaction_chain) && (t->flags & TR_TTRANSLATED)) | |
2830 | { | |
2831 | t_orig = t; | |
2832 | for(;;) | |
2833 | { | |
2834 | tn = GiveNextTrace(t); | |
2835 | bv = bv->transaction_chain; | |
2836 | ||
2837 | if(bv && tn && (tn->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH))) | |
2838 | { | |
2839 | i++; | |
2840 | if(i<num_traces_displayable) | |
2841 | { | |
2842 | v=bsearch_vector(bv, GLOBALS->tims.start - t->shift); | |
2843 | if(i>=0) pr_draw_vptr_trace(prc, t_orig,v,i); | |
2844 | t = tn; | |
2845 | continue; | |
2846 | } | |
2847 | } | |
2848 | break; | |
2849 | } | |
2850 | } | |
2745 | 2851 | } |
2746 | 2852 | } |
2747 | 2853 | else |
2761 | 2867 | } |
2762 | 2868 | } |
2763 | 2869 | |
2764 | pr_draw_hptr_trace (prc, NULL, NULL, i, 0, kill_dodraw_grid); | |
2870 | if(i>=0) pr_draw_hptr_trace (prc, NULL, NULL, i, 0, kill_dodraw_grid); | |
2765 | 2871 | } |
2766 | 2872 | t = GiveNextTrace (t); |
2767 | 2873 | } |
2777 | 2883 | { |
2778 | 2884 | int texty, liney; |
2779 | 2885 | int retval; |
2780 | char sbuf[128]; | |
2781 | int bufclen; | |
2886 | char buf[2048]; | |
2887 | char *subname = NULL; | |
2888 | ||
2889 | buf[0] = 0; | |
2890 | ||
2891 | if(t->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH)) /* seek to real xact trace if present... */ | |
2892 | { | |
2893 | Trptr tscan = t; | |
2894 | int bcnt = 0; | |
2895 | while((tscan) && (tscan = GivePrevTrace(tscan))) | |
2896 | { | |
2897 | if(!(tscan->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH))) | |
2898 | { | |
2899 | if(tscan->flags & TR_TTRANSLATED) | |
2900 | { | |
2901 | break; /* found it */ | |
2902 | } | |
2903 | else | |
2904 | { | |
2905 | tscan = NULL; | |
2906 | } | |
2907 | } | |
2908 | else | |
2909 | { | |
2910 | bcnt++; /* bcnt is number of blank traces */ | |
2911 | } | |
2912 | } | |
2913 | ||
2914 | if((tscan)&&(tscan->vector)) | |
2915 | { | |
2916 | bvptr bv = tscan->n.vec; | |
2917 | do | |
2918 | { | |
2919 | bv = bv->transaction_chain; /* correlate to blank trace */ | |
2920 | } while(bv && (bcnt--)); | |
2921 | if(bv) | |
2922 | { | |
2923 | subname = bv->bvname; | |
2924 | if(GLOBALS->hier_max_level) | |
2925 | subname = hier_extract(subname, GLOBALS->hier_max_level); | |
2926 | } | |
2927 | } | |
2928 | } | |
2929 | ||
2930 | populateBuffer(t, subname, buf); | |
2782 | 2931 | |
2783 | 2932 | UpdateSigValue (t); /* in case it's stale on nonprop */ |
2784 | ||
2785 | bufclen = 0; | |
2786 | sbuf[0] = 0; | |
2787 | ||
2788 | if ((t->name) && (t->shift)) | |
2789 | { | |
2790 | sbuf[0] = '('; | |
2791 | reformat_time (sbuf + 1, t->shift, GLOBALS->time_dimension); | |
2792 | strcpy (sbuf + (bufclen = strlen (sbuf + 1) + 1), ")"); | |
2793 | bufclen++; | |
2794 | } | |
2795 | ||
2796 | if ((!t->vector) && (t->n.nd) && (t->n.nd->array_height)) | |
2797 | { | |
2798 | bufclen += sprintf (sbuf + strlen (sbuf), "{%d}", t->n.nd->this_row); | |
2799 | } | |
2800 | ||
2801 | 2933 | |
2802 | 2934 | liney = ((i + 2) * GLOBALS->fontheight) - 2; |
2803 | 2935 | |
2822 | 2954 | { |
2823 | 2955 | int maxwidth = 0; |
2824 | 2956 | |
2825 | if (t->name) | |
2826 | maxwidth = strlen (t->name) + bufclen; | |
2957 | if (buf) | |
2958 | maxwidth = strlen (buf); | |
2827 | 2959 | if ((t->asciivalue) && (!(t->flags & TR_EXCLUDE))) |
2828 | 2960 | maxwidth += strlen (t->asciivalue); |
2829 | 2961 | if (maxwidth) |
2830 | 2962 | { |
2831 | 2963 | gdouble realwidth; |
2832 | char *buf; | |
2833 | buf = wave_alloca (maxwidth + 1); | |
2834 | buf[0] = 0; | |
2835 | if (t->name) | |
2964 | char *cbuf; | |
2965 | cbuf = wave_alloca (maxwidth + 1); | |
2966 | cbuf[0] = 0; | |
2967 | if (buf[0]) | |
2836 | 2968 | { |
2837 | strcpy (buf, t->name); | |
2838 | if (bufclen) | |
2839 | strcat (buf, sbuf); | |
2969 | strcpy (cbuf, buf); | |
2840 | 2970 | } |
2841 | 2971 | if ((t->asciivalue) && (!(t->flags & TR_EXCLUDE))) |
2842 | strcat (buf, t->asciivalue); | |
2972 | strcat (cbuf, t->asciivalue); | |
2843 | 2973 | |
2844 | 2974 | realwidth = maxwidth * GLOBALS->ps_chwidth_print_c_1; |
2845 | 2975 | |
2846 | 2976 | if (maxwidth == 0) |
2847 | 2977 | return (retval); |
2848 | 2978 | pr_setgray (prc, 0.0); |
2849 | pr_draw_string (prc, 3, texty - 1, buf, realwidth, | |
2979 | pr_draw_string (prc, 3, texty - 1, cbuf, realwidth, | |
2850 | 2980 | GLOBALS->signalfont->ascent - |
2851 | 2981 | GLOBALS->signalfont->descent); |
2852 | 2982 | } |
2978 | 3108 | } |
2979 | 3109 | |
2980 | 3110 | /* |
2981 | * $Id: print.c,v 1.29 2010/03/14 07:09:49 gtkwave Exp $ | |
3111 | * $Id: print.c,v 1.36 2010/04/14 18:45:37 gtkwave Exp $ | |
2982 | 3112 | * $Log: print.c,v $ |
3113 | * Revision 1.36 2010/04/14 18:45:37 gtkwave | |
3114 | * allow data values for secondary transaction traces | |
3115 | * | |
3116 | * Revision 1.35 2010/04/14 04:21:46 gtkwave | |
3117 | * update populateBuffer() usage | |
3118 | * | |
3119 | * Revision 1.34 2010/04/10 03:32:00 gtkwave | |
3120 | * allow transaction traces to scroll off top of screen yet still be visible | |
3121 | * | |
3122 | * Revision 1.33 2010/04/09 20:52:33 gtkwave | |
3123 | * add extension traces for extension transactions | |
3124 | * | |
3125 | * Revision 1.32 2010/04/01 03:10:58 gtkwave | |
3126 | * time warp fixes | |
3127 | * | |
3128 | * Revision 1.31 2010/03/31 15:42:47 gtkwave | |
3129 | * added preliminary transaction filter support | |
3130 | * | |
3131 | * Revision 1.30 2010/03/24 23:05:10 gtkwave | |
3132 | * added RealToBits menu option | |
3133 | * | |
2983 | 3134 | * Revision 1.29 2010/03/14 07:09:49 gtkwave |
2984 | 3135 | * removed ExtNode and merged with Node |
2985 | 3136 | * |
23 | 23 | { |
24 | 24 | int i; |
25 | 25 | |
26 | if(!GLOBALS->procsel_filter) { GLOBALS->procsel_filter = calloc_2(FILE_FILTER_MAX+1, sizeof(char *)); } | |
27 | if(!GLOBALS->proc_filter) { GLOBALS->proc_filter = calloc_2(FILE_FILTER_MAX+1, sizeof(struct pipe_ctx *)); } | |
26 | if(!GLOBALS->procsel_filter) { GLOBALS->procsel_filter = calloc_2(PROC_FILTER_MAX+1, sizeof(char *)); } | |
27 | if(!GLOBALS->proc_filter) { GLOBALS->proc_filter = calloc_2(PROC_FILTER_MAX+1, sizeof(struct pipe_ctx *)); } | |
28 | 28 | |
29 | 29 | for(i=0;i<PROC_FILTER_MAX+1;i++) |
30 | 30 | { |
35 | 35 | |
36 | 36 | void remove_all_proc_filters(void) |
37 | 37 | { |
38 | int i; | |
39 | ||
40 | for(i=1;i<PROC_FILTER_MAX+1;i++) | |
41 | { | |
42 | if(GLOBALS->proc_filter[i]) | |
38 | struct Global *GLOBALS_cache = GLOBALS; | |
39 | int i, j; | |
40 | ||
41 | for(j=0;j<GLOBALS->num_notebook_pages;j++) | |
42 | { | |
43 | GLOBALS = (*GLOBALS->contexts)[j]; | |
44 | ||
45 | for(i=1;i<PROC_FILTER_MAX+1;i++) | |
43 | 46 | { |
44 | pipeio_destroy(GLOBALS->proc_filter[i]); | |
45 | GLOBALS->proc_filter[i] = NULL; | |
47 | if(GLOBALS->proc_filter[i]) | |
48 | { | |
49 | pipeio_destroy(GLOBALS->proc_filter[i]); | |
50 | GLOBALS->proc_filter[i] = NULL; | |
51 | } | |
52 | ||
53 | if(GLOBALS->procsel_filter[i]) | |
54 | { | |
55 | free_2(GLOBALS->procsel_filter[i]); | |
56 | GLOBALS->procsel_filter[i] = NULL; | |
57 | } | |
46 | 58 | } |
47 | 59 | |
48 | if(GLOBALS->procsel_filter[i]) | |
49 | { | |
50 | free_2(GLOBALS->procsel_filter[i]); | |
51 | GLOBALS->procsel_filter[i] = NULL; | |
52 | } | |
60 | GLOBALS = GLOBALS_cache; | |
53 | 61 | } |
54 | 62 | } |
55 | 63 | |
70 | 78 | } |
71 | 79 | |
72 | 80 | |
73 | void remove_proc_filter(int which, int regen) | |
81 | /* | |
82 | * this is likely obsolete | |
83 | */ | |
84 | static void remove_proc_filter(int which, int regen) | |
74 | 85 | { |
75 | 86 | if(GLOBALS->proc_filter[which]) |
76 | 87 | { |
85 | 96 | } |
86 | 97 | |
87 | 98 | |
88 | void load_proc_filter(int which, char *name) | |
99 | static void load_proc_filter(int which, char *name) | |
89 | 100 | { |
90 | 101 | |
91 | 102 | FILE *stream; |
137 | 148 | pclose(stream); |
138 | 149 | free_2(cmd); |
139 | 150 | |
140 | remove_proc_filter(which, 0); /* should never happen from GUI, but possible from save files or other weirdness */ | |
141 | ||
142 | GLOBALS->proc_filter[which] = pipeio_create(abs_path, arg); | |
151 | /* remove_proc_filter(which, 0); ... should never happen from GUI, but perhaps possible from save files or other weirdness */ | |
152 | if(!GLOBALS->ttrans_filter[which]) | |
153 | { | |
154 | GLOBALS->proc_filter[which] = pipeio_create(abs_path, arg); | |
155 | } | |
143 | 156 | } |
144 | 157 | |
145 | 158 | void install_proc_filter(int which) |
224 | 237 | if(!strcmp(GLOBALS->procsel_filter[i], *GLOBALS->fileselbox_text)) |
225 | 238 | { |
226 | 239 | status_text("Filter already imported.\n"); |
240 | if(GLOBALS->is_active_ptranslate_c_2) gdk_window_raise(GLOBALS->window_ptranslate_c_5->window); | |
227 | 241 | return; |
228 | 242 | } |
229 | 243 | } |
249 | 263 | { |
250 | 264 | GLOBALS->num_proc_filters--; |
251 | 265 | } |
266 | ||
267 | if(GLOBALS->is_active_ptranslate_c_2) gdk_window_raise(GLOBALS->window_ptranslate_c_5->window); | |
252 | 268 | } |
253 | 269 | |
254 | 270 | static void add_filter_callback(GtkWidget *widget, GtkWidget *nothing) |
430 | 446 | #endif |
431 | 447 | |
432 | 448 | /* |
433 | * $Id: ptranslate.c,v 1.7 2009/12/24 20:55:27 gtkwave Exp $ | |
449 | * $Id: ptranslate.c,v 1.11 2010/04/15 18:39:34 gtkwave Exp $ | |
434 | 450 | * $Log: ptranslate.c,v $ |
451 | * Revision 1.11 2010/04/15 18:39:34 gtkwave | |
452 | * remove invocations of pipeio_destroy where unnecessary | |
453 | * | |
454 | * Revision 1.10 2010/04/15 01:55:03 gtkwave | |
455 | * raise to front on filename select | |
456 | * | |
457 | * Revision 1.9 2010/03/31 15:42:47 gtkwave | |
458 | * added preliminary transaction filter support | |
459 | * | |
460 | * Revision 1.8 2010/03/30 18:33:27 gtkwave | |
461 | * fixed cut and paste errors from file to proc | |
462 | * | |
435 | 463 | * Revision 1.7 2009/12/24 20:55:27 gtkwave |
436 | 464 | * warnings cleanups |
437 | 465 | * |
17 | 17 | #include "fgetdynamic.h" |
18 | 18 | #include "debug.h" |
19 | 19 | |
20 | #define PROC_FILTER_MAX 20 | |
20 | #define PROC_FILTER_MAX (128) | |
21 | 21 | |
22 | 22 | |
23 | 23 | void ptrans_searchbox(char *title); |
29 | 29 | #endif |
30 | 30 | |
31 | 31 | /* |
32 | * $Id: ptranslate.h,v 1.2 2007/08/26 21:35:43 gtkwave Exp $ | |
32 | * $Id: ptranslate.h,v 1.3 2010/03/30 18:33:27 gtkwave Exp $ | |
33 | 33 | * $Log: ptranslate.h,v $ |
34 | * Revision 1.3 2010/03/30 18:33:27 gtkwave | |
35 | * fixed cut and paste errors from file to proc | |
36 | * | |
34 | 37 | * Revision 1.2 2007/08/26 21:35:43 gtkwave |
35 | 38 | * integrated global context management from SystemOfCode2007 branch |
36 | 39 | * |
34 | 34 | * case insensitive string bsearch |
35 | 35 | */ |
36 | 36 | |
37 | static const struct wave_rgb_color colors[] = { | |
37 | static struct wave_rgb_color colors[] = { | |
38 | 38 | WAVE_RGB_COLOR("alice blue", 240, 248, 255), |
39 | 39 | WAVE_RGB_COLOR("AliceBlue", 240, 248, 255), |
40 | 40 | WAVE_RGB_COLOR("antique white", 250, 235, 215), |
795 | 795 | { |
796 | 796 | const char *key = (const char *)v1; |
797 | 797 | const struct wave_rgb_color *color = (const struct wave_rgb_color *)v2; |
798 | ||
798 | 799 | return((int)strcasecmp(key, color->name)); |
799 | 800 | } |
800 | 801 | |
804 | 805 | |
805 | 806 | if((match=(struct wave_rgb_color *)bsearch((void *)str, (void *)colors, C_ARRAY_SIZE, sizeof(struct wave_rgb_color), compar))) |
806 | 807 | { |
807 | ||
808 | 808 | if(!match->context) match->context = alloc_color(GLOBALS->wavearea, match->rgb, GLOBALS->wavearea->style->white_gc); |
809 | ||
810 | 809 | return(match->context); |
811 | 810 | } |
812 | 811 | |
852 | 851 | } |
853 | 852 | |
854 | 853 | /* |
855 | * $Id: rgb.c,v 1.5 2010/03/18 17:12:37 gtkwave Exp $ | |
854 | * $Id: rgb.c,v 1.6 2010/03/31 06:37:44 gtkwave Exp $ | |
856 | 855 | * $Log: rgb.c,v $ |
856 | * Revision 1.6 2010/03/31 06:37:44 gtkwave | |
857 | * fix for colors struct marked as const | |
858 | * | |
857 | 859 | * Revision 1.5 2010/03/18 17:12:37 gtkwave |
858 | 860 | * pedantic warning cleanups |
859 | 861 | * |
609 | 609 | static gboolean run_once = FALSE; |
610 | 610 | gdouble x,y; |
611 | 611 | GdkModifierType state; |
612 | TraceEnt t_trans; | |
612 | 613 | |
613 | 614 | #ifdef WAVE_USE_GTK2 |
614 | 615 | gint xi, yi; |
678 | 679 | } |
679 | 680 | |
680 | 681 | if(!t) goto bot; |
681 | if((t->flags&(TR_BLANK|TR_EXCLUDE))) | |
682 | if((t->flags&(/*TR_BLANK|*/TR_EXCLUDE))) /* TR_BLANK removed because of transaction handling below... */ | |
682 | 683 | { |
683 | 684 | t = NULL; |
684 | 685 | goto bot; |
685 | 686 | } |
687 | ||
688 | if(t->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH)) /* seek to real xact trace if present... */ | |
689 | { | |
690 | Trptr tscan = t; | |
691 | int bcnt = 0; | |
692 | while((tscan) && (tscan = GivePrevTrace(tscan))) | |
693 | { | |
694 | if(!(tscan->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH))) | |
695 | { | |
696 | if(tscan->flags & TR_TTRANSLATED) | |
697 | { | |
698 | break; /* found it */ | |
699 | } | |
700 | else | |
701 | { | |
702 | tscan = NULL; | |
703 | } | |
704 | } | |
705 | else | |
706 | { | |
707 | bcnt++; /* bcnt is number of blank traces */ | |
708 | } | |
709 | } | |
710 | ||
711 | if((tscan)&&(tscan->vector)) | |
712 | { | |
713 | bvptr bv = tscan->n.vec; | |
714 | do | |
715 | { | |
716 | bv = bv->transaction_chain; /* correlate to blank trace */ | |
717 | } while(bv && (bcnt--)); | |
718 | if(bv) | |
719 | { | |
720 | memcpy(&t_trans, tscan, sizeof(TraceEnt)); /* substitute into a synthetic trace */ | |
721 | t_trans.n.vec = bv; | |
722 | t_trans.vector = 1; | |
723 | ||
724 | t_trans.name = bv->bvname; | |
725 | if(GLOBALS->hier_max_level) | |
726 | t_trans.name = hier_extract(t_trans.name, GLOBALS->hier_max_level); | |
727 | ||
728 | t = &t_trans; | |
729 | goto bot; /* is goto process_trace; in wavewindow.c */ | |
730 | } | |
731 | } | |
732 | } | |
733 | ||
734 | if((t->flags&TR_BLANK)) | |
735 | { | |
736 | t = NULL; | |
737 | goto bot; | |
738 | } | |
686 | 739 | |
687 | 740 | if(t->flags & TR_ANALOG_BLANK_STRETCH) /* seek to real analog trace is present... */ |
688 | 741 | { |
1335 | 1388 | |
1336 | 1389 | |
1337 | 1390 | /* |
1338 | * $Id: signalwindow.c,v 1.49 2010/02/28 19:05:15 gtkwave Exp $ | |
1391 | * $Id: signalwindow.c,v 1.50 2010/04/14 07:49:02 gtkwave Exp $ | |
1339 | 1392 | * $Log: signalwindow.c,v $ |
1393 | * Revision 1.50 2010/04/14 07:49:02 gtkwave | |
1394 | * updated mouseover handling | |
1395 | * | |
1340 | 1396 | * Revision 1.49 2010/02/28 19:05:15 gtkwave |
1341 | 1397 | * missing null pointer guard added |
1342 | 1398 | * |
677 | 677 | UTimeType utt; |
678 | 678 | TimeType tt; |
679 | 679 | |
680 | h=bsearch_node(t->n.nd, basetime); | |
680 | h=bsearch_node(t->n.nd, basetime - t->shift); | |
681 | 681 | hp=GLOBALS->max_compare_index; |
682 | 682 | if((hp==&(t->n.nd->harray[1]))||(hp==&(t->n.nd->harray[0]))) return; |
683 | 683 | if(basetime == ((*hp)->time+GLOBALS->shift_timebase)) hp--; |
693 | 693 | UTimeType utt; |
694 | 694 | TimeType tt; |
695 | 695 | |
696 | v=bsearch_vector(t->n.vec, basetime); | |
696 | v=bsearch_vector(t->n.vec, basetime - t->shift); | |
697 | 697 | vp=GLOBALS->vmax_compare_index; |
698 | 698 | if((vp==&(t->n.vec->vectors[1]))||(vp==&(t->n.vec->vectors[0]))) return; |
699 | 699 | if(basetime == ((*vp)->time+GLOBALS->shift_timebase)) vp--; |
720 | 720 | UTimeType utt; |
721 | 721 | TimeType tt; |
722 | 722 | |
723 | h=bsearch_node(t->n.nd, basetime); | |
723 | h=bsearch_node(t->n.nd, basetime - t->shift); | |
724 | 724 | while(h->next && h->time==h->next->time) h=h->next; |
725 | 725 | if((whichpass)||(GLOBALS->tims.marker>=0)) h=h->next; |
726 | 726 | if(!h) return; |
734 | 734 | UTimeType utt; |
735 | 735 | TimeType tt; |
736 | 736 | |
737 | v=bsearch_vector(t->n.vec, basetime); | |
737 | v=bsearch_vector(t->n.vec, basetime - t->shift); | |
738 | 738 | while(v->next && v->time==v->next->time) v=v->next; |
739 | 739 | if((whichpass)||(GLOBALS->tims.marker>=0)) v=v->next; |
740 | 740 | if(!v) return; |
760 | 760 | { |
761 | 761 | if(strace_adjust(s->his.h->time,GLOBALS->shift_timebase)!=maxbase) |
762 | 762 | { |
763 | s->his.h=bsearch_node(t->n.nd, maxbase); | |
763 | s->his.h=bsearch_node(t->n.nd, maxbase - t->shift); | |
764 | 764 | while(s->his.h->next && s->his.h->time==s->his.h->next->time) s->his.h=s->his.h->next; |
765 | 765 | } |
766 | 766 | if(t->flags&TR_INVERT) |
836 | 836 | { |
837 | 837 | if(strace_adjust(s->his.v->time,GLOBALS->shift_timebase)!=maxbase) |
838 | 838 | { |
839 | s->his.v=bsearch_vector(t->n.vec, maxbase); | |
839 | s->his.v=bsearch_vector(t->n.vec, maxbase - t->shift); | |
840 | 840 | while(s->his.v->next && s->his.v->time==s->his.v->next->time) s->his.v=s->his.v->next; |
841 | 841 | } |
842 | 842 | chval=convert_ascii(t,s->his.v); |
845 | 845 | { |
846 | 846 | if(strace_adjust(s->his.h->time,GLOBALS->shift_timebase)!=maxbase) |
847 | 847 | { |
848 | s->his.h=bsearch_node(t->n.nd, maxbase); | |
848 | s->his.h=bsearch_node(t->n.nd, maxbase - t->shift); | |
849 | 849 | while(s->his.h->next && s->his.h->time==s->his.h->next->time) s->his.h=s->his.h->next; |
850 | 850 | } |
851 | 851 | if(s->his.h->flags&HIST_REAL) |
852 | 852 | { |
853 | 853 | if(!(s->his.h->flags&HIST_STRING)) |
854 | 854 | { |
855 | chval=convert_ascii_real((double *)s->his.h->v.h_vector); | |
855 | chval=convert_ascii_real(t, (double *)s->his.h->v.h_vector); | |
856 | 856 | } |
857 | 857 | else |
858 | 858 | { |
1068 | 1068 | UTimeType utt; |
1069 | 1069 | TimeType tt; |
1070 | 1070 | |
1071 | h=bsearch_node(t->n.nd, basetime); | |
1071 | h=bsearch_node(t->n.nd, basetime - t->shift); | |
1072 | 1072 | s->his.h=h; |
1073 | 1073 | while(h->time==h->next->time) h=h->next; |
1074 | 1074 | if((whichpass)||(notfirst)) h=h->next; |
1082 | 1082 | UTimeType utt; |
1083 | 1083 | TimeType tt; |
1084 | 1084 | |
1085 | v=bsearch_vector(t->n.vec, basetime); | |
1085 | v=bsearch_vector(t->n.vec, basetime - t->shift); | |
1086 | 1086 | if((whichpass)||(notfirst)) v=v->next; |
1087 | 1087 | if(!v) return(MAX_HISTENT_TIME); |
1088 | 1088 | s->his.v=v; |
1106 | 1106 | { |
1107 | 1107 | if(strace_adjust(s->his.h->time,GLOBALS->shift_timebase)!=maxbase) |
1108 | 1108 | { |
1109 | s->his.h=bsearch_node(t->n.nd, maxbase); | |
1109 | s->his.h=bsearch_node(t->n.nd, maxbase - t->shift); | |
1110 | 1110 | while(s->his.h->next && s->his.h->time==s->his.h->next->time) s->his.h=s->his.h->next; |
1111 | 1111 | } |
1112 | 1112 | if(t->flags&TR_INVERT) |
1184 | 1184 | { |
1185 | 1185 | if(strace_adjust(s->his.v->time,GLOBALS->shift_timebase)!=maxbase) |
1186 | 1186 | { |
1187 | s->his.v=bsearch_vector(t->n.vec, maxbase); | |
1187 | s->his.v=bsearch_vector(t->n.vec, maxbase - t->shift); | |
1188 | 1188 | while(s->his.v->next && s->his.v->time==s->his.v->next->time) s->his.v=s->his.v->next; |
1189 | 1189 | } |
1190 | 1190 | chval=convert_ascii(t,s->his.v); |
1193 | 1193 | { |
1194 | 1194 | if(strace_adjust(s->his.h->time,GLOBALS->shift_timebase)!=maxbase) |
1195 | 1195 | { |
1196 | s->his.h=bsearch_node(t->n.nd, maxbase); | |
1196 | s->his.h=bsearch_node(t->n.nd, maxbase - t->shift); | |
1197 | 1197 | while(s->his.h->next && s->his.h->time==s->his.h->next->time) s->his.h=s->his.h->next; |
1198 | 1198 | } |
1199 | 1199 | if(s->his.h->flags&HIST_REAL) |
1200 | 1200 | { |
1201 | 1201 | if(!(s->his.h->flags&HIST_STRING)) |
1202 | 1202 | { |
1203 | chval=convert_ascii_real((double *)s->his.h->v.h_vector); | |
1203 | chval=convert_ascii_real(t, (double *)s->his.h->v.h_vector); | |
1204 | 1204 | } |
1205 | 1205 | else |
1206 | 1206 | { |
1646 | 1646 | mprintf("#{%s}",t->name); |
1647 | 1647 | |
1648 | 1648 | nodes=t->n.vec->bits->nodes; |
1649 | for(i=0;i<t->n.vec->nbits;i++) | |
1649 | for(i=0;i<t->n.vec->bits->nnbits;i++) | |
1650 | 1650 | { |
1651 | 1651 | if(nodes[i]->expansion) |
1652 | 1652 | { |
1694 | 1694 | } |
1695 | 1695 | |
1696 | 1696 | /* |
1697 | * $Id: strace.c,v 1.18 2010/03/14 07:09:49 gtkwave Exp $ | |
1697 | * $Id: strace.c,v 1.21 2010/04/01 03:10:58 gtkwave Exp $ | |
1698 | 1698 | * $Log: strace.c,v $ |
1699 | * Revision 1.21 2010/04/01 03:10:58 gtkwave | |
1700 | * time warp fixes | |
1701 | * | |
1702 | * Revision 1.20 2010/03/31 20:41:03 gtkwave | |
1703 | * nbits versus nnbits fix | |
1704 | * | |
1705 | * Revision 1.19 2010/03/24 23:05:10 gtkwave | |
1706 | * added RealToBits menu option | |
1707 | * | |
1699 | 1708 | * Revision 1.18 2010/03/14 07:09:49 gtkwave |
1700 | 1709 | * removed ExtNode and merged with Node |
1701 | 1710 | * |
26 | 26 | |
27 | 27 | #ifndef _MSC_VER |
28 | 28 | #include <unistd.h> |
29 | #ifdef HAVE_INTTYPES_H | |
29 | 30 | #include <inttypes.h> |
31 | #endif | |
30 | 32 | #else |
31 | 33 | typedef long off_t; |
32 | 34 | #include <windows.h> |
122 | 124 | #endif |
123 | 125 | |
124 | 126 | /* |
125 | * $Id: symbol.h,v 1.13 2010/03/16 21:01:10 gtkwave Exp $ | |
127 | * $Id: symbol.h,v 1.14 2010/04/27 23:10:56 gtkwave Exp $ | |
126 | 128 | * $Log: symbol.h,v $ |
129 | * Revision 1.14 2010/04/27 23:10:56 gtkwave | |
130 | * made inttype.h inclusion conditional | |
131 | * | |
127 | 132 | * Revision 1.13 2010/03/16 21:01:10 gtkwave |
128 | 133 | * remove selected member of struct symbol |
129 | 134 | * |
131 | 131 | } |
132 | 132 | else if (t->vector) |
133 | 133 | { |
134 | name = strdup_2(t->n.vec->name); | |
134 | name = strdup_2(t->n.vec->bvname); | |
135 | 135 | } |
136 | 136 | else |
137 | 137 | { |
1929 | 1929 | |
1930 | 1930 | |
1931 | 1931 | /* |
1932 | * $Id: tcl_commands.c,v 1.37 2010/03/18 17:12:37 gtkwave Exp $ | |
1932 | * $Id: tcl_commands.c,v 1.38 2010/04/04 19:09:57 gtkwave Exp $ | |
1933 | 1933 | * $Log: tcl_commands.c,v $ |
1934 | * Revision 1.38 2010/04/04 19:09:57 gtkwave | |
1935 | * rename name->bvname in struct BitVector for easier grep tracking | |
1936 | * | |
1934 | 1937 | * Revision 1.37 2010/03/18 17:12:37 gtkwave |
1935 | 1938 | * pedantic warning cleanups |
1936 | 1939 | * |
1445 | 1445 | if(t->vector) |
1446 | 1446 | { |
1447 | 1447 | /* this is currently unused as vectors are exploded into single bits */ |
1448 | vptr v = bsearch_vector(t->n.vec, GLOBALS->tims.marker); | |
1448 | vptr v = bsearch_vector(t->n.vec, GLOBALS->tims.marker - t->shift); | |
1449 | 1449 | rc = convert_ascii(t, v); |
1450 | 1450 | } |
1451 | 1451 | else |
1452 | 1452 | { |
1453 | hptr h_ptr = bsearch_node(t->n.nd, GLOBALS->tims.marker); | |
1453 | hptr h_ptr = bsearch_node(t->n.nd, GLOBALS->tims.marker - t->shift); | |
1454 | 1454 | if(h_ptr) |
1455 | 1455 | { |
1456 | 1456 | if(!t->n.nd->extvals) |
1464 | 1464 | { |
1465 | 1465 | if(!(h_ptr->flags&HIST_STRING)) |
1466 | 1466 | { |
1467 | rc = convert_ascii_real((double *)h_ptr->v.h_vector); | |
1467 | rc = convert_ascii_real(t, (double *)h_ptr->v.h_vector); | |
1468 | 1468 | } |
1469 | 1469 | else |
1470 | 1470 | { |
1610 | 1610 | { |
1611 | 1611 | int i; |
1612 | 1612 | nptr *nodes; |
1613 | vptr v = (GLOBALS->tims.marker != -1) ? bsearch_vector(t->n.vec, GLOBALS->tims.marker) : NULL; | |
1613 | vptr v = (GLOBALS->tims.marker != -1) ? bsearch_vector(t->n.vec, GLOBALS->tims.marker - t->shift) : NULL; | |
1614 | 1614 | unsigned char *bits = v ? (v->v) : NULL; |
1615 | 1615 | char *first_str = NULL; |
1616 | 1616 | int coalesce_pass = 1; |
1617 | 1617 | |
1618 | 1618 | nodes=t->n.vec->bits->nodes; |
1619 | 1619 | |
1620 | for(i=0;i<t->n.vec->nbits;i++) | |
1620 | for(i=0;i<t->n.vec->bits->nnbits;i++) | |
1621 | 1621 | { |
1622 | 1622 | if(!nodes[i]->expansion) |
1623 | 1623 | { |
1643 | 1643 | |
1644 | 1644 | if(coalesce_pass) |
1645 | 1645 | { |
1646 | if(t->n.vec->nbits < 2) | |
1646 | if(t->n.vec->bits->nnbits < 2) | |
1647 | 1647 | { |
1648 | 1648 | coalesce_pass = 0; |
1649 | 1649 | } |
1654 | 1654 | char *pl = strrchr(strl, '['); |
1655 | 1655 | int lidx = atoi(pl+1); |
1656 | 1656 | |
1657 | nptr nr = nodes[t->n.vec->nbits - 1]; | |
1657 | nptr nr = nodes[t->n.vec->bits->nnbits - 1]; | |
1658 | 1658 | char *strr = append_array_row(nr); |
1659 | 1659 | char *pr = strrchr(strr, '['); |
1660 | 1660 | int ridx = atoi(pr+1); |
1686 | 1686 | } |
1687 | 1687 | |
1688 | 1688 | if(!coalesce_pass) |
1689 | for(i=0;i<t->n.vec->nbits;i++) | |
1689 | for(i=0;i<t->n.vec->bits->nnbits;i++) | |
1690 | 1690 | { |
1691 | 1691 | if(nodes[i]->expansion) |
1692 | 1692 | { |
2048 | 2048 | } |
2049 | 2049 | } |
2050 | 2050 | |
2051 | /* NOT an else! */ | |
2052 | if(t->flags & TR_TTRANSLATED) | |
2053 | { | |
2054 | if(t->t_filter && GLOBALS->ttranssel_filter[t->t_filter]) | |
2055 | { | |
2056 | one_entry = make_message("^<%d %s\n", t->t_filter, GLOBALS->ttranssel_filter[t->t_filter]); | |
2057 | WAVE_OE_ME | |
2058 | } | |
2059 | else | |
2060 | { | |
2061 | one_entry = make_message("^<%d %s\n", 0, "disabled"); | |
2062 | WAVE_OE_ME | |
2063 | } | |
2064 | } | |
2065 | ||
2051 | 2066 | if(t->vector) |
2052 | 2067 | { |
2053 | 2068 | int i; |
2060 | 2075 | bits = t->n.vec->bits; |
2061 | 2076 | ba = bits ? bits->attribs : NULL; |
2062 | 2077 | |
2063 | one_entry = make_message("%c{%s}", ba ? ':' : '#', t->n.vec->name); | |
2078 | one_entry = make_message("%c{%s}", ba ? ':' : '#', | |
2079 | t->n.vec->transaction_cache ? t->n.vec->transaction_cache->bvname : t->n.vec->bvname); | |
2064 | 2080 | WAVE_OE_ME |
2065 | 2081 | |
2066 | 2082 | nodes=t->n.vec->bits->nodes; |
2067 | for(i=0;i<t->n.vec->nbits;i++) | |
2083 | for(i=0;i<t->n.vec->bits->nnbits;i++) | |
2068 | 2084 | { |
2069 | 2085 | if(nodes[i]->expansion) |
2070 | 2086 | { |
2716 | 2732 | |
2717 | 2733 | |
2718 | 2734 | /* |
2719 | * $Id: tcl_helper.c,v 1.73 2010/03/18 17:12:37 gtkwave Exp $ | |
2735 | * $Id: tcl_helper.c,v 1.78 2010/04/07 01:50:45 gtkwave Exp $ | |
2720 | 2736 | * $Log: tcl_helper.c,v $ |
2737 | * Revision 1.78 2010/04/07 01:50:45 gtkwave | |
2738 | * improved name handling for bvname, add $next transaction operation | |
2739 | * | |
2740 | * Revision 1.77 2010/04/04 19:09:57 gtkwave | |
2741 | * rename name->bvname in struct BitVector for easier grep tracking | |
2742 | * | |
2743 | * Revision 1.76 2010/04/01 03:10:58 gtkwave | |
2744 | * time warp fixes | |
2745 | * | |
2746 | * Revision 1.75 2010/03/31 20:41:03 gtkwave | |
2747 | * nbits versus nnbits fix | |
2748 | * | |
2749 | * Revision 1.74 2010/03/24 23:05:10 gtkwave | |
2750 | * added RealToBits menu option | |
2751 | * | |
2721 | 2752 | * Revision 1.73 2010/03/18 17:12:37 gtkwave |
2722 | 2753 | * pedantic warning cleanups |
2723 | 2754 | * |
244 | 244 | t = (Trptr) calloc_2(1, sizeof( TraceEnt ) ); |
245 | 245 | if( t == NULL ) { |
246 | 246 | fprintf( stderr, "Out of memory, can't add %s to analyzer\n", |
247 | vec->name ); | |
247 | vec->bvname ); | |
248 | 248 | return( 0 ); |
249 | 249 | } |
250 | 250 | |
251 | t->name = vec->name; | |
251 | t->name = vec->bvname; | |
252 | 252 | |
253 | 253 | if(GLOBALS->hier_max_level) |
254 | 254 | t->name = hier_extract(t->name, GLOBALS->hier_max_level); |
286 | 286 | *p = '\0' ; |
287 | 287 | len = strlen(name) ; |
288 | 288 | while(t) { |
289 | p = (!t->vector) ? t->n.nd->nname : t->n.vec->name ; | |
289 | p = (!t->vector) ? t->n.nd->nname : t->n.vec->bvname ; | |
290 | 290 | p1 = strchr(p,'[') ; |
291 | 291 | len1 = (p1) ? p1 - p : strlen(p) ; |
292 | 292 | if((len == len1) && !strncmp(name, p, len)) |
520 | 520 | if(t->n.nd->extvals) { |
521 | 521 | bw = abs(t->n.nd->msi - t->n.nd->lsi) + 1 ; |
522 | 522 | } |
523 | h = bsearch_node(t->n.nd, tstart) ; | |
523 | h = bsearch_node(t->n.nd, tstart - t->shift) ; | |
524 | 524 | for(h1 = h; h1; h1 = h1->next) { |
525 | 525 | if (h1->time <= tend) { |
526 | 526 | if (len++ < max_elements) { |
546 | 546 | } |
547 | 547 | } else { |
548 | 548 | vptr v, v1; |
549 | v = bsearch_vector(t->n.vec, tstart) ; | |
549 | v = bsearch_vector(t->n.vec, tstart - t->shift) ; | |
550 | 550 | for(v1 = v; v1; v1 = v1->next) { |
551 | 551 | if (v1->time <= tend) { |
552 | 552 | llist_u llp; llp.p = v1; |
575 | 575 | h_ptr = (hptr)lp->u.p ; |
576 | 576 | if(h_ptr->flags&HIST_REAL) { |
577 | 577 | if(!(h_ptr->flags&HIST_STRING)) { |
578 | s=convert_ascii_real((double *)h_ptr->v.h_vector); | |
578 | s=convert_ascii_real(t, (double *)h_ptr->v.h_vector); | |
579 | 579 | } else { |
580 | 580 | s=convert_ascii_string((char *)h_ptr->v.h_vector); |
581 | 581 | } |
165 | 165 | free_2(t); |
166 | 166 | } |
167 | 167 | |
168 | void remove_file_filter(int which, int regen) | |
168 | static void remove_file_filter(int which, int regen) | |
169 | 169 | { |
170 | 170 | if(GLOBALS->xl_file_filter[which]) |
171 | 171 | { |
179 | 179 | } |
180 | 180 | } |
181 | 181 | |
182 | void load_file_filter(int which, char *name) | |
182 | static void load_file_filter(int which, char *name) | |
183 | 183 | { |
184 | 184 | FILE *f = fopen(name, "rb"); |
185 | 185 | if(!f) |
308 | 308 | if(!strcmp(GLOBALS->filesel_filter[i], *GLOBALS->fileselbox_text)) |
309 | 309 | { |
310 | 310 | status_text("Filter already imported.\n"); |
311 | if(GLOBALS->is_active_translate_c_5) gdk_window_raise(GLOBALS->window_translate_c_11->window); | |
311 | 312 | return; |
312 | 313 | } |
313 | 314 | } |
333 | 334 | { |
334 | 335 | GLOBALS->num_file_filters--; |
335 | 336 | } |
337 | ||
338 | if(GLOBALS->is_active_translate_c_5) gdk_window_raise(GLOBALS->window_translate_c_11->window); | |
336 | 339 | } |
337 | 340 | |
338 | 341 | static void add_filter_callback(GtkWidget *widget, GtkWidget *nothing) |
512 | 515 | } |
513 | 516 | |
514 | 517 | /* |
515 | * $Id: translate.c,v 1.4 2007/09/12 17:26:45 gtkwave Exp $ | |
518 | * $Id: translate.c,v 1.6 2010/04/15 01:55:03 gtkwave Exp $ | |
516 | 519 | * $Log: translate.c,v $ |
520 | * Revision 1.6 2010/04/15 01:55:03 gtkwave | |
521 | * raise to front on filename select | |
522 | * | |
523 | * Revision 1.5 2010/03/31 15:42:47 gtkwave | |
524 | * added preliminary transaction filter support | |
525 | * | |
517 | 526 | * Revision 1.4 2007/09/12 17:26:45 gtkwave |
518 | 527 | * experimental ctx_swap_watchdog added...still tracking down mouse thrash crashes |
519 | 528 | * |
28 | 28 | }; |
29 | 29 | |
30 | 30 | |
31 | #define FILE_FILTER_MAX 1024 | |
31 | #define FILE_FILTER_MAX (128) | |
32 | 32 | |
33 | 33 | |
34 | 34 | |
45 | 45 | #endif |
46 | 46 | |
47 | 47 | /* |
48 | * $Id: translate.h,v 1.2 2007/08/26 21:35:46 gtkwave Exp $ | |
48 | * $Id: translate.h,v 1.3 2010/03/30 18:33:27 gtkwave Exp $ | |
49 | 49 | * $Log: translate.h,v $ |
50 | * Revision 1.3 2010/03/30 18:33:27 gtkwave | |
51 | * fixed cut and paste errors from file to proc | |
52 | * | |
50 | 53 | * Revision 1.2 2007/08/26 21:35:46 gtkwave |
51 | 54 | * integrated global context management from SystemOfCode2007 branch |
52 | 55 | * |
0 | /* | |
1 | * Copyright (c) Tony Bybell 2010. | |
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 "globals.h" | |
10 | #include <config.h> | |
11 | #include <gtk/gtk.h> | |
12 | #include "gtk12compat.h" | |
13 | #include "symbol.h" | |
14 | #include "ttranslate.h" | |
15 | #include "pipeio.h" | |
16 | #include "debug.h" | |
17 | ||
18 | #ifdef _MSC_VER | |
19 | #define strcasecmp _stricmp | |
20 | #endif | |
21 | ||
22 | void init_ttrans_data(void) | |
23 | { | |
24 | int i; | |
25 | ||
26 | if(!GLOBALS->ttranssel_filter) { GLOBALS->ttranssel_filter = calloc_2(TTRANS_FILTER_MAX+1, sizeof(char *)); } | |
27 | if(!GLOBALS->ttrans_filter) { GLOBALS->ttrans_filter = calloc_2(TTRANS_FILTER_MAX+1, sizeof(struct pipe_ctx *)); } | |
28 | ||
29 | for(i=0;i<TTRANS_FILTER_MAX+1;i++) | |
30 | { | |
31 | GLOBALS->ttranssel_filter[i] = NULL; | |
32 | GLOBALS->ttrans_filter[i] = NULL; | |
33 | } | |
34 | } | |
35 | ||
36 | void remove_all_ttrans_filters(void) | |
37 | { | |
38 | struct Global *GLOBALS_cache = GLOBALS; | |
39 | int i, j; | |
40 | ||
41 | for(j=0;j<GLOBALS->num_notebook_pages;j++) | |
42 | { | |
43 | GLOBALS = (*GLOBALS->contexts)[j]; | |
44 | ||
45 | for(i=1;i<TTRANS_FILTER_MAX+1;i++) | |
46 | { | |
47 | if(GLOBALS->ttrans_filter[i]) | |
48 | { | |
49 | pipeio_destroy(GLOBALS->ttrans_filter[i]); | |
50 | GLOBALS->ttrans_filter[i] = NULL; | |
51 | } | |
52 | ||
53 | if(GLOBALS->ttranssel_filter[i]) | |
54 | { | |
55 | free_2(GLOBALS->ttranssel_filter[i]); | |
56 | GLOBALS->ttranssel_filter[i] = NULL; | |
57 | } | |
58 | } | |
59 | ||
60 | GLOBALS = GLOBALS_cache; | |
61 | } | |
62 | } | |
63 | ||
64 | #if defined __MINGW32__ || defined _MSC_VER | |
65 | ||
66 | void ttrans_searchbox(char *title) { } | |
67 | void install_ttrans_filter(int which) { } | |
68 | void set_current_translate_ttrans(char *name) { } | |
69 | int traverse_vector_nodes(Trptr t) { if(t) { t->t_filter = 0; } return(0); } | |
70 | ||
71 | #else | |
72 | ||
73 | static void regen_display(void) | |
74 | { | |
75 | if(GLOBALS->signalarea && GLOBALS->wavearea) | |
76 | { | |
77 | GLOBALS->signalwindow_width_dirty=1; | |
78 | MaxSignalLength(); | |
79 | signalarea_configure_event(GLOBALS->signalarea, NULL); | |
80 | wavearea_configure_event(GLOBALS->wavearea, NULL); | |
81 | } | |
82 | } | |
83 | ||
84 | ||
85 | /* | |
86 | * this is likely obsolete | |
87 | */ | |
88 | static void remove_ttrans_filter(int which, int regen) | |
89 | { | |
90 | if(GLOBALS->ttrans_filter[which]) | |
91 | { | |
92 | pipeio_destroy(GLOBALS->ttrans_filter[which]); | |
93 | GLOBALS->ttrans_filter[which] = NULL; | |
94 | ||
95 | if(regen) | |
96 | { | |
97 | regen_display(); | |
98 | } | |
99 | } | |
100 | } | |
101 | ||
102 | ||
103 | static void load_ttrans_filter(int which, char *name) | |
104 | { | |
105 | ||
106 | FILE *stream; | |
107 | ||
108 | char *cmd; | |
109 | char exec_name[1025]; | |
110 | char abs_path [1025]; | |
111 | char* arg, end; | |
112 | int result; | |
113 | ||
114 | exec_name[0] = 0; | |
115 | abs_path[0] = 0; | |
116 | ||
117 | /* if name has arguments grab only the first word (the name of the executable)*/ | |
118 | sscanf(name, "%s ", exec_name); | |
119 | ||
120 | arg = name + strlen(exec_name); | |
121 | ||
122 | /* remove leading spaces from argument */ | |
123 | while (isspace(arg[0])) { | |
124 | arg++; | |
125 | } | |
126 | ||
127 | /* remove trailing spaces from argument */ | |
128 | if (strlen(arg) > 0) { | |
129 | ||
130 | end = strlen(arg) - 1; | |
131 | ||
132 | while (arg[(int)end] == ' ') { | |
133 | arg[(int)end] = 0; | |
134 | end--; | |
135 | } | |
136 | } | |
137 | ||
138 | /* turn the exec_name into an absolute path */ | |
139 | cmd = (char *)malloc_2(strlen(exec_name)+6+1); | |
140 | sprintf(cmd, "which %s", exec_name); | |
141 | stream = popen(cmd, "r"); | |
142 | ||
143 | result = fscanf(stream, "%s", abs_path); | |
144 | ||
145 | if(strlen(abs_path) == 0) | |
146 | { | |
147 | status_text("Could not find transaction filter process!\n"); | |
148 | return; | |
149 | ||
150 | } | |
151 | ||
152 | pclose(stream); | |
153 | free_2(cmd); | |
154 | ||
155 | /* remove_ttrans_filter(which, 0); ... should never happen from GUI, but perhaps possible from save files or other weirdness */ | |
156 | if(!GLOBALS->ttrans_filter[which]) | |
157 | { | |
158 | GLOBALS->ttrans_filter[which] = pipeio_create(abs_path, arg); | |
159 | } | |
160 | } | |
161 | ||
162 | void install_ttrans_filter(int which) | |
163 | { | |
164 | int found = 0; | |
165 | ||
166 | if(GLOBALS->traces.first) | |
167 | { | |
168 | Trptr t = GLOBALS->traces.first; | |
169 | while(t) | |
170 | { | |
171 | if(t->flags&TR_HIGHLIGHT) | |
172 | { | |
173 | if(!t->vector) | |
174 | { | |
175 | bvptr v = combine_traces(0, t); /* make single signal a vector */ | |
176 | if(v) | |
177 | { | |
178 | t->vector = 1; | |
179 | t->n.vec = v; /* splice in */ | |
180 | } | |
181 | } | |
182 | ||
183 | if((t->vector) && (!(t->flags&(TR_BLANK|TR_ANALOG_BLANK_STRETCH)))) | |
184 | { | |
185 | t->t_filter = which; | |
186 | ||
187 | t->t_filter_converted = 0; | |
188 | ||
189 | /* back out allocation to revert (if any) */ | |
190 | if(t->n.vec->transaction_cache) | |
191 | { | |
192 | int i; | |
193 | bvptr bv = t->n.vec; | |
194 | bvptr bv2; | |
195 | ||
196 | t->n.vec = bv->transaction_cache; | |
197 | ||
198 | while(bv) | |
199 | { | |
200 | bv2 = bv->transaction_chain; | |
201 | ||
202 | if(bv->bvname) | |
203 | { | |
204 | free_2(bv->bvname); | |
205 | } | |
206 | ||
207 | for(i=0;i<bv->numregions;i++) | |
208 | { | |
209 | free_2(bv->vectors[i]); | |
210 | } | |
211 | ||
212 | free_2(bv); | |
213 | bv = bv2; | |
214 | } | |
215 | ||
216 | t->name = t->n.vec->bvname; | |
217 | if(GLOBALS->hier_max_level) | |
218 | t->name = hier_extract(t->name, GLOBALS->hier_max_level); | |
219 | } | |
220 | ||
221 | if(!which) | |
222 | { | |
223 | t->flags &= (~TR_TTRANSLATED); | |
224 | } | |
225 | else | |
226 | { | |
227 | t->flags |= TR_TTRANSLATED; | |
228 | traverse_vector_nodes(t); | |
229 | } | |
230 | found = 1; | |
231 | ||
232 | if(t->t_match) | |
233 | { | |
234 | Trptr curr_trace = t; | |
235 | t = t->t_next; | |
236 | while(t && (t->t_match != curr_trace)) | |
237 | { | |
238 | t = t->t_next; | |
239 | } | |
240 | } | |
241 | } | |
242 | } | |
243 | t=GiveNextTrace(t); | |
244 | } | |
245 | } | |
246 | ||
247 | if(found) | |
248 | { | |
249 | regen_display(); | |
250 | } | |
251 | } | |
252 | ||
253 | /************************************************************************/ | |
254 | ||
255 | ||
256 | ||
257 | static void destroy_callback(GtkWidget *widget, GtkWidget *nothing) | |
258 | { | |
259 | GLOBALS->is_active_ttranslate_c_2=0; | |
260 | gtk_widget_destroy(GLOBALS->window_ttranslate_c_5); | |
261 | GLOBALS->window_ttranslate_c_5 = NULL; | |
262 | } | |
263 | ||
264 | static void ok_callback(GtkWidget *widget, GtkWidget *nothing) | |
265 | { | |
266 | install_ttrans_filter(GLOBALS->current_filter_ttranslate_c_1); | |
267 | destroy_callback(widget, nothing); | |
268 | } | |
269 | ||
270 | static void select_row_callback(GtkWidget *widget, gint row, gint column, | |
271 | GdkEventButton *event, gpointer data) | |
272 | { | |
273 | GLOBALS->current_filter_ttranslate_c_1 = row + 1; | |
274 | } | |
275 | ||
276 | static void unselect_row_callback(GtkWidget *widget, gint row, gint column, | |
277 | GdkEventButton *event, gpointer data) | |
278 | { | |
279 | GLOBALS->current_filter_ttranslate_c_1 = 0; /* none */ | |
280 | } | |
281 | ||
282 | ||
283 | static void add_filter_callback_2(GtkWidget *widget, GtkWidget *nothing) | |
284 | { | |
285 | int i; | |
286 | GtkCList *cl; | |
287 | ||
288 | if(!GLOBALS->filesel_ok) { return; } | |
289 | ||
290 | if(*GLOBALS->fileselbox_text) | |
291 | { | |
292 | for(i=0;i<GLOBALS->num_ttrans_filters;i++) | |
293 | { | |
294 | if(GLOBALS->ttranssel_filter[i]) | |
295 | { | |
296 | if(!strcmp(GLOBALS->ttranssel_filter[i], *GLOBALS->fileselbox_text)) | |
297 | { | |
298 | status_text("Filter already imported.\n"); | |
299 | if(GLOBALS->is_active_ttranslate_c_2) gdk_window_raise(GLOBALS->window_ttranslate_c_5->window); | |
300 | return; | |
301 | } | |
302 | } | |
303 | } | |
304 | } | |
305 | ||
306 | GLOBALS->num_ttrans_filters++; | |
307 | load_ttrans_filter(GLOBALS->num_ttrans_filters, *GLOBALS->fileselbox_text); | |
308 | if(GLOBALS->ttrans_filter[GLOBALS->num_ttrans_filters]) | |
309 | { | |
310 | if(GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters]) free_2(GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters]); | |
311 | GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters] = malloc_2(strlen(*GLOBALS->fileselbox_text) + 1); | |
312 | strcpy(GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters], *GLOBALS->fileselbox_text); | |
313 | ||
314 | cl=GTK_CLIST(GLOBALS->clist_ttranslate_c_2); | |
315 | gtk_clist_freeze(cl); | |
316 | gtk_clist_append(cl,(gchar **)&(GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters])); | |
317 | ||
318 | gtk_clist_set_column_width(cl,0,gtk_clist_optimal_column_width(cl,0)); | |
319 | gtk_clist_thaw(cl); | |
320 | } | |
321 | else | |
322 | { | |
323 | GLOBALS->num_ttrans_filters--; | |
324 | } | |
325 | ||
326 | if(GLOBALS->is_active_ttranslate_c_2) gdk_window_raise(GLOBALS->window_ttranslate_c_5->window); | |
327 | } | |
328 | ||
329 | static void add_filter_callback(GtkWidget *widget, GtkWidget *nothing) | |
330 | { | |
331 | if(GLOBALS->num_ttrans_filters == TTRANS_FILTER_MAX) | |
332 | { | |
333 | status_text("Max number of transaction filters processes installed already.\n"); | |
334 | return; | |
335 | } | |
336 | ||
337 | fileselbox("Select Transaction Filter Process",&GLOBALS->fcurr_ttranslate_c_1,GTK_SIGNAL_FUNC(add_filter_callback_2), GTK_SIGNAL_FUNC(NULL),"*", 0); | |
338 | } | |
339 | ||
340 | /* | |
341 | * mainline.. | |
342 | */ | |
343 | void ttrans_searchbox(char *title) | |
344 | { | |
345 | int i; | |
346 | ||
347 | GtkWidget *scrolled_win; | |
348 | GtkWidget *vbox1, *hbox, *hbox0; | |
349 | GtkWidget *button1, *button5, *button6; | |
350 | gchar *titles[]={"Transaction Process Filter Select"}; | |
351 | GtkWidget *frame2, *frameh, *frameh0; | |
352 | GtkWidget *table; | |
353 | GtkTooltips *tooltips; | |
354 | ||
355 | if(GLOBALS->is_active_ttranslate_c_2) | |
356 | { | |
357 | gdk_window_raise(GLOBALS->window_ttranslate_c_5->window); | |
358 | return; | |
359 | } | |
360 | ||
361 | GLOBALS->is_active_ttranslate_c_2=1; | |
362 | GLOBALS->current_filter_ttranslate_c_1 = 0; | |
363 | ||
364 | /* create a new modal window */ | |
365 | GLOBALS->window_ttranslate_c_5 = gtk_window_new(GLOBALS->disable_window_manager ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL); | |
366 | install_focus_cb(GLOBALS->window_ttranslate_c_5, ((char *)&GLOBALS->window_ttranslate_c_5) - ((char *)GLOBALS)); | |
367 | ||
368 | gtk_window_set_title(GTK_WINDOW (GLOBALS->window_ttranslate_c_5), title); | |
369 | gtkwave_signal_connect(GTK_OBJECT (GLOBALS->window_ttranslate_c_5), "delete_event",(GtkSignalFunc) destroy_callback, NULL); | |
370 | ||
371 | tooltips=gtk_tooltips_new_2(); | |
372 | ||
373 | table = gtk_table_new (256, 1, FALSE); | |
374 | gtk_widget_show (table); | |
375 | ||
376 | vbox1 = gtk_vbox_new (FALSE, 0); | |
377 | gtk_container_border_width (GTK_CONTAINER (vbox1), 3); | |
378 | gtk_widget_show (vbox1); | |
379 | ||
380 | ||
381 | frame2 = gtk_frame_new (NULL); | |
382 | gtk_container_border_width (GTK_CONTAINER (frame2), 3); | |
383 | gtk_widget_show(frame2); | |
384 | ||
385 | gtk_table_attach (GTK_TABLE (table), frame2, 0, 1, 0, 254, | |
386 | GTK_FILL | GTK_EXPAND, | |
387 | GTK_FILL | GTK_EXPAND | GTK_SHRINK, 1, 1); | |
388 | ||
389 | GLOBALS->clist_ttranslate_c_2=gtk_clist_new_with_titles(1,titles); | |
390 | gtk_clist_column_titles_passive(GTK_CLIST(GLOBALS->clist_ttranslate_c_2)); | |
391 | ||
392 | gtk_clist_set_selection_mode(GTK_CLIST(GLOBALS->clist_ttranslate_c_2), GTK_SELECTION_EXTENDED); | |
393 | gtkwave_signal_connect_object (GTK_OBJECT (GLOBALS->clist_ttranslate_c_2), "select_row",GTK_SIGNAL_FUNC(select_row_callback),NULL); | |
394 | gtkwave_signal_connect_object (GTK_OBJECT (GLOBALS->clist_ttranslate_c_2), "unselect_row",GTK_SIGNAL_FUNC(unselect_row_callback),NULL); | |
395 | ||
396 | for(i=0;i<GLOBALS->num_ttrans_filters;i++) | |
397 | { | |
398 | gtk_clist_append(GTK_CLIST(GLOBALS->clist_ttranslate_c_2),(gchar **)&(GLOBALS->ttranssel_filter[i+1])); | |
399 | } | |
400 | gtk_clist_set_column_width(GTK_CLIST(GLOBALS->clist_ttranslate_c_2),0,gtk_clist_optimal_column_width(GTK_CLIST(GLOBALS->clist_ttranslate_c_2),0)); | |
401 | ||
402 | gtk_widget_show (GLOBALS->clist_ttranslate_c_2); | |
403 | ||
404 | scrolled_win = gtk_scrolled_window_new (NULL, NULL); | |
405 | gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), | |
406 | GTK_POLICY_AUTOMATIC, | |
407 | GTK_POLICY_AUTOMATIC); | |
408 | gtk_widget_set_usize( GTK_WIDGET (scrolled_win), -1, 300); | |
409 | gtk_widget_show(scrolled_win); | |
410 | ||
411 | /* gtk_scrolled_window_add_with_viewport doesn't seen to work right here.. */ | |
412 | gtk_container_add (GTK_CONTAINER (scrolled_win), GLOBALS->clist_ttranslate_c_2); | |
413 | ||
414 | gtk_container_add (GTK_CONTAINER (frame2), scrolled_win); | |
415 | ||
416 | ||
417 | frameh0 = gtk_frame_new (NULL); | |
418 | gtk_container_border_width (GTK_CONTAINER (frameh0), 3); | |
419 | gtk_widget_show(frameh0); | |
420 | gtk_table_attach (GTK_TABLE (table), frameh0, 0, 1, 254, 255, | |
421 | GTK_FILL | GTK_EXPAND, | |
422 | GTK_FILL | GTK_EXPAND | GTK_SHRINK, 1, 1); | |
423 | ||
424 | ||
425 | hbox0 = gtk_hbox_new (FALSE, 1); | |
426 | gtk_widget_show (hbox0); | |
427 | ||
428 | button6 = gtk_button_new_with_label (" Add Trans Filter to List "); | |
429 | gtk_container_border_width (GTK_CONTAINER (button6), 3); | |
430 | gtkwave_signal_connect_object (GTK_OBJECT (button6), "clicked",GTK_SIGNAL_FUNC(add_filter_callback),GTK_OBJECT (GLOBALS->window_ttranslate_c_5)); | |
431 | gtk_widget_show (button6); | |
432 | gtk_tooltips_set_tip_2(tooltips, button6, | |
433 | "Bring up a file requester to add a transaction process filter to the filter select window.",NULL); | |
434 | ||
435 | gtk_box_pack_start (GTK_BOX (hbox0), button6, TRUE, FALSE, 0); | |
436 | gtk_container_add (GTK_CONTAINER (frameh0), hbox0); | |
437 | ||
438 | frameh = gtk_frame_new (NULL); | |
439 | gtk_container_border_width (GTK_CONTAINER (frameh), 3); | |
440 | gtk_widget_show(frameh); | |
441 | gtk_table_attach (GTK_TABLE (table), frameh, 0, 1, 255, 256, | |
442 | GTK_FILL | GTK_EXPAND, | |
443 | GTK_FILL | GTK_EXPAND | GTK_SHRINK, 1, 1); | |
444 | ||
445 | ||
446 | hbox = gtk_hbox_new (FALSE, 1); | |
447 | gtk_widget_show (hbox); | |
448 | ||
449 | button1 = gtk_button_new_with_label (" OK "); | |
450 | gtk_container_border_width (GTK_CONTAINER (button1), 3); | |
451 | gtkwave_signal_connect_object (GTK_OBJECT (button1), "clicked",GTK_SIGNAL_FUNC(ok_callback),GTK_OBJECT (GLOBALS->window_ttranslate_c_5)); | |
452 | gtk_widget_show (button1); | |
453 | gtk_tooltips_set_tip_2(tooltips, button1, | |
454 | "Add selected signals to end of the display on the main window.",NULL); | |
455 | ||
456 | gtk_box_pack_start (GTK_BOX (hbox), button1, TRUE, FALSE, 0); | |
457 | ||
458 | button5 = gtk_button_new_with_label (" Cancel "); | |
459 | gtk_container_border_width (GTK_CONTAINER (button5), 3); | |
460 | gtkwave_signal_connect_object (GTK_OBJECT (button5), "clicked",GTK_SIGNAL_FUNC(destroy_callback),GTK_OBJECT (GLOBALS->window_ttranslate_c_5)); | |
461 | gtk_tooltips_set_tip_2(tooltips, button5, | |
462 | "Do nothing and return to the main window.",NULL); | |
463 | gtk_widget_show (button5); | |
464 | gtk_box_pack_start (GTK_BOX (hbox), button5, TRUE, FALSE, 0); | |
465 | ||
466 | gtk_container_add (GTK_CONTAINER (frameh), hbox); | |
467 | gtk_container_add (GTK_CONTAINER (GLOBALS->window_ttranslate_c_5), table); | |
468 | ||
469 | gtk_widget_set_usize(GTK_WIDGET(GLOBALS->window_ttranslate_c_5), 400, 400); | |
470 | gtk_widget_show(GLOBALS->window_ttranslate_c_5); | |
471 | } | |
472 | ||
473 | ||
474 | /* | |
475 | * currently only called by parsewavline | |
476 | */ | |
477 | void set_current_translate_ttrans(char *name) | |
478 | { | |
479 | int i; | |
480 | ||
481 | for(i=1;i<GLOBALS->num_ttrans_filters+1;i++) | |
482 | { | |
483 | if(!strcmp(GLOBALS->ttranssel_filter[i], name)) { GLOBALS->current_translate_ttrans = i; return; } | |
484 | } | |
485 | ||
486 | if(GLOBALS->num_ttrans_filters < TTRANS_FILTER_MAX) | |
487 | { | |
488 | GLOBALS->num_ttrans_filters++; | |
489 | load_ttrans_filter(GLOBALS->num_ttrans_filters, name); | |
490 | if(!GLOBALS->ttrans_filter[GLOBALS->num_ttrans_filters]) | |
491 | { | |
492 | GLOBALS->num_ttrans_filters--; | |
493 | GLOBALS->current_translate_ttrans = 0; | |
494 | } | |
495 | else | |
496 | { | |
497 | if(GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters]) free_2(GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters]); | |
498 | GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters] = malloc_2(strlen(name) + 1); | |
499 | strcpy(GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters], name); | |
500 | GLOBALS->current_translate_ttrans = GLOBALS->num_ttrans_filters; | |
501 | } | |
502 | } | |
503 | } | |
504 | ||
505 | ||
506 | int traverse_vector_nodes(Trptr t) | |
507 | { | |
508 | int i; | |
509 | int cvt_ok = 0; | |
510 | ||
511 | if((t->t_filter) && (t->flags & TR_TTRANSLATED) && (t->vector) && (!t->t_filter_converted)) | |
512 | { | |
513 | int rc = save_nodes_to_trans(GLOBALS->ttrans_filter[t->t_filter]->sout, t); | |
514 | ||
515 | if(rc == VCDSAV_OK) | |
516 | { | |
517 | int is_finish = 0; | |
518 | bvptr prev_transaction_trace = NULL; | |
519 | ||
520 | while(!is_finish) | |
521 | { | |
522 | struct VectorEnt *vt_head = NULL, *vt_curr = NULL; | |
523 | struct VectorEnt *vt; | |
524 | struct VectorEnt *vprev; | |
525 | bvptr bv; | |
526 | int regions = 2; | |
527 | TimeType prev_tim = LLDescriptor(-1); | |
528 | char *trace_name = NULL; | |
529 | char *orig_name = t->n.vec->bvname; | |
530 | ||
531 | cvt_ok = 1; | |
532 | ||
533 | vt_head = vt_curr = vt = calloc_2(1, sizeof(struct VectorEnt)); | |
534 | vt->time = LLDescriptor(-2); | |
535 | vprev = vt; /* for duplicate removal */ | |
536 | ||
537 | vt_curr = vt_curr->next = vt = calloc_2(1, sizeof(struct VectorEnt)); | |
538 | vt->time = LLDescriptor(-1); | |
539 | ||
540 | for(;;) | |
541 | { | |
542 | char buf[1025]; | |
543 | char *pnt, *rtn; | |
544 | ||
545 | if(feof(GLOBALS->ttrans_filter[t->t_filter]->sin)) break; /* should never happen */ | |
546 | ||
547 | buf[0] = 0; | |
548 | pnt = fgets(buf, 1024, GLOBALS->ttrans_filter[t->t_filter]->sin); | |
549 | if(!pnt) break; | |
550 | rtn = pnt; | |
551 | while(*rtn) | |
552 | { | |
553 | if((*rtn == '\n') || (*rtn == '\r')) { *rtn = 0; break; } | |
554 | rtn++; | |
555 | } | |
556 | ||
557 | while(*pnt) { if(isspace(*pnt)) pnt++; else break;} | |
558 | ||
559 | if(*pnt=='#') | |
560 | { | |
561 | TimeType tim = atoi_64(pnt+1) * GLOBALS->time_scale; | |
562 | int slen; | |
563 | char *sp; | |
564 | ||
565 | while(*pnt) { if(!isspace(*pnt)) pnt++; else break; } | |
566 | while(*pnt) { if(isspace(*pnt)) pnt++; else break; } | |
567 | ||
568 | sp = pnt; | |
569 | slen = strlen(sp); | |
570 | ||
571 | if(slen) | |
572 | { | |
573 | pnt = sp + slen - 1; | |
574 | do | |
575 | { | |
576 | if(isspace(*pnt)) { *pnt = 0; pnt--; slen--; } else { break; } | |
577 | } while(pnt != (sp-1)); | |
578 | } | |
579 | ||
580 | vt = calloc_2(1, sizeof(struct VectorEnt) + slen); | |
581 | if(sp) strcpy(vt->v, sp); | |
582 | ||
583 | if(tim > prev_tim) | |
584 | { | |
585 | prev_tim = vt->time = tim; | |
586 | vt_curr->next = vt; | |
587 | vt_curr = vt; | |
588 | vprev = vprev->next; /* bump forward the -2 node pointer */ | |
589 | regions++; | |
590 | } | |
591 | else if(tim == prev_tim) | |
592 | { | |
593 | vt->time = prev_tim; | |
594 | free_2(vt_curr); | |
595 | vt_curr = vprev->next = vt; /* splice new one in -1 node place */ | |
596 | } | |
597 | else | |
598 | { | |
599 | free_2(vt); /* throw it away */ | |
600 | } | |
601 | ||
602 | continue; | |
603 | } | |
604 | else | |
605 | if((*pnt=='M')||(*pnt=='m')) | |
606 | { | |
607 | pnt++; | |
608 | if(((*pnt>='A')&&(*pnt<='Z')) || ((*pnt>='a')&&(*pnt<='z'))) | |
609 | { | |
610 | int which_marker = ((*pnt>='A')&&(*pnt<='Z')) ? (*pnt - 'A') : (*pnt - 'a'); | |
611 | TimeType tim = atoi_64(pnt+1) * GLOBALS->time_scale; | |
612 | int slen; | |
613 | char *sp; | |
614 | ||
615 | if(tim < LLDescriptor(0)) tim = LLDescriptor(-1); | |
616 | GLOBALS->named_markers[which_marker] = tim; | |
617 | ||
618 | while(*pnt) { if(!isspace(*pnt)) pnt++; else break; } | |
619 | while(*pnt) { if(isspace(*pnt)) pnt++; else break; } | |
620 | ||
621 | sp = pnt; | |
622 | slen = strlen(sp); | |
623 | ||
624 | if(slen) | |
625 | { | |
626 | pnt = sp + slen - 1; | |
627 | do | |
628 | { | |
629 | if(isspace(*pnt)) { *pnt = 0; pnt--; slen--; } else { break; } | |
630 | } while(pnt != (sp-1)); | |
631 | } | |
632 | ||
633 | if(GLOBALS->marker_names[which_marker]) free_2(GLOBALS->marker_names[which_marker]); | |
634 | GLOBALS->marker_names[which_marker] = (sp && (*sp) && (tim >= LLDescriptor(0))) ? strdup_2(sp) : NULL; | |
635 | } | |
636 | ||
637 | continue; | |
638 | } | |
639 | else if(*pnt == '$') | |
640 | { | |
641 | if(!strncmp(pnt+1, "finish", 6)) | |
642 | { | |
643 | is_finish = 1; | |
644 | break; | |
645 | } | |
646 | else | |
647 | if(!strncmp(pnt+1, "next", 4)) | |
648 | { | |
649 | break; | |
650 | } | |
651 | else | |
652 | if(!strncmp(pnt+1, "name", 4)) | |
653 | { | |
654 | int slen; | |
655 | char *sp; | |
656 | ||
657 | pnt+=5; | |
658 | while(*pnt) { if(isspace(*pnt)) pnt++; else break; } | |
659 | ||
660 | sp = pnt; | |
661 | slen = strlen(sp); | |
662 | ||
663 | if(slen) | |
664 | { | |
665 | pnt = sp + slen - 1; | |
666 | do | |
667 | { | |
668 | if(isspace(*pnt)) { *pnt = 0; pnt--; slen--; } else { break; } | |
669 | } while(pnt != (sp-1)); | |
670 | } | |
671 | ||
672 | if(sp && *sp) | |
673 | { | |
674 | if(trace_name) free_2(trace_name); | |
675 | trace_name = strdup_2(sp); | |
676 | } | |
677 | } | |
678 | } | |
679 | } | |
680 | ||
681 | vt_curr = vt_curr->next = vt = calloc_2(1, sizeof(struct VectorEnt)); | |
682 | vt->time = MAX_HISTENT_TIME - 1; | |
683 | regions++; | |
684 | ||
685 | vt_curr = vt_curr->next = vt = calloc_2(1, sizeof(struct VectorEnt)); | |
686 | vt->time = MAX_HISTENT_TIME; | |
687 | regions++; | |
688 | ||
689 | bv = calloc_2(1, sizeof(struct BitVector) + (sizeof(vptr) * (regions-1))); | |
690 | bv->bvname = strdup_2(trace_name ? trace_name : orig_name); | |
691 | bv->nbits = 1; | |
692 | bv->numregions = regions; | |
693 | bv->bits = t->n.vec->bits; | |
694 | ||
695 | vt = vt_head; | |
696 | for(i=0;i<regions;i++) | |
697 | { | |
698 | bv->vectors[i] = vt; | |
699 | vt = vt->next; | |
700 | } | |
701 | ||
702 | if(!prev_transaction_trace) | |
703 | { | |
704 | prev_transaction_trace = bv; | |
705 | bv->transaction_cache = t->n.vec; /* for possible restore later */ | |
706 | t->n.vec = bv; | |
707 | ||
708 | t->t_filter_converted = 1; | |
709 | ||
710 | if(trace_name) /* if NULL, no need to regen display as trace name didn't change */ | |
711 | { | |
712 | t->name = t->n.vec->bvname; | |
713 | if(GLOBALS->hier_max_level) | |
714 | t->name = hier_extract(t->name, GLOBALS->hier_max_level); | |
715 | ||
716 | regen_display(); | |
717 | } | |
718 | } | |
719 | else | |
720 | { | |
721 | prev_transaction_trace->transaction_chain = bv; | |
722 | prev_transaction_trace = bv; | |
723 | } | |
724 | } | |
725 | } | |
726 | else | |
727 | { | |
728 | /* failed */ | |
729 | t->flags &= ~TR_TTRANSLATED; | |
730 | } | |
731 | } | |
732 | ||
733 | return(cvt_ok); | |
734 | } | |
735 | ||
736 | #endif | |
737 | ||
738 | /* | |
739 | * $Id: ttranslate.c,v 1.17 2010/04/25 16:47:06 gtkwave Exp $ | |
740 | * $Log: ttranslate.c,v $ | |
741 | * Revision 1.17 2010/04/25 16:47:06 gtkwave | |
742 | * typo fix for mingw | |
743 | * | |
744 | * Revision 1.16 2010/04/24 16:32:46 gtkwave | |
745 | * compile fix for MinGW | |
746 | * | |
747 | * Revision 1.15 2010/04/15 18:39:35 gtkwave | |
748 | * remove invocations of pipeio_destroy where unnecessary | |
749 | * | |
750 | * Revision 1.14 2010/04/15 01:55:03 gtkwave | |
751 | * raise to front on filename select | |
752 | * | |
753 | * Revision 1.13 2010/04/15 00:30:23 gtkwave | |
754 | * don't propagate ttranslate filter into groups | |
755 | * | |
756 | * Revision 1.12 2010/04/12 23:07:12 gtkwave | |
757 | * add ability to make single signals transactions | |
758 | * | |
759 | * Revision 1.11 2010/04/08 22:23:53 gtkwave | |
760 | * remove debug statement | |
761 | * | |
762 | * Revision 1.10 2010/04/07 01:50:45 gtkwave | |
763 | * improved name handling for bvname, add $next transaction operation | |
764 | * | |
765 | * Revision 1.9 2010/04/06 06:17:21 gtkwave | |
766 | * added N named trace flag | |
767 | * | |
768 | * Revision 1.8 2010/04/04 19:09:57 gtkwave | |
769 | * rename name->bvname in struct BitVector for easier grep tracking | |
770 | * | |
771 | * Revision 1.7 2010/04/04 07:12:40 gtkwave | |
772 | * deallocate transaction cache on FreeTrace | |
773 | * | |
774 | * Revision 1.6 2010/04/04 06:07:03 gtkwave | |
775 | * add M named marker placement command | |
776 | * | |
777 | * Revision 1.5 2010/04/01 03:10:58 gtkwave | |
778 | * time warp fixes | |
779 | * | |
780 | * Revision 1.4 2010/03/31 21:40:53 gtkwave | |
781 | * duplicate removal of VectorEnt structs at same time | |
782 | * | |
783 | * Revision 1.3 2010/03/31 19:38:56 gtkwave | |
784 | * added missing timescale multiplier | |
785 | * | |
786 | * Revision 1.2 2010/03/31 19:31:03 gtkwave | |
787 | * hardening of times in ttranslate received from client | |
788 | * | |
789 | * Revision 1.1 2010/03/31 15:42:47 gtkwave | |
790 | * added preliminary transaction filter support | |
791 | * | |
792 | */ |
0 | /* | |
1 | * Copyright (c) Tony Bybell 2010. | |
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 "globals.h" | |
10 | ||
11 | #ifndef WAVE_TTRANSLATE_H | |
12 | #define WAVE_TTRANSLATE_H | |
13 | ||
14 | #include <stdio.h> | |
15 | #include <string.h> | |
16 | #include <ctype.h> | |
17 | #include "fgetdynamic.h" | |
18 | #include "debug.h" | |
19 | ||
20 | #define TTRANS_FILTER_MAX (128) | |
21 | ||
22 | ||
23 | void ttrans_searchbox(char *title); | |
24 | void init_ttrans_data(void); | |
25 | void install_ttrans_filter(int which); | |
26 | void set_current_translate_ttrans(char *name); | |
27 | void remove_all_ttrans_filters(void); | |
28 | ||
29 | #endif | |
30 | ||
31 | /* | |
32 | * $Id: ttranslate.h,v 1.1 2010/03/31 15:42:47 gtkwave Exp $ | |
33 | * $Log: ttranslate.h,v $ | |
34 | * Revision 1.1 2010/03/31 15:42:47 gtkwave | |
35 | * added preliminary transaction filter support | |
36 | * | |
37 | */ | |
38 |
2350 | 2350 | bptr bts = b->bits; |
2351 | 2351 | int i; |
2352 | 2352 | |
2353 | for(i=0;i<bts->nbits;i++) | |
2353 | for(i=0;i<bts->nnbits;i++) | |
2354 | 2354 | { |
2355 | 2355 | if(!bts->nodes[i]->harray) |
2356 | 2356 | { |
2379 | 2379 | int i; |
2380 | 2380 | bvptr b2; |
2381 | 2381 | |
2382 | for(i=0;i<bts->nbits;i++) | |
2382 | for(i=0;i<bts->nnbits;i++) | |
2383 | 2383 | { |
2384 | 2384 | if(!bts->nodes[i]->harray) |
2385 | 2385 | { |
2402 | 2402 | t->n.vec = b2; |
2403 | 2403 | b2->bits=bts; |
2404 | 2404 | |
2405 | free_2(b2->name); | |
2406 | b2->name = b->name; | |
2405 | free_2(b2->bvname); | |
2406 | b2->bvname = b->bvname; | |
2407 | 2407 | |
2408 | 2408 | for(i=0;i<b->numregions;i++) |
2409 | 2409 | { |
2508 | 2508 | } |
2509 | 2509 | |
2510 | 2510 | /* |
2511 | * $Id: vcd_partial.c,v 1.32 2010/03/18 17:12:37 gtkwave Exp $ | |
2511 | * $Id: vcd_partial.c,v 1.34 2010/04/04 19:09:57 gtkwave Exp $ | |
2512 | 2512 | * $Log: vcd_partial.c,v $ |
2513 | * Revision 1.34 2010/04/04 19:09:57 gtkwave | |
2514 | * rename name->bvname in struct BitVector for easier grep tracking | |
2515 | * | |
2516 | * Revision 1.33 2010/03/31 15:42:47 gtkwave | |
2517 | * added preliminary transaction filter support | |
2518 | * | |
2513 | 2519 | * Revision 1.32 2010/03/18 17:12:37 gtkwave |
2514 | 2520 | * pedantic warning cleanups |
2515 | 2521 | * |
48 | 48 | /* |
49 | 49 | * generate a vcd identifier for a given facindx |
50 | 50 | */ |
51 | static char *vcdid(int value) | |
51 | static char *vcdid(int value, int export_typ) | |
52 | 52 | { |
53 | 53 | char *pnt = GLOBALS->buf_vcd_saver_c_3; |
54 | 54 | int i, vmod; |
55 | 55 | |
56 | value++; | |
57 | for(i=0;;i++) | |
58 | { | |
59 | if((vmod = (value % 94))) | |
60 | { | |
61 | *(pnt++) = (char)(vmod + 32); | |
62 | } | |
63 | else | |
64 | { | |
65 | *(pnt++) = '~'; value -= 94; | |
66 | } | |
67 | value = value / 94; | |
68 | if(!value) { break; } | |
69 | } | |
70 | ||
71 | *pnt = 0; | |
56 | if(export_typ != WAVE_EXPORT_TRANS) | |
57 | { | |
58 | value++; | |
59 | for(i=0;;i++) | |
60 | { | |
61 | if((vmod = (value % 94))) | |
62 | { | |
63 | *(pnt++) = (char)(vmod + 32); | |
64 | } | |
65 | else | |
66 | { | |
67 | *(pnt++) = '~'; value -= 94; | |
68 | } | |
69 | value = value / 94; | |
70 | if(!value) { break; } | |
71 | } | |
72 | ||
73 | *pnt = 0; | |
74 | } | |
75 | else | |
76 | { | |
77 | sprintf(pnt, "%d", value); | |
78 | } | |
79 | ||
72 | 80 | return(GLOBALS->buf_vcd_saver_c_3); |
73 | 81 | } |
74 | 82 | |
75 | /* | |
76 | static char *vcdid(int value) | |
77 | { | |
78 | int i; | |
79 | ||
80 | for(i=0;i<15;i++) | |
81 | { | |
82 | GLOBALS->buf_vcd_saver_c_3[i]=(char)((value%94)+33); | |
83 | value=value/94; | |
84 | if(!value) {GLOBALS->buf_vcd_saver_c_3[i+1]=0; break;} | |
85 | } | |
86 | ||
87 | return(GLOBALS->buf_vcd_saver_c_3); | |
88 | } | |
89 | */ | |
90 | 83 | |
91 | 84 | static char *vcd_truncate_bitvec(char *s) |
92 | 85 | { |
323 | 316 | /* |
324 | 317 | * mainline |
325 | 318 | */ |
326 | int save_nodes_to_export(const char *fname, int export_typ) | |
327 | { | |
328 | Trptr t = GLOBALS->traces.first; | |
319 | int save_nodes_to_export_generic(FILE *trans_file, Trptr trans_head, const char *fname, int export_typ) | |
320 | { | |
321 | Trptr t = trans_head ? trans_head : GLOBALS->traces.first; | |
329 | 322 | int nodecnt = 0; |
330 | 323 | vcdsav_Tree *vt = NULL; |
331 | 324 | vcdsav_Tree **hp_clone = GLOBALS->hp_vcd_saver_c_1; |
341 | 334 | char *row_data = NULL; |
342 | 335 | struct lt_trace *lt = NULL; |
343 | 336 | int lxt = (export_typ == WAVE_EXPORT_LXT); |
337 | int seqn = 0; | |
344 | 338 | |
345 | 339 | if(export_typ == WAVE_EXPORT_TIM) |
346 | 340 | { |
358 | 352 | } |
359 | 353 | else |
360 | 354 | { |
361 | GLOBALS->f_vcd_saver_c_1 = fopen(fname, "wb"); | |
355 | if(export_typ != WAVE_EXPORT_TRANS) | |
356 | { | |
357 | GLOBALS->f_vcd_saver_c_1 = fopen(fname, "wb"); | |
358 | } | |
359 | else | |
360 | { | |
361 | GLOBALS->f_vcd_saver_c_1 = trans_file; | |
362 | } | |
363 | ||
362 | 364 | if(!GLOBALS->f_vcd_saver_c_1) |
363 | 365 | { |
364 | 366 | return(VCDSAV_FILE_ERROR); |
396 | 398 | bptr bt = b->bits; |
397 | 399 | if(bt) |
398 | 400 | { |
399 | for(i=0;i<bt->nbits;i++) | |
401 | for(i=0;i<bt->nnbits;i++) | |
400 | 402 | { |
401 | 403 | if(bt->nodes[i]) |
402 | 404 | { |
422 | 424 | } |
423 | 425 | } |
424 | 426 | |
427 | ||
428 | if(export_typ == WAVE_EXPORT_TRANS) | |
429 | { | |
430 | break; | |
431 | } | |
432 | ||
425 | 433 | if(!strace_append) |
426 | 434 | { |
427 | 435 | t=t->t_next; |
485 | 493 | } |
486 | 494 | else |
487 | 495 | { |
488 | time(&walltime); | |
489 | fprintf(GLOBALS->f_vcd_saver_c_1, "$date\n"); | |
490 | fprintf(GLOBALS->f_vcd_saver_c_1, "\t%s",asctime(localtime(&walltime))); | |
491 | fprintf(GLOBALS->f_vcd_saver_c_1, "$end\n"); | |
492 | fprintf(GLOBALS->f_vcd_saver_c_1, "$version\n\t"WAVE_VERSION_INFO"\n$end\n"); | |
493 | fprintf(GLOBALS->f_vcd_saver_c_1, "$timescale\n\t%d%c%s\n$end\n", (int)GLOBALS->time_scale, GLOBALS->time_dimension, (GLOBALS->time_dimension=='s') ? "" : "s"); | |
494 | } | |
496 | if(export_typ != WAVE_EXPORT_TRANS) | |
497 | { | |
498 | time(&walltime); | |
499 | fprintf(GLOBALS->f_vcd_saver_c_1, "$date\n"); | |
500 | fprintf(GLOBALS->f_vcd_saver_c_1, "\t%s",asctime(localtime(&walltime))); | |
501 | fprintf(GLOBALS->f_vcd_saver_c_1, "$end\n"); | |
502 | fprintf(GLOBALS->f_vcd_saver_c_1, "$version\n\t"WAVE_VERSION_INFO"\n$end\n"); | |
503 | fprintf(GLOBALS->f_vcd_saver_c_1, "$timescale\n\t%d%c%s\n$end\n", (int)GLOBALS->time_scale, GLOBALS->time_dimension, (GLOBALS->time_dimension=='s') ? "" : "s"); | |
504 | } | |
505 | else | |
506 | { | |
507 | fprintf(GLOBALS->f_vcd_saver_c_1, "$comment data_start %p $end\n", trans_head); /* arbitrary hex identifier */ | |
508 | fprintf(GLOBALS->f_vcd_saver_c_1, "$comment name %s $end\n", trans_head->name ? trans_head->name : "UNKNOWN"); | |
509 | fprintf(GLOBALS->f_vcd_saver_c_1, "$timescale %d%c%s $end\n", (int)GLOBALS->time_scale, GLOBALS->time_dimension, (GLOBALS->time_dimension=='s') ? "" : "s"); | |
510 | fprintf(GLOBALS->f_vcd_saver_c_1, "$comment min_time "TTFormat" $end\n", GLOBALS->min_time / GLOBALS->time_scale); | |
511 | fprintf(GLOBALS->f_vcd_saver_c_1, "$comment max_time "TTFormat" $end\n", GLOBALS->max_time / GLOBALS->time_scale); | |
512 | } | |
513 | } | |
514 | ||
515 | if(export_typ == WAVE_EXPORT_TRANS) | |
516 | { | |
517 | fprintf(GLOBALS->f_vcd_saver_c_1, "$comment max_seqn %d $end\n", nodecnt); | |
518 | } | |
495 | 519 | |
496 | 520 | /* write out netnames here ... */ |
497 | 521 | hp_clone = GLOBALS->hp_vcd_saver_c_1 = calloc_2(nodecnt, sizeof(vcdsav_Tree *)); |
503 | 527 | char *hname = hier_decompress_flagged(GLOBALS->hp_vcd_saver_c_1[i]->item->nname, &was_packed); |
504 | 528 | char *netname = lxt ? hname : output_hier(hname); |
505 | 529 | |
530 | if(export_typ == WAVE_EXPORT_TRANS) | |
531 | { | |
532 | fprintf(GLOBALS->f_vcd_saver_c_1, "$comment seqn %d %s $end\n", GLOBALS->hp_vcd_saver_c_1[i]->val, hname); | |
533 | } | |
534 | ||
506 | 535 | if(GLOBALS->hp_vcd_saver_c_1[i]->flags & (HIST_REAL|HIST_STRING)) |
507 | 536 | { |
508 | 537 | if(lxt) |
511 | 540 | } |
512 | 541 | else |
513 | 542 | { |
514 | fprintf(GLOBALS->f_vcd_saver_c_1, "$var real 1 %s %s $end\n", vcdid(GLOBALS->hp_vcd_saver_c_1[i]->val), netname); | |
543 | fprintf(GLOBALS->f_vcd_saver_c_1, "$var real 1 %s %s $end\n", vcdid(GLOBALS->hp_vcd_saver_c_1[i]->val, export_typ), netname); | |
515 | 544 | } |
516 | 545 | } |
517 | 546 | else |
537 | 566 | } |
538 | 567 | else |
539 | 568 | { |
540 | fprintf(GLOBALS->f_vcd_saver_c_1, "$var wire 1 %s %s $end\n", vcdid(GLOBALS->hp_vcd_saver_c_1[i]->val), netname); | |
569 | fprintf(GLOBALS->f_vcd_saver_c_1, "$var wire 1 %s %s $end\n", vcdid(GLOBALS->hp_vcd_saver_c_1[i]->val, export_typ), netname); | |
541 | 570 | } |
542 | 571 | } |
543 | 572 | else |
549 | 578 | } |
550 | 579 | else |
551 | 580 | { |
552 | fprintf(GLOBALS->f_vcd_saver_c_1, "$var wire %d %s %s $end\n", len, vcdid(GLOBALS->hp_vcd_saver_c_1[i]->val), netname); | |
581 | fprintf(GLOBALS->f_vcd_saver_c_1, "$var wire %d %s %s $end\n", len, vcdid(GLOBALS->hp_vcd_saver_c_1[i]->val, export_typ), netname); | |
553 | 582 | } |
554 | 583 | GLOBALS->hp_vcd_saver_c_1[i]->len = len; |
555 | 584 | if(len > max_len) max_len = len; |
620 | 649 | } |
621 | 650 | else |
622 | 651 | { |
623 | fprintf(GLOBALS->f_vcd_saver_c_1, "s%s %s\n", vec, vcdid(GLOBALS->hp_vcd_saver_c_1[0]->val)); | |
652 | fprintf(GLOBALS->f_vcd_saver_c_1, "s%s %s\n", vec, vcdid(GLOBALS->hp_vcd_saver_c_1[0]->val, export_typ)); | |
624 | 653 | } |
625 | 654 | } |
626 | 655 | else |
643 | 672 | } |
644 | 673 | else |
645 | 674 | { |
646 | fprintf(GLOBALS->f_vcd_saver_c_1, "r%.16g %s\n", value, vcdid(GLOBALS->hp_vcd_saver_c_1[0]->val)); | |
675 | fprintf(GLOBALS->f_vcd_saver_c_1, "r%.16g %s\n", value, vcdid(GLOBALS->hp_vcd_saver_c_1[0]->val, export_typ)); | |
647 | 676 | } |
648 | 677 | } |
649 | 678 | } |
672 | 701 | } |
673 | 702 | else |
674 | 703 | { |
675 | fprintf(GLOBALS->f_vcd_saver_c_1, "b%s %s\n", vcd_truncate_bitvec(row_data), vcdid(GLOBALS->hp_vcd_saver_c_1[0]->val)); | |
704 | fprintf(GLOBALS->f_vcd_saver_c_1, "b%s %s\n", vcd_truncate_bitvec(row_data), vcdid(GLOBALS->hp_vcd_saver_c_1[0]->val, export_typ)); | |
676 | 705 | } |
677 | 706 | } |
678 | 707 | else |
686 | 715 | } |
687 | 716 | else |
688 | 717 | { |
689 | fprintf(GLOBALS->f_vcd_saver_c_1, "%c%s\n", analyzer_demang(lxt, GLOBALS->hp_vcd_saver_c_1[0]->hist->v.h_val), vcdid(GLOBALS->hp_vcd_saver_c_1[0]->val)); | |
718 | fprintf(GLOBALS->f_vcd_saver_c_1, "%c%s\n", analyzer_demang(lxt, GLOBALS->hp_vcd_saver_c_1[0]->hist->v.h_val), vcdid(GLOBALS->hp_vcd_saver_c_1[0]->val, export_typ)); | |
690 | 719 | } |
691 | 720 | } |
692 | 721 | } |
721 | 750 | } |
722 | 751 | else |
723 | 752 | { |
724 | fclose(GLOBALS->f_vcd_saver_c_1); GLOBALS->f_vcd_saver_c_1 = NULL; | |
753 | if(export_typ != WAVE_EXPORT_TRANS) | |
754 | { | |
755 | fclose(GLOBALS->f_vcd_saver_c_1); | |
756 | } | |
757 | else | |
758 | { | |
759 | fprintf(GLOBALS->f_vcd_saver_c_1, "$comment data_end %p $end\n", trans_head); /* arbitrary hex identifier */ | |
760 | fflush(GLOBALS->f_vcd_saver_c_1); | |
761 | } | |
762 | ||
763 | GLOBALS->f_vcd_saver_c_1 = NULL; | |
725 | 764 | } |
726 | 765 | |
727 | 766 | return(VCDSAV_OK); |
728 | 767 | } |
768 | ||
769 | ||
770 | ||
771 | int save_nodes_to_export(const char *fname, int export_typ) | |
772 | { | |
773 | return(save_nodes_to_export_generic(NULL, NULL, fname, export_typ)); | |
774 | } | |
775 | ||
776 | int save_nodes_to_trans(FILE *trans, Trptr t) | |
777 | { | |
778 | return(save_nodes_to_export_generic(trans, t, NULL, WAVE_EXPORT_TRANS)); | |
779 | } | |
780 | ||
729 | 781 | |
730 | 782 | /************************ scopenav ************************/ |
731 | 783 | |
1057 | 1109 | { |
1058 | 1110 | if(!(h->flags&HIST_STRING)) |
1059 | 1111 | { |
1060 | ascii=convert_ascii_real((double *)h->v.h_vector); | |
1112 | ascii=convert_ascii_real(t, (double *)h->v.h_vector); | |
1061 | 1113 | } |
1062 | 1114 | else |
1063 | 1115 | { |
1464 | 1516 | } |
1465 | 1517 | |
1466 | 1518 | /* |
1467 | * $Id: vcd_saver.c,v 1.13 2010/03/14 07:09:49 gtkwave Exp $ | |
1519 | * $Id: vcd_saver.c,v 1.16 2010/04/01 20:07:35 gtkwave Exp $ | |
1468 | 1520 | * $Log: vcd_saver.c,v $ |
1521 | * Revision 1.16 2010/04/01 20:07:35 gtkwave | |
1522 | * timescale multiplier fix for transactions | |
1523 | * | |
1524 | * Revision 1.15 2010/03/31 15:42:47 gtkwave | |
1525 | * added preliminary transaction filter support | |
1526 | * | |
1527 | * Revision 1.14 2010/03/24 23:05:10 gtkwave | |
1528 | * added RealToBits menu option | |
1529 | * | |
1469 | 1530 | * Revision 1.13 2010/03/14 07:09:49 gtkwave |
1470 | 1531 | * removed ExtNode and merged with Node |
1471 | 1532 | * |
14 | 14 | #include "vcd.h" |
15 | 15 | #include "strace.h" |
16 | 16 | |
17 | enum vcd_export_typ { WAVE_EXPORT_VCD, WAVE_EXPORT_LXT, WAVE_EXPORT_TIM }; | |
17 | enum vcd_export_typ { WAVE_EXPORT_VCD, WAVE_EXPORT_LXT, WAVE_EXPORT_TIM, WAVE_EXPORT_TRANS }; | |
18 | 18 | enum vcd_saver_rc { VCDSAV_OK, VCDSAV_EMPTY, VCDSAV_FILE_ERROR }; |
19 | 19 | enum vcd_saver_tr_datatype { VCDSAV_IS_BIN, VCDSAV_IS_HEX, VCDSAV_IS_TEXT }; |
20 | 20 | |
21 | 21 | int save_nodes_to_export(const char *fname, int export_typ); |
22 | 22 | int do_timfile_save(const char *fname); |
23 | int save_nodes_to_trans(FILE *trans, Trptr t); | |
23 | 24 | |
24 | 25 | /* from helpers/scopenav.c */ |
25 | 26 | extern void free_hier(void); |
28 | 29 | #endif |
29 | 30 | |
30 | 31 | /* |
31 | * $Id: vcd_saver.h,v 1.4 2008/12/06 19:55:53 gtkwave Exp $ | |
32 | * $Id: vcd_saver.h,v 1.5 2010/03/31 15:42:47 gtkwave Exp $ | |
32 | 33 | * $Log: vcd_saver.h,v $ |
34 | * Revision 1.5 2010/03/31 15:42:47 gtkwave | |
35 | * added preliminary transaction filter support | |
36 | * | |
33 | 37 | * Revision 1.4 2008/12/06 19:55:53 gtkwave |
34 | 38 | * more adds to the timinganalyzer output writer |
35 | 39 | * |
11 | 11 | #ifndef WAVE_VZTRDR_H |
12 | 12 | #define WAVE_VZTRDR_H |
13 | 13 | |
14 | #ifndef _MSC_VER | |
14 | #ifdef HAVE_INTTYPES_H | |
15 | 15 | #include <inttypes.h> |
16 | 16 | #endif |
17 | 17 | |
26 | 26 | #endif |
27 | 27 | |
28 | 28 | /* |
29 | * $Id: vzt.h,v 1.2 2007/08/26 21:35:50 gtkwave Exp $ | |
29 | * $Id: vzt.h,v 1.3 2010/04/27 23:10:56 gtkwave Exp $ | |
30 | 30 | * $Log: vzt.h,v $ |
31 | * Revision 1.3 2010/04/27 23:10:56 gtkwave | |
32 | * made inttype.h inclusion conditional | |
33 | * | |
31 | 34 | * Revision 1.2 2007/08/26 21:35:50 gtkwave |
32 | 35 | * integrated global context management from SystemOfCode2007 branch |
33 | 36 | * |
181 | 181 | TimeType closest_named = MAX_HISTENT_TIME; |
182 | 182 | int closest_which = -1; |
183 | 183 | gint xold = x, yold = y; |
184 | TraceEnt t_trans; | |
184 | 185 | |
185 | 186 | if(!GLOBALS->cursor_snap) return(marker); |
186 | 187 | |
227 | 228 | } |
228 | 229 | |
229 | 230 | if(!t) goto bot; |
230 | if((t->flags&(TR_BLANK|TR_EXCLUDE))) | |
231 | if((t->flags&(/*TR_BLANK|*/TR_EXCLUDE))) /* TR_BLANK removed because of transaction handling below... */ | |
231 | 232 | { |
232 | 233 | t = NULL; |
233 | 234 | goto bot; |
234 | 235 | } |
235 | 236 | |
236 | if(t->flags & TR_ANALOG_BLANK_STRETCH) /* seek to real analog trace is present... */ | |
237 | if(t->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH)) /* seek to real xact trace if present... */ | |
238 | { | |
239 | Trptr tscan = t; | |
240 | int bcnt = 0; | |
241 | while((tscan) && (tscan = GivePrevTrace(tscan))) | |
242 | { | |
243 | if(!(tscan->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH))) | |
244 | { | |
245 | if(tscan->flags & TR_TTRANSLATED) | |
246 | { | |
247 | break; /* found it */ | |
248 | } | |
249 | else | |
250 | { | |
251 | tscan = NULL; | |
252 | } | |
253 | } | |
254 | else | |
255 | { | |
256 | bcnt++; /* bcnt is number of blank traces */ | |
257 | } | |
258 | } | |
259 | ||
260 | if((tscan)&&(tscan->vector)) | |
261 | { | |
262 | bvptr bv = tscan->n.vec; | |
263 | do | |
264 | { | |
265 | bv = bv->transaction_chain; /* correlate to blank trace */ | |
266 | } while(bv && (bcnt--)); | |
267 | if(bv) | |
268 | { | |
269 | memcpy(&t_trans, tscan, sizeof(TraceEnt)); /* substitute into a synthetic trace */ | |
270 | t_trans.n.vec = bv; | |
271 | t_trans.vector = 1; | |
272 | ||
273 | t_trans.name = bv->bvname; | |
274 | if(GLOBALS->hier_max_level) | |
275 | t_trans.name = hier_extract(t_trans.name, GLOBALS->hier_max_level); | |
276 | ||
277 | t = &t_trans; | |
278 | goto process_trace; | |
279 | } | |
280 | } | |
281 | } | |
282 | ||
283 | if((t->flags&TR_BLANK)) | |
284 | { | |
285 | t = NULL; | |
286 | goto bot; | |
287 | } | |
288 | ||
289 | if(t->flags & TR_ANALOG_BLANK_STRETCH) /* seek to real analog trace if present... */ | |
237 | 290 | { |
238 | 291 | while((t) && (t = GivePrevTrace(t))) |
239 | 292 | { |
252 | 305 | } |
253 | 306 | if(!t) goto bot; |
254 | 307 | |
308 | process_trace: | |
255 | 309 | if(t->vector) |
256 | 310 | { |
257 | 311 | vptr v = bsearch_vector(t->n.vec, marker - t->shift); |
1324 | 1378 | */ |
1325 | 1379 | void force_screengrab_gcs(void) |
1326 | 1380 | { |
1381 | GLOBALS->black_and_white = 1; | |
1382 | ||
1327 | 1383 | GLOBALS->gc_ltgray= GLOBALS->gc_white ; |
1328 | 1384 | GLOBALS->gc_normal= GLOBALS->gc_white ; |
1329 | 1385 | GLOBALS->gc_mdgray= GLOBALS->gc_white ; |
1361 | 1417 | |
1362 | 1418 | void force_normal_gcs(void) |
1363 | 1419 | { |
1420 | GLOBALS->black_and_white = 0; | |
1421 | ||
1364 | 1422 | GLOBALS->gc_ltgray = GLOBALS->gccache_ltgray ; |
1365 | 1423 | GLOBALS->gc_normal = GLOBALS->gccache_normal ; |
1366 | 1424 | GLOBALS->gc_mdgray = GLOBALS->gccache_mdgray ; |
1562 | 1620 | } |
1563 | 1621 | |
1564 | 1622 | |
1565 | void populateBuffer (Trptr t, char* buf) | |
1623 | void populateBuffer (Trptr t, char *altname, char* buf) | |
1566 | 1624 | { |
1567 | 1625 | char* ptr = buf; |
1626 | char *tname = altname ? altname : t->name; | |
1568 | 1627 | |
1569 | 1628 | if (HasWave(t)) |
1570 | 1629 | { |
1571 | if (t->name) | |
1572 | { | |
1573 | strcpy(ptr, t->name); | |
1630 | if (tname) | |
1631 | { | |
1632 | strcpy(ptr, tname); | |
1574 | 1633 | ptr = ptr + strlen(ptr); |
1575 | 1634 | |
1576 | if((t->name)&&(t->shift)) | |
1635 | if((tname)&&(t->shift)) | |
1577 | 1636 | { |
1578 | 1637 | ptr[0]='`'; |
1579 | 1638 | reformat_time(ptr+1, t->shift, GLOBALS->time_dimension); |
1604 | 1663 | } |
1605 | 1664 | else |
1606 | 1665 | { |
1607 | if (t->name) | |
1666 | if (tname) | |
1608 | 1667 | { |
1609 | 1668 | |
1610 | 1669 | if (IsGroupEnd(t)) |
1613 | 1672 | ptr = ptr + strlen(ptr); |
1614 | 1673 | } |
1615 | 1674 | |
1616 | strcpy(ptr, t->name); | |
1675 | strcpy(ptr, tname); | |
1617 | 1676 | ptr = ptr + strlen(ptr); |
1618 | 1677 | |
1619 | 1678 | if (IsGroupBegin(t)) |
1638 | 1697 | { |
1639 | 1698 | int texty, liney; |
1640 | 1699 | int retval; |
1641 | char buf[256]; | |
1700 | char buf[2048]; | |
1642 | 1701 | GdkGC *clr_comment; |
1643 | 1702 | GdkGC *clr_group; |
1644 | 1703 | GdkGC *clr_shadowed; |
1646 | 1705 | GdkGC* bg_color; |
1647 | 1706 | GdkGC* text_color; |
1648 | 1707 | unsigned left_justify; |
1649 | ||
1708 | char *subname = NULL; | |
1709 | bvptr bv = NULL; | |
1710 | ||
1650 | 1711 | buf[0] = 0; |
1651 | 1712 | |
1652 | populateBuffer(t, buf); | |
1713 | if(t->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH)) /* seek to real xact trace if present... */ | |
1714 | { | |
1715 | Trptr tscan = t; | |
1716 | int bcnt = 0; | |
1717 | while((tscan) && (tscan = GivePrevTrace(tscan))) | |
1718 | { | |
1719 | if(!(tscan->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH))) | |
1720 | { | |
1721 | if(tscan->flags & TR_TTRANSLATED) | |
1722 | { | |
1723 | break; /* found it */ | |
1724 | } | |
1725 | else | |
1726 | { | |
1727 | tscan = NULL; | |
1728 | } | |
1729 | } | |
1730 | else | |
1731 | { | |
1732 | bcnt++; /* bcnt is number of blank traces */ | |
1733 | } | |
1734 | } | |
1735 | ||
1736 | if((tscan)&&(tscan->vector)) | |
1737 | { | |
1738 | bv = tscan->n.vec; | |
1739 | do | |
1740 | { | |
1741 | bv = bv->transaction_chain; /* correlate to blank trace */ | |
1742 | } while(bv && (bcnt--)); | |
1743 | if(bv) | |
1744 | { | |
1745 | subname = bv->bvname; | |
1746 | if(GLOBALS->hier_max_level) | |
1747 | subname = hier_extract(subname, GLOBALS->hier_max_level); | |
1748 | } | |
1749 | } | |
1750 | } | |
1751 | ||
1752 | populateBuffer(t, subname, buf); | |
1653 | 1753 | |
1654 | 1754 | clr_comment = GLOBALS->gc_brkred; |
1655 | 1755 | clr_group = GLOBALS->gc_gmstrd; |
1695 | 1795 | 0, liney, |
1696 | 1796 | GLOBALS->signal_fill_width-1, liney); |
1697 | 1797 | |
1698 | if(t->name) | |
1798 | if((t->name)||(subname)) | |
1699 | 1799 | { |
1700 | 1800 | font_engine_draw_string(GLOBALS->signalpixmap, |
1701 | 1801 | GLOBALS->signalfont, |
1708 | 1808 | |
1709 | 1809 | } |
1710 | 1810 | |
1711 | if (HasWave(t)) | |
1811 | if (HasWave(t) || bv) | |
1712 | 1812 | { |
1713 | 1813 | if((t->asciivalue)&&(!(t->flags&TR_EXCLUDE))) |
1714 | 1814 | font_engine_draw_string(GLOBALS->signalpixmap, |
1730 | 1830 | Trptr t; |
1731 | 1831 | int len=0,maxlen=0; |
1732 | 1832 | int vlen=0, vmaxlen=0; |
1733 | char buf[256]; | |
1833 | char buf[2048]; | |
1734 | 1834 | char dirty_kick; |
1835 | bvptr bv; | |
1836 | Trptr tscan; | |
1735 | 1837 | |
1736 | 1838 | DEBUG(printf("signalwindow_width_dirty: %d\n",signalwindow_width_dirty)); |
1737 | 1839 | |
1745 | 1847 | |
1746 | 1848 | while(t) |
1747 | 1849 | { |
1748 | ||
1749 | populateBuffer(t, buf); | |
1750 | if(t->flags&(TR_BLANK|TR_ANALOG_BLANK_STRETCH)) /* for "comment" style blank traces */ | |
1850 | char *subname = NULL; | |
1851 | bv = NULL; | |
1852 | tscan = NULL; | |
1853 | ||
1854 | if(t->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH)) /* seek to real xact trace if present... */ | |
1855 | { | |
1856 | tscan = t; | |
1857 | int bcnt = 0; | |
1858 | while((tscan) && (tscan = GivePrevTrace(tscan))) | |
1859 | { | |
1860 | if(!(tscan->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH))) | |
1861 | { | |
1862 | if(tscan->flags & TR_TTRANSLATED) | |
1863 | { | |
1864 | break; /* found it */ | |
1865 | } | |
1866 | else | |
1867 | { | |
1868 | tscan = NULL; | |
1869 | } | |
1870 | } | |
1871 | else | |
1872 | { | |
1873 | bcnt++; /* bcnt is number of blank traces */ | |
1874 | } | |
1875 | } | |
1876 | ||
1877 | if((tscan)&&(tscan->vector)) | |
1878 | { | |
1879 | bv = tscan->n.vec; | |
1880 | do | |
1881 | { | |
1882 | bv = bv->transaction_chain; /* correlate to blank trace */ | |
1883 | } while(bv && (bcnt--)); | |
1884 | if(bv) | |
1885 | { | |
1886 | subname = bv->bvname; | |
1887 | if(GLOBALS->hier_max_level) | |
1888 | subname = hier_extract(subname, GLOBALS->hier_max_level); | |
1889 | } | |
1890 | } | |
1891 | } | |
1892 | ||
1893 | populateBuffer(t, subname, buf); | |
1894 | ||
1895 | if(!bv && (t->flags&(TR_BLANK|TR_ANALOG_BLANK_STRETCH))) /* for "comment" style blank traces */ | |
1751 | 1896 | { |
1752 | if(t->name) | |
1897 | if(t->name || subname) | |
1753 | 1898 | { |
1754 | 1899 | len=font_engine_string_measure(GLOBALS->signalfont, buf); |
1755 | 1900 | if(len>maxlen) maxlen=len; |
1756 | 1901 | } |
1902 | ||
1903 | if(t->asciivalue) | |
1904 | { | |
1905 | free_2(t->asciivalue); t->asciivalue = NULL; | |
1906 | } | |
1757 | 1907 | t=GiveNextTrace(t); |
1758 | 1908 | } |
1759 | 1909 | else |
1760 | if(t->name) | |
1761 | { | |
1762 | ||
1910 | if(t->name || subname) | |
1911 | { | |
1763 | 1912 | len=font_engine_string_measure(GLOBALS->signalfont, buf); |
1764 | 1913 | if(len>maxlen) maxlen=len; |
1765 | 1914 | |
1766 | 1915 | if((GLOBALS->tims.marker!=-1)&&(!(t->flags&TR_EXCLUDE))) |
1767 | 1916 | { |
1768 | 1917 | t->asciitime=GLOBALS->tims.marker; |
1769 | if(t->asciivalue) free_2(t->asciivalue); | |
1770 | ||
1771 | if(t->vector) | |
1918 | if(t->asciivalue) { free_2(t->asciivalue); } t->asciivalue = NULL; | |
1919 | ||
1920 | if(bv || t->vector) | |
1772 | 1921 | { |
1773 | 1922 | char *str, *str2; |
1774 | 1923 | vptr v; |
1775 | ||
1776 | v=bsearch_vector(t->n.vec,GLOBALS->tims.marker); | |
1777 | str=convert_ascii(t,v); | |
1924 | Trptr ts; | |
1925 | TraceEnt t_temp; | |
1926 | ||
1927 | if(bv) | |
1928 | { | |
1929 | ts = &t_temp; | |
1930 | memcpy(ts, tscan, sizeof(TraceEnt)); | |
1931 | ts->vector = 1; | |
1932 | ts->n.vec = bv; | |
1933 | } | |
1934 | else | |
1935 | { | |
1936 | ts = t; | |
1937 | bv = t->n.vec; | |
1938 | } | |
1939 | ||
1940 | ||
1941 | v=bsearch_vector(bv, GLOBALS->tims.marker - ts->shift); | |
1942 | str=convert_ascii(ts,v); | |
1778 | 1943 | if(str) |
1779 | 1944 | { |
1780 | 1945 | str2=(char *)malloc_2(strlen(str)+2); |
1790 | 1955 | vlen=0; |
1791 | 1956 | t->asciivalue=NULL; |
1792 | 1957 | } |
1793 | ||
1794 | 1958 | } |
1795 | 1959 | else |
1796 | 1960 | { |
1797 | 1961 | char *str; |
1798 | 1962 | hptr h_ptr; |
1799 | if((h_ptr=bsearch_node(t->n.nd,GLOBALS->tims.marker))) | |
1963 | if((h_ptr=bsearch_node(t->n.nd,GLOBALS->tims.marker - t->shift))) | |
1800 | 1964 | { |
1801 | 1965 | if(!t->n.nd->extvals) |
1802 | 1966 | { |
1828 | 1992 | { |
1829 | 1993 | if(!(h_ptr->flags&HIST_STRING)) |
1830 | 1994 | { |
1831 | str=convert_ascii_real((double *)h_ptr->v.h_vector); | |
1995 | str=convert_ascii_real(t, (double *)h_ptr->v.h_vector); | |
1832 | 1996 | } |
1833 | 1997 | else |
1834 | 1998 | { |
1938 | 2102 | |
1939 | 2103 | void UpdateSigValue(Trptr t) |
1940 | 2104 | { |
2105 | bvptr bv = NULL; | |
2106 | Trptr tscan = NULL; | |
2107 | ||
1941 | 2108 | if(!t) return; |
1942 | 2109 | if((t->asciivalue)&&(t->asciitime==GLOBALS->tims.marker))return; |
1943 | 2110 | |
1944 | if((t->name)&&(!(t->flags&(TR_BLANK|TR_ANALOG_BLANK_STRETCH)))) | |
2111 | if(t->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH)) /* seek to real xact trace if present... */ | |
2112 | { | |
2113 | tscan = t; | |
2114 | int bcnt = 0; | |
2115 | while((tscan) && (tscan = GivePrevTrace(tscan))) | |
2116 | { | |
2117 | if(!(tscan->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH))) | |
2118 | { | |
2119 | if(tscan->flags & TR_TTRANSLATED) | |
2120 | { | |
2121 | break; /* found it */ | |
2122 | } | |
2123 | else | |
2124 | { | |
2125 | tscan = NULL; | |
2126 | } | |
2127 | } | |
2128 | else | |
2129 | { | |
2130 | bcnt++; /* bcnt is number of blank traces */ | |
2131 | } | |
2132 | } | |
2133 | ||
2134 | if((tscan)&&(tscan->vector)) | |
2135 | { | |
2136 | bv = tscan->n.vec; | |
2137 | do | |
2138 | { | |
2139 | bv = bv->transaction_chain; /* correlate to blank trace */ | |
2140 | } while(bv && (bcnt--)); | |
2141 | if(bv) | |
2142 | { | |
2143 | /* nothing, we just want to set bv */ | |
2144 | } | |
2145 | } | |
2146 | } | |
2147 | ||
2148 | ||
2149 | if((t->name || bv)&&(bv || !(t->flags&(TR_BLANK|TR_ANALOG_BLANK_STRETCH)))) | |
1945 | 2150 | { |
1946 | 2151 | GLOBALS->shift_timebase=t->shift; |
1947 | 2152 | DEBUG(printf("UpdateSigValue: %s\n",t->name)); |
1951 | 2156 | t->asciitime=GLOBALS->tims.marker; |
1952 | 2157 | if(t->asciivalue) free_2(t->asciivalue); |
1953 | 2158 | |
1954 | if(t->vector) | |
2159 | if(bv || t->vector) | |
1955 | 2160 | { |
1956 | 2161 | char *str, *str2; |
1957 | 2162 | vptr v; |
1958 | ||
1959 | v=bsearch_vector(t->n.vec,GLOBALS->tims.marker); | |
1960 | str=convert_ascii(t,v); | |
2163 | Trptr ts; | |
2164 | TraceEnt t_temp; | |
2165 | ||
2166 | if(bv) | |
2167 | { | |
2168 | ts = &t_temp; | |
2169 | memcpy(ts, tscan, sizeof(TraceEnt)); | |
2170 | ts->vector = 1; | |
2171 | ts->n.vec = bv; | |
2172 | } | |
2173 | else | |
2174 | { | |
2175 | ts = t; | |
2176 | bv = t->n.vec; | |
2177 | } | |
2178 | ||
2179 | v=bsearch_vector(bv,GLOBALS->tims.marker - ts->shift); | |
2180 | str=convert_ascii(ts,v); | |
1961 | 2181 | if(str) |
1962 | 2182 | { |
1963 | 2183 | str2=(char *)malloc_2(strlen(str)+2); |
1971 | 2191 | { |
1972 | 2192 | t->asciivalue=NULL; |
1973 | 2193 | } |
1974 | ||
1975 | 2194 | } |
1976 | 2195 | else |
1977 | 2196 | { |
1978 | 2197 | char *str; |
1979 | 2198 | hptr h_ptr; |
1980 | if((h_ptr=bsearch_node(t->n.nd,GLOBALS->tims.marker))) | |
2199 | if((h_ptr=bsearch_node(t->n.nd,GLOBALS->tims.marker - t->shift))) | |
1981 | 2200 | { |
1982 | 2201 | if(!t->n.nd->extvals) |
1983 | 2202 | { |
2007 | 2226 | { |
2008 | 2227 | if(!(h_ptr->flags&HIST_STRING)) |
2009 | 2228 | { |
2010 | str=convert_ascii_real((double *)h_ptr->v.h_vector); | |
2229 | str=convert_ascii_real(t, (double *)h_ptr->v.h_vector); | |
2011 | 2230 | } |
2012 | 2231 | else |
2013 | 2232 | { |
2292 | 2511 | |
2293 | 2512 | if(GLOBALS->topmost_trace) |
2294 | 2513 | { |
2295 | Trptr t; | |
2514 | Trptr t = GLOBALS->topmost_trace; | |
2515 | Trptr tback = t; | |
2296 | 2516 | hptr h; |
2297 | 2517 | vptr v; |
2298 | int i, num_traces_displayable; | |
2518 | int i = 0, num_traces_displayable; | |
2519 | int iback = 0; | |
2299 | 2520 | |
2300 | 2521 | num_traces_displayable=GLOBALS->wavearea->allocation.height/(GLOBALS->fontheight); |
2301 | 2522 | num_traces_displayable--; /* for the time trace that is always there */ |
2302 | 2523 | |
2303 | t=GLOBALS->topmost_trace; | |
2304 | for(i=0;((i<num_traces_displayable)&&(t));i++) | |
2524 | /* ensure that transaction traces are visible even if the topmost traces are blanks */ | |
2525 | while(tback) | |
2526 | { | |
2527 | if(tback->flags&(TR_BLANK|TR_ANALOG_BLANK_STRETCH)) | |
2528 | { | |
2529 | tback = GivePrevTrace(tback); | |
2530 | iback--; | |
2531 | } | |
2532 | else if(tback->flags & TR_TTRANSLATED) | |
2533 | { | |
2534 | if(tback != t) | |
2535 | { | |
2536 | t = tback; | |
2537 | i = iback; | |
2538 | } | |
2539 | break; | |
2540 | } | |
2541 | else | |
2542 | { | |
2543 | break; | |
2544 | } | |
2545 | } | |
2546 | ||
2547 | for(;((i<num_traces_displayable)&&(t));i++) | |
2305 | 2548 | { |
2306 | 2549 | if(!(t->flags&(TR_EXCLUDE|TR_BLANK|TR_ANALOG_BLANK_STRETCH))) |
2307 | 2550 | { |
2308 | 2551 | GLOBALS->shift_timebase=t->shift; |
2309 | 2552 | if(!t->vector) |
2310 | 2553 | { |
2311 | h=bsearch_node(t->n.nd, GLOBALS->tims.start); | |
2554 | h=bsearch_node(t->n.nd, GLOBALS->tims.start - t->shift); | |
2312 | 2555 | DEBUG(printf("Bit Trace: %s, %s\n", t->name, t->n.nd->nname)); |
2313 | 2556 | DEBUG(printf("Start time: "TTFormat", Histent time: "TTFormat"\n", tims.start,(h->time+shift_timebase))); |
2314 | 2557 | |
2315 | 2558 | if(!t->n.nd->extvals) |
2316 | 2559 | { |
2317 | draw_hptr_trace(t,h,i,1,0); | |
2560 | if(i>=0) draw_hptr_trace(t,h,i,1,0); | |
2318 | 2561 | } |
2319 | 2562 | else |
2320 | 2563 | { |
2321 | draw_hptr_trace_vector(t,h,i); | |
2564 | if(i>=0) draw_hptr_trace_vector(t,h,i); | |
2322 | 2565 | } |
2323 | 2566 | } |
2324 | 2567 | else |
2325 | 2568 | { |
2326 | v=bsearch_vector(t->n.vec, GLOBALS->tims.start); | |
2327 | DEBUG(printf("Vector Trace: %s, %s\n", t->name, t->n.vec->name)); | |
2569 | Trptr t_orig, tn; | |
2570 | bvptr bv = t->n.vec; | |
2571 | ||
2572 | v=bsearch_vector(bv, GLOBALS->tims.start - t->shift); | |
2573 | DEBUG(printf("Vector Trace: %s, %s\n", t->name, bv->name)); | |
2328 | 2574 | DEBUG(printf("Start time: "TTFormat", Vectorent time: "TTFormat"\n", tims.start,(v->time+shift_timebase))); |
2329 | draw_vptr_trace(t,v,i); | |
2575 | if(i>=0) draw_vptr_trace(t,v,i); | |
2576 | ||
2577 | if((bv->transaction_chain) && (t->flags & TR_TTRANSLATED)) | |
2578 | { | |
2579 | t_orig = t; | |
2580 | for(;;) | |
2581 | { | |
2582 | tn = GiveNextTrace(t); | |
2583 | bv = bv->transaction_chain; | |
2584 | ||
2585 | if(bv && tn && (tn->flags & (TR_BLANK|TR_ANALOG_BLANK_STRETCH))) | |
2586 | { | |
2587 | i++; | |
2588 | if(i<num_traces_displayable) | |
2589 | { | |
2590 | v=bsearch_vector(bv, GLOBALS->tims.start - t->shift); | |
2591 | if(i>=0) draw_vptr_trace(t_orig,v,i); | |
2592 | t = tn; | |
2593 | continue; | |
2594 | } | |
2595 | } | |
2596 | break; | |
2597 | } | |
2598 | } | |
2330 | 2599 | } |
2331 | 2600 | } |
2332 | 2601 | else |
2347 | 2616 | } |
2348 | 2617 | } |
2349 | 2618 | |
2350 | draw_hptr_trace(NULL,NULL,i,0,kill_dodraw_grid); | |
2619 | if(i>=0) draw_hptr_trace(NULL,NULL,i,0,kill_dodraw_grid); | |
2351 | 2620 | } |
2352 | 2621 | t=GiveNextTrace(t); |
2622 | bot: 1; | |
2353 | 2623 | } |
2354 | 2624 | } |
2355 | 2625 | |
3052 | 3322 | } |
3053 | 3323 | |
3054 | 3324 | wave_gdk_draw_line_flush(GLOBALS->wavepixmap_wavewindow_c_1); |
3055 | ||
3056 | GLOBALS->tims.start+=GLOBALS->shift_timebase; | |
3057 | GLOBALS->tims.end+=GLOBALS->shift_timebase; | |
3058 | 3325 | } |
3059 | 3326 | |
3060 | 3327 | /* |
3111 | 3378 | } |
3112 | 3379 | |
3113 | 3380 | draw_hptr_trace_vector_analog(t, h, which, ext); |
3381 | GLOBALS->tims.start+=GLOBALS->shift_timebase; | |
3382 | GLOBALS->tims.end+=GLOBALS->shift_timebase; | |
3114 | 3383 | return; |
3115 | 3384 | } |
3116 | 3385 | |
3226 | 3495 | { |
3227 | 3496 | if(!(h->flags&HIST_STRING)) |
3228 | 3497 | { |
3229 | ascii=convert_ascii_real((double *)h->v.h_vector); | |
3498 | ascii=convert_ascii_real(t, (double *)h->v.h_vector); | |
3230 | 3499 | } |
3231 | 3500 | else |
3232 | 3501 | { |
3252 | 3521 | ascii2 = srch_for_color + 1; |
3253 | 3522 | if(GLOBALS->gc_back_wavewindow_c_1 != GLOBALS->gc_white) |
3254 | 3523 | { |
3255 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, cb, TRUE, _x0+1, _y1+1, width-1, (_y0-1) - (_y1+1) + 1); | |
3524 | if(!GLOBALS->black_and_white) gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, cb, TRUE, _x0+1, _y1+1, width-1, (_y0-1) - (_y1+1) + 1); | |
3256 | 3525 | } |
3257 | 3526 | GLOBALS->fill_in_smaller_rgb_areas_wavewindow_c_1 = 1; |
3258 | 3527 | } |
3289 | 3558 | { |
3290 | 3559 | if(!(h->flags&HIST_STRING)) |
3291 | 3560 | { |
3292 | ascii=convert_ascii_real((double *)h->v.h_vector); | |
3561 | ascii=convert_ascii_real(t, (double *)h->v.h_vector); | |
3293 | 3562 | } |
3294 | 3563 | else |
3295 | 3564 | { |
3315 | 3584 | ascii2 = srch_for_color + 1; |
3316 | 3585 | if(GLOBALS->gc_back_wavewindow_c_1 != GLOBALS->gc_white) |
3317 | 3586 | { |
3318 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, cb, TRUE, _x0, _y1+1, width, (_y0-1) - (_y1+1) + 1); | |
3587 | if(!GLOBALS->black_and_white) gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, cb, TRUE, _x0, _y1+1, width, (_y0-1) - (_y1+1) + 1); | |
3319 | 3588 | } |
3320 | 3589 | } |
3321 | 3590 | else |
3746 | 4015 | GLOBALS->tims.start-=GLOBALS->shift_timebase; |
3747 | 4016 | GLOBALS->tims.end-=GLOBALS->shift_timebase; |
3748 | 4017 | |
3749 | h=v; | |
3750 | 4018 | liney=((which+2)*GLOBALS->fontheight)-2; |
3751 | 4019 | _y1=((which+1)*GLOBALS->fontheight)+2; |
3752 | 4020 | _y0=liney-2; |
3764 | 4032 | gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, GLOBALS->gc_grid_wavewindow_c_1,(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); |
3765 | 4033 | } |
3766 | 4034 | } |
4035 | ||
4036 | h = v; | |
4037 | /* | |
4038 | if(t->flags & TR_TTRANSLATED) | |
4039 | { | |
4040 | traverse_vector_nodes(t); | |
4041 | h=v=bsearch_vector(t->n.vec, GLOBALS->tims.start); | |
4042 | } | |
4043 | else | |
4044 | { | |
4045 | h=v; | |
4046 | } | |
4047 | */ | |
3767 | 4048 | |
3768 | 4049 | if(t->flags & TR_ANALOGMASK) |
3769 | 4050 | { |
3784 | 4065 | } |
3785 | 4066 | |
3786 | 4067 | draw_vptr_trace_analog(t, v, which, ext); |
4068 | ||
4069 | GLOBALS->tims.start+=GLOBALS->shift_timebase; | |
4070 | GLOBALS->tims.end+=GLOBALS->shift_timebase; | |
3787 | 4071 | return; |
3788 | 4072 | } |
3789 | 4073 | |
3920 | 4204 | if(cb) |
3921 | 4205 | { |
3922 | 4206 | ascii2 = srch_for_color + 1; |
3923 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, cb, TRUE, _x0+1, _y1+1, width-1, (_y0-1) - (_y1+1) + 1); | |
4207 | if(!GLOBALS->black_and_white) gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, cb, TRUE, _x0+1, _y1+1, width-1, (_y0-1) - (_y1+1) + 1); | |
3924 | 4208 | GLOBALS->fill_in_smaller_rgb_areas_wavewindow_c_1 = 1; |
3925 | 4209 | } |
3926 | 4210 | else |
3969 | 4253 | ascii2 = srch_for_color + 1; |
3970 | 4254 | if(GLOBALS->gc_back_wavewindow_c_1 != GLOBALS->gc_white) |
3971 | 4255 | { |
3972 | gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, cb, TRUE, _x0, _y1+1, width, (_y0-1) - (_y1+1) + 1); | |
4256 | if(!GLOBALS->black_and_white) gdk_draw_rectangle(GLOBALS->wavepixmap_wavewindow_c_1, cb, TRUE, _x0, _y1+1, width, (_y0-1) - (_y1+1) + 1); | |
3973 | 4257 | } |
3974 | 4258 | } |
3975 | 4259 | else |
4007 | 4291 | } |
4008 | 4292 | |
4009 | 4293 | /* |
4010 | * $Id: wavewindow.c,v 1.61 2010/03/14 07:09:49 gtkwave Exp $ | |
4294 | * $Id: wavewindow.c,v 1.71 2010/04/15 20:38:51 gtkwave Exp $ | |
4011 | 4295 | * $Log: wavewindow.c,v $ |
4296 | * Revision 1.71 2010/04/15 20:38:51 gtkwave | |
4297 | * color usage fixes for black and white mode | |
4298 | * | |
4299 | * Revision 1.70 2010/04/14 18:45:38 gtkwave | |
4300 | * allow data values for secondary transaction traces | |
4301 | * | |
4302 | * Revision 1.69 2010/04/14 07:49:02 gtkwave | |
4303 | * updated mouseover handling | |
4304 | * | |
4305 | * Revision 1.68 2010/04/14 04:21:46 gtkwave | |
4306 | * update populateBuffer() usage | |
4307 | * | |
4308 | * Revision 1.67 2010/04/10 19:07:38 gtkwave | |
4309 | * support for mouseover with extension traces | |
4310 | * | |
4311 | * Revision 1.66 2010/04/10 03:32:00 gtkwave | |
4312 | * allow transaction traces to scroll off top of screen yet still be visible | |
4313 | * | |
4314 | * Revision 1.65 2010/04/09 20:52:33 gtkwave | |
4315 | * add extension traces for extension transactions | |
4316 | * | |
4317 | * Revision 1.64 2010/04/01 03:10:58 gtkwave | |
4318 | * time warp fixes | |
4319 | * | |
4320 | * Revision 1.63 2010/03/31 15:42:48 gtkwave | |
4321 | * added preliminary transaction filter support | |
4322 | * | |
4323 | * Revision 1.62 2010/03/24 23:05:10 gtkwave | |
4324 | * added RealToBits menu option | |
4325 | * | |
4012 | 4326 | * Revision 1.61 2010/03/14 07:09:49 gtkwave |
4013 | 4327 | * removed ExtNode and merged with Node |
4014 | 4328 | * |