Imported Upstream version 3.3.102
أحمد المحمودي (Ahmed El-Mahmoudy)
4 years ago
1708 | 1708 | of 10 roundoff errors. |
1709 | 1709 | Remove register keyword where applicable as is deprecated. |
1710 | 1710 | Added --saveonexit gtkwave command line option. |
1711 | 3.3.102 21sep19 Remove redundant TREE_VHDL_ST_PACKAGE from SST exclude. | |
1712 | Added addCommentTracesFromList tcl command from user patch. | |
1713 | Harden savefile loader for missing group start on vectors. | |
1714 | Preliminary VHDL support for wlf2vcd. | |
1715 | Add missing return value checks on mmap() in FST writer. |
0 | 0 | ########################################################################## |
1 | 1 | |
2 | GTKWave 3.3.101 Wave Viewer is Copyright (C) 1999-2019 Tony Bybell. | |
2 | GTKWave 3.3.102 Wave Viewer is Copyright (C) 1999-2019 Tony Bybell. | |
3 | 3 | Portions of GTKWave are Copyright (C) 1999-2019 Udi Finkelstein. |
4 | 4 | Context support is Copyright (C) 2007-2019 Kermin Elliott Fleming. |
5 | 5 | Trace group support is Copyright (C) 2009-2019 Donald Baltus. |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for gtkwave 3.3.101. | |
2 | # Generated by GNU Autoconf 2.69 for gtkwave 3.3.102. | |
3 | 3 | # |
4 | 4 | # Report bugs to <bybell@rocketmail.com>. |
5 | 5 | # |
579 | 579 | # Identity of this package. |
580 | 580 | PACKAGE_NAME='gtkwave' |
581 | 581 | PACKAGE_TARNAME='gtkwave' |
582 | PACKAGE_VERSION='3.3.101' | |
583 | PACKAGE_STRING='gtkwave 3.3.101' | |
582 | PACKAGE_VERSION='3.3.102' | |
583 | PACKAGE_STRING='gtkwave 3.3.102' | |
584 | 584 | PACKAGE_BUGREPORT='bybell@rocketmail.com' |
585 | 585 | PACKAGE_URL='' |
586 | 586 | |
1404 | 1404 | # Omit some internal or obsolete options to make the list less imposing. |
1405 | 1405 | # This message is too long to be a string in the A/UX 3.1 sh. |
1406 | 1406 | cat <<_ACEOF |
1407 | \`configure' configures gtkwave 3.3.101 to adapt to many kinds of systems. | |
1407 | \`configure' configures gtkwave 3.3.102 to adapt to many kinds of systems. | |
1408 | 1408 | |
1409 | 1409 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1410 | 1410 | |
1470 | 1470 | |
1471 | 1471 | if test -n "$ac_init_help"; then |
1472 | 1472 | case $ac_init_help in |
1473 | short | recursive ) echo "Configuration of gtkwave 3.3.101:";; | |
1473 | short | recursive ) echo "Configuration of gtkwave 3.3.102:";; | |
1474 | 1474 | esac |
1475 | 1475 | cat <<\_ACEOF |
1476 | 1476 | |
1629 | 1629 | test -n "$ac_init_help" && exit $ac_status |
1630 | 1630 | if $ac_init_version; then |
1631 | 1631 | cat <<\_ACEOF |
1632 | gtkwave configure 3.3.101 | |
1632 | gtkwave configure 3.3.102 | |
1633 | 1633 | generated by GNU Autoconf 2.69 |
1634 | 1634 | |
1635 | 1635 | Copyright (C) 2012 Free Software Foundation, Inc. |
2273 | 2273 | This file contains any messages produced by compilers while |
2274 | 2274 | running configure, to aid debugging if configure makes a mistake. |
2275 | 2275 | |
2276 | It was created by gtkwave $as_me 3.3.101, which was | |
2276 | It was created by gtkwave $as_me 3.3.102, which was | |
2277 | 2277 | generated by GNU Autoconf 2.69. Invocation command line was |
2278 | 2278 | |
2279 | 2279 | $ $0 $@ |
3140 | 3140 | |
3141 | 3141 | # Define the identity of the package. |
3142 | 3142 | PACKAGE='gtkwave' |
3143 | VERSION='3.3.101' | |
3143 | VERSION='3.3.102' | |
3144 | 3144 | |
3145 | 3145 | |
3146 | 3146 | cat >>confdefs.h <<_ACEOF |
11498 | 11498 | # report actual input values of CONFIG_FILES etc. instead of their |
11499 | 11499 | # values after options handling. |
11500 | 11500 | ac_log=" |
11501 | This file was extended by gtkwave $as_me 3.3.101, which was | |
11501 | This file was extended by gtkwave $as_me 3.3.102, which was | |
11502 | 11502 | generated by GNU Autoconf 2.69. Invocation command line was |
11503 | 11503 | |
11504 | 11504 | CONFIG_FILES = $CONFIG_FILES |
11564 | 11564 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
11565 | 11565 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
11566 | 11566 | ac_cs_version="\\ |
11567 | gtkwave config.status 3.3.101 | |
11567 | gtkwave config.status 3.3.102 | |
11568 | 11568 | configured by $0, generated by GNU Autoconf 2.69, |
11569 | 11569 | with options \\"\$ac_cs_config\\" |
11570 | 11570 |
1 | 1 | # Process this file with autoconf to produce a configure script. |
2 | 2 | |
3 | 3 | AC_PREREQ(2.59) |
4 | AC_INIT(gtkwave, 3.3.101, bybell@rocketmail.com) | |
4 | AC_INIT(gtkwave, 3.3.102, bybell@rocketmail.com) | |
5 | 5 | AC_CONFIG_SRCDIR([src/vcd.c]) |
6 | 6 | AM_INIT_AUTOMAKE |
7 | 7 | AC_CONFIG_HEADER([config.h]) |
16 | 16 | |
17 | 17 | /* definition of WlfVreg from wlf_api.h */ |
18 | 18 | #define WLF2VCD_MVL4 "01zx" |
19 | #define WLF2VCD_MVL9 "ux01zwlh-" | |
20 | static const char *wlf_mvl9[9] = {"'U'", "'X'", "'0'", "'1'", "'Z'", "'W'", "'L'", "'H'", "'-'"}; | |
19 | 21 | |
20 | 22 | typedef struct WlfGlobalContext |
21 | 23 | { |
30 | 32 | unsigned int max_bits; |
31 | 33 | unsigned int num_aliases; |
32 | 34 | |
35 | unsigned is_vhdl : 1; | |
36 | ||
33 | 37 | unsigned char *value_string; |
34 | 38 | int *archive_number; |
35 | 39 | WlfSymbolId *archive_sym; |
40 | 44 | static void AddSymbolToCB( |
41 | 45 | WlfSymbolId sym, |
42 | 46 | unsigned int vcdid, |
43 | unsigned int num_bits, | |
47 | int num_bits, | |
44 | 48 | unsigned int is_real, |
45 | 49 | unsigned int is_vbit, |
50 | unsigned int is_vhbit, | |
46 | 51 | unsigned int is_vreg |
47 | 52 | ); |
48 | 53 | |
57 | 62 | unsigned int num_bits; |
58 | 63 | unsigned is_real : 1; |
59 | 64 | unsigned is_vbit : 1; |
65 | unsigned is_vhbit : 1; | |
60 | 66 | unsigned is_vreg : 1; |
61 | 67 | } cbData; |
62 | 68 | |
107 | 113 | WlfIterId iter; |
108 | 114 | WlfSymbolId sym; |
109 | 115 | int cnt; |
116 | WlfDataType vtyp; | |
110 | 117 | |
111 | 118 | /* create an iterator to retrieve children of top */ |
112 | 119 | iter = wlfSymChildren64(top, wlfSelAll); |
118 | 125 | cnt = wlfSymPropInt(sym, WLF_PROP_SUBELEMENT_COUNT); |
119 | 126 | WlfSymbolSel64 typ = wlfSymPropSymbolSel64(sym, WLF_PROP_SYMBOL_TYPE); |
120 | 127 | |
128 | if(typ & wlfSelVhdlScopes) | |
129 | { | |
130 | wgc.is_vhdl = 1; | |
131 | } | |
132 | ||
121 | 133 | if(typ & (wlfSelVhdlScopes | wlfSelVlogScopes)) |
122 | 134 | { |
123 | 135 | wgc.num_scopes++; |
125 | 137 | else |
126 | 138 | { |
127 | 139 | WlfTypeId wid = wlfSymPropTypeId(sym, WLF_PROP_TYPE_ID); |
128 | WlfDataType vtyp = wlfTypePropDataType(wid, WLF_TYPE_TYPE); | |
129 | ||
140 | vtyp = wlfTypePropDataType(wid, WLF_TYPE_TYPE); | |
141 | ||
142 | if(vtyp == wlfTypeRecord) | |
143 | { | |
144 | // fprintf(stderr, "wlfTypeRecord %d\n", cnt); | |
145 | wgc.num_scopes++; | |
146 | } | |
147 | else | |
130 | 148 | if(vtyp != wlfTypeArray) /* still possibly have to recurse */ |
131 | 149 | { |
132 | 150 | int rgh = wlfTypePropInt(wid, WLF_TYPE_ARRAY_RIGHT); |
133 | 151 | int lft = wlfTypePropInt(wid, WLF_TYPE_ARRAY_LEFT); |
134 | 152 | int len = wlfTypePropInt(wid, WLF_TYPE_ARRAY_LENGTH); |
135 | 153 | |
154 | if(vtyp == wlfTypeScalar) | |
155 | { | |
156 | lft = 31; rgh = 0; len = 32; | |
157 | } | |
158 | ||
136 | 159 | wgc.num_symbols++; |
137 | 160 | if(len > wgc.max_bits) wgc.max_bits = len; |
138 | 161 | } |
139 | 162 | } |
140 | 163 | |
141 | /* recurse through the children, but block out bitblasted children */ | |
142 | if(cnt<=0) | |
164 | /* recurse through the children, but block out bitblasted children (except vhdl) */ | |
165 | if((cnt<=0) || (wgc.is_vhdl)) | |
143 | 166 | { |
144 | 167 | countSubElements(sym); |
145 | 168 | } |
266 | 289 | |
267 | 290 | unsigned int is_real = 0; |
268 | 291 | unsigned int is_vbit = 0; |
292 | unsigned int is_vhbit = 0; | |
269 | 293 | unsigned int num_bits = 0; |
270 | 294 | unsigned int is_vreg = 0; |
271 | 295 | char *vartype = NULL; |
311 | 335 | case wlfSelNamedEvent: vartype = "event"; break; |
312 | 336 | |
313 | 337 | /* wlfSelHdlSignals */ |
314 | case wlfSelSignal: | |
338 | case wlfSelSignal: vartype = "wire"; break; | |
315 | 339 | break; |
316 | 340 | |
317 | 341 | case wlfSelNet: vartype = "wire"; break; |
322 | 346 | case wlfSelGeneric: |
323 | 347 | case wlfSelAlias: |
324 | 348 | |
325 | default: break; | |
349 | default: fprintf(stderr, "Type: %d\n", typ); exit(255); | |
350 | break; | |
326 | 351 | } |
327 | 352 | |
328 | 353 | WlfModeSel ptyp = wlfSymPropModeSel(sym, WLF_PROP_PORT_TYPE); |
332 | 357 | { |
333 | 358 | wgc.prev_hier[wgc.prev_hier_len - 1] = 0; |
334 | 359 | char *pmod = strrchr(wgc.prev_hier, '/'); |
360 | char *dmod = strrchr(wgc.prev_hier, '.'); | |
361 | if(dmod && (dmod - pmod > 0)) pmod = dmod; | |
335 | 362 | *(pmod + 1) = 0; |
336 | 363 | wgc.prev_hier_len = pmod - wgc.prev_hier + 1; |
337 | 364 | |
338 | 365 | printf("$upscope $end\n"); |
339 | 366 | } |
340 | 367 | |
341 | if(typ & (wlfSelVhdlScopes | wlfSelVlogScopes)) | |
368 | WlfTypeId wid = wlfSymPropTypeId(sym, WLF_PROP_TYPE_ID); | |
369 | WlfDataType vtyp = wlfTypePropDataType(wid, WLF_TYPE_TYPE); | |
370 | ||
371 | if((typ & (wlfSelVhdlScopes | wlfSelVlogScopes)) || (vtyp == wlfTypeRecord)) | |
342 | 372 | { |
343 | 373 | char *ls = strrchr(name, '/'); |
374 | char *ds = strrchr(name, '.'); | |
375 | if(ds && (ds - ls > 0)) ls = ds; | |
376 | ||
344 | 377 | char *sname = ls ? (ls+1) : name; |
345 | 378 | printf("$scope %s %s $end\n", scopetype, sname); |
346 | 379 | |
352 | 385 | int hlen = strlen(name); |
353 | 386 | wgc.prev_hier = malloc(hlen + 1 + 1); |
354 | 387 | memcpy(wgc.prev_hier, name, hlen); |
355 | wgc.prev_hier[hlen] = '/'; | |
388 | wgc.prev_hier[hlen] = (vtyp == wlfTypeRecord) ? '.' : '/'; | |
356 | 389 | wgc.prev_hier[(wgc.prev_hier_len = hlen + 1)] = 0; |
357 | 390 | } |
358 | 391 | else |
359 | 392 | { |
360 | WlfTypeId wid = wlfSymPropTypeId(sym, WLF_PROP_TYPE_ID); | |
361 | WlfDataType vtyp = wlfTypePropDataType(wid, WLF_TYPE_TYPE); | |
362 | ||
363 | 393 | if(vtyp != wlfTypeArray) /* still possibly have to recurse, depends on value of cnt below */ |
364 | 394 | { |
365 | 395 | int rgh = wlfTypePropInt(wid, WLF_TYPE_ARRAY_RIGHT); |
366 | 396 | int lft = wlfTypePropInt(wid, WLF_TYPE_ARRAY_LEFT); |
367 | 397 | int len = wlfTypePropInt(wid, WLF_TYPE_ARRAY_LENGTH); |
398 | ||
399 | if(vtyp == wlfTypeScalar) | |
400 | { | |
401 | lft = 31; rgh = 0; len = 32; | |
402 | is_vbit = 1; is_vhbit = 0; is_real = 0; is_vreg = 0; | |
403 | } | |
404 | ||
405 | if(vtyp == wlfTypeEnum) | |
406 | { | |
407 | char **enumLiterals; | |
408 | int i, count; | |
409 | wlfEnumLiterals(wid, &enumLiterals, &count); | |
410 | if(count == 9) | |
411 | { | |
412 | for(i=0;i<9;i++) | |
413 | { | |
414 | if(strcmp(enumLiterals[i], wlf_mvl9[i])) | |
415 | { | |
416 | break; | |
417 | } | |
418 | } | |
419 | if(i == 9) | |
420 | { | |
421 | is_vhbit = 1; | |
422 | is_vbit = 0; | |
423 | lft = rgh = 0; | |
424 | len = 1; | |
425 | } | |
426 | } | |
427 | } | |
368 | 428 | |
369 | 429 | if((is_real) || (vtyp == wlfTypeReal) || (vtyp == wlfTypeVlogReal)) |
370 | 430 | { |
386 | 446 | |
387 | 447 | if(!vcdid) |
388 | 448 | { |
389 | AddSymbolToCB(sym, ++wgc.vcdid_added, num_bits = len, is_real, is_vbit, is_vreg); | |
449 | AddSymbolToCB(sym, ++wgc.vcdid_added, num_bits = len, is_real, is_vbit, is_vhbit, is_vreg); | |
390 | 450 | vcdid = wgc.vcdid_added; |
391 | 451 | if(arch >= 0) |
392 | 452 | { |
405 | 465 | wgc.num_aliases++; |
406 | 466 | } |
407 | 467 | |
408 | if((lft != rgh) && (!is_vbit) && (!is_real)) | |
409 | { | |
410 | printf("$var %s %d %s %s [%d:%d] $end\n", vartype, len, genVcdID(vcdid_str, vcdid), strrchr(name, '/')+1, lft, rgh); | |
411 | } | |
412 | else | |
413 | { | |
414 | if(cnt && (!is_vbit) && (!is_real)) | |
468 | char *rsl = strrchr(name, '.'); | |
469 | if(!rsl) rsl = strrchr(name, '/'); | |
470 | ||
471 | char *lp = strrchr(rsl, '('); | |
472 | char *rp = strrchr(rsl, ')'); | |
473 | char *lp2 = NULL, *rp2 = NULL; | |
474 | if(lp && rp) | |
475 | { | |
476 | *lp = '['; *rp = ']'; | |
477 | ||
478 | lp2 = strrchr(rsl, '('); | |
479 | rp2 = strrchr(rsl, ')'); | |
480 | if(lp2 && rp2) | |
415 | 481 | { |
416 | printf("$var %s %d %s %s [%d] $end\n", vartype, len, genVcdID(vcdid_str, vcdid), strrchr(name, '/')+1, lft); | |
482 | *lp2 = '['; *rp2 = ']'; | |
417 | 483 | } |
418 | 484 | else |
419 | 485 | { |
420 | printf("$var %s %d %s %s $end\n", vartype, len, genVcdID(vcdid_str, vcdid), strrchr(name, '/')+1); | |
486 | lp2 = rp2 = NULL; | |
421 | 487 | } |
422 | 488 | } |
489 | ||
490 | if((lft != rgh) && (!is_vbit) && (!is_real)) | |
491 | { | |
492 | printf("$var %s %d %s %s [%d:%d] $end\n", vartype, len, genVcdID(vcdid_str, vcdid), rsl+1, lft, rgh); | |
493 | } | |
494 | else | |
495 | { | |
496 | if(cnt && (!is_vbit) && (!is_real)) | |
497 | { | |
498 | printf("$var %s %d %s %s [%d] $end\n", vartype, len, genVcdID(vcdid_str, vcdid), rsl+1, lft); | |
499 | } | |
500 | else | |
501 | { | |
502 | printf("$var %s %d %s %s $end\n", vartype, len, genVcdID(vcdid_str, vcdid), rsl+1); | |
503 | } | |
504 | } | |
505 | ||
506 | if(lp && rp) | |
507 | { | |
508 | *lp = '('; *rp = ')'; | |
509 | } | |
510 | if(lp2 && rp2) | |
511 | { | |
512 | *lp2 = '('; *rp2 = ')'; | |
513 | } | |
423 | 514 | } |
424 | 515 | } |
425 | 516 | |
426 | /* recurse through the children, but block out bitblasted children */ | |
427 | if(cnt<=0) | |
517 | /* recurse through the children, but block out bitblasted children (except vhdl) */ | |
518 | if((cnt<=0) || (wgc.is_vhdl)) | |
428 | 519 | { |
429 | 520 | printSubElements(sym); |
430 | 521 | } |
489 | 580 | unsigned char *pv = ((cbData*) data)->pv; |
490 | 581 | char *value = wgc.value_string; |
491 | 582 | |
492 | if(((cbData*) data)->is_vbit) | |
583 | if(((cbData*) data)->is_vhbit) | |
584 | { | |
585 | for(i=0;i<nbits;i++) | |
586 | { | |
587 | value[i] = WLF2VCD_MVL9[*(pv++)]; | |
588 | } | |
589 | value[i] = 0; | |
590 | } | |
591 | else if(((cbData*) data)->is_vbit) | |
493 | 592 | { |
494 | 593 | WlfVbit *ip = (WlfVbit *)pv; |
495 | 594 | int bitrvs = (nbits - 1); |
645 | 744 | static void AddSymbolToCB( |
646 | 745 | WlfSymbolId sym, |
647 | 746 | unsigned int vcdid, |
648 | unsigned int num_bits, | |
747 | int num_bits, | |
649 | 748 | unsigned int is_real, |
650 | 749 | unsigned int is_vbit, |
750 | unsigned int is_vhbit, | |
651 | 751 | unsigned int is_vreg |
652 | 752 | ) |
653 | 753 | { |
663 | 763 | pdata->pv = wlfValueGetValue(val); |
664 | 764 | #endif |
665 | 765 | pdata->vcdid = vcdid; |
666 | pdata->num_bits = num_bits; | |
766 | pdata->num_bits = (num_bits < 0) ? 0 : num_bits; // ?? how to fix properly | |
667 | 767 | pdata->is_real = is_real; |
668 | 768 | pdata->is_vbit = is_vbit; |
769 | pdata->is_vhbit = is_vhbit; | |
669 | 770 | pdata->is_vreg = is_vreg; |
670 | 771 | status = wlfAddSignalEventCB(wgc.pack, sym, val, WLF_REQUEST_POSTPONED, sigCb, pdata); |
671 | 772 | if(status != WLF_OK) |
692 | 793 | wgc.prev_hier = NULL; |
693 | 794 | wgc.prev_hier_len = 0; |
694 | 795 | wgc.vcdid_added = 0; |
796 | wgc.is_vhdl = 0; | |
695 | 797 | |
696 | 798 | if(argc < 2) |
697 | 799 | { |
Binary diff not shown
41 | 41 | #include "fstapi.h" |
42 | 42 | #include "fastlz.h" |
43 | 43 | #include "lz4.h" |
44 | #include <errno.h> | |
44 | 45 | |
45 | 46 | #ifndef HAVE_LIBPTHREAD |
46 | 47 | #undef FST_WRITER_PARALLEL |
951 | 952 | /* |
952 | 953 | * mmap functions |
953 | 954 | */ |
955 | static void fstWriterMmapSanity(void *pnt, const char *file, int line, const char *usage) | |
956 | { | |
957 | if(pnt == MAP_FAILED) | |
958 | { | |
959 | fprintf(stderr, "fstMmap() assigned to %s failed: errno: %d, file %s, line %d.\n", usage, errno, file, line); | |
960 | perror("Why"); | |
961 | pnt = NULL; | |
962 | } | |
963 | } | |
964 | ||
965 | ||
954 | 966 | static void fstWriterCreateMmaps(struct fstWriterContext *xc) |
955 | 967 | { |
956 | 968 | off_t curpos = ftello(xc->handle); |
973 | 985 | if(!xc->valpos_mem) |
974 | 986 | { |
975 | 987 | fflush(xc->valpos_handle); |
976 | xc->valpos_mem = (uint32_t *)fstMmap(NULL, xc->maxhandle * 4 * sizeof(uint32_t), PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->valpos_handle), 0); | |
988 | errno = 0; | |
989 | if(xc->maxhandle) | |
990 | { | |
991 | fstWriterMmapSanity(xc->valpos_mem = (uint32_t *)fstMmap(NULL, xc->maxhandle * 4 * sizeof(uint32_t), PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->valpos_handle), 0), __FILE__, __LINE__, "xc->valpos_mem"); | |
992 | } | |
977 | 993 | } |
978 | 994 | if(!xc->curval_mem) |
979 | 995 | { |
980 | 996 | fflush(xc->curval_handle); |
981 | xc->curval_mem = (unsigned char *)fstMmap(NULL, xc->maxvalpos, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->curval_handle), 0); | |
997 | errno = 0; | |
998 | if(xc->maxvalpos) | |
999 | { | |
1000 | fstWriterMmapSanity(xc->curval_mem = (unsigned char *)fstMmap(NULL, xc->maxvalpos, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->curval_handle), 0), __FILE__, __LINE__, "xc->curval_handle"); | |
1001 | } | |
982 | 1002 | } |
983 | 1003 | } |
984 | 1004 | |
1681 | 1701 | tlen = ftello(xc->tchn_handle); |
1682 | 1702 | fstWriterFseeko(xc, xc->tchn_handle, 0, SEEK_SET); |
1683 | 1703 | |
1684 | tmem = (unsigned char *)fstMmap(NULL, tlen, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->tchn_handle), 0); | |
1704 | errno = 0; | |
1705 | fstWriterMmapSanity(tmem = (unsigned char *)fstMmap(NULL, tlen, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->tchn_handle), 0), __FILE__, __LINE__, "tmem"); | |
1685 | 1706 | if(tmem) |
1686 | 1707 | { |
1687 | 1708 | unsigned long destlen = tlen; |
1873 | 1894 | |
1874 | 1895 | if(xc && !xc->already_in_close && !xc->already_in_flush) |
1875 | 1896 | { |
1876 | unsigned char *tmem; | |
1897 | unsigned char *tmem = NULL; | |
1877 | 1898 | off_t fixup_offs, tlen, hlen; |
1878 | 1899 | |
1879 | 1900 | xc->already_in_close = 1; /* never need to zero this out as it is freed at bottom */ |
1911 | 1932 | /* write out geom section */ |
1912 | 1933 | fflush(xc->geom_handle); |
1913 | 1934 | tlen = ftello(xc->geom_handle); |
1914 | tmem = (unsigned char *)fstMmap(NULL, tlen, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->geom_handle), 0); | |
1935 | errno = 0; | |
1936 | if(tlen) | |
1937 | { | |
1938 | fstWriterMmapSanity(tmem = (unsigned char *)fstMmap(NULL, tlen, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->geom_handle), 0), __FILE__, __LINE__, "tmem"); | |
1939 | } | |
1940 | ||
1915 | 1941 | if(tmem) |
1916 | 1942 | { |
1917 | 1943 | unsigned long destlen = tlen; |
2019 | 2045 | { |
2020 | 2046 | int lz4_maxlen; |
2021 | 2047 | unsigned char *mem; |
2022 | unsigned char *hmem; | |
2048 | unsigned char *hmem = NULL; | |
2023 | 2049 | int packed_len; |
2024 | 2050 | |
2025 | 2051 | fflush(xc->handle); |
2026 | 2052 | |
2027 | 2053 | lz4_maxlen = LZ4_compressBound(xc->hier_file_len); |
2028 | 2054 | mem = (unsigned char *)malloc(lz4_maxlen); |
2029 | hmem = (unsigned char *)fstMmap(NULL, xc->hier_file_len, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->hier_handle), 0); | |
2055 | errno = 0; | |
2056 | if(xc->hier_file_len) | |
2057 | { | |
2058 | fstWriterMmapSanity(hmem = (unsigned char *)fstMmap(NULL, xc->hier_file_len, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->hier_handle), 0), __FILE__, __LINE__, "hmem"); | |
2059 | } | |
2030 | 2060 | packed_len = LZ4_compress((char *)hmem, (char *)mem, xc->hier_file_len); |
2031 | 2061 | fstMunmap(hmem, xc->hier_file_len); |
2032 | 2062 |
994 | 994 | char *prefix, *suffix, *new; |
995 | 995 | char *prefix_init, *w2_init; |
996 | 996 | unsigned int mode; |
997 | int current_grp_depth = -1; | |
997 | 998 | |
998 | 999 | if(!(len=strlen(w))) return(0); |
999 | 1000 | if(*(w+len-1)=='\n') |
1248 | 1249 | |
1249 | 1250 | b = maketyp ? makevec(prefix+1,w2) : makevec_annotated(prefix+1,w2); /* '#' vs ':' cases... */ |
1250 | 1251 | |
1252 | if(GLOBALS->default_flags&TR_GRP_BEGIN_B) { current_grp_depth = GLOBALS->group_depth; } | |
1253 | ||
1251 | 1254 | if(b) |
1252 | 1255 | { |
1253 | 1256 | if((v=bits2vector(b))) |
1256 | 1259 | AddVector(v, alias); |
1257 | 1260 | free_2(b->name); |
1258 | 1261 | b->name=NULL; |
1259 | return(v!=NULL); | |
1262 | goto grp_bot; | |
1260 | 1263 | } |
1261 | 1264 | else |
1262 | 1265 | { |
1311 | 1314 | } |
1312 | 1315 | } |
1313 | 1316 | |
1317 | grp_bot: | |
1318 | if((GLOBALS->default_flags&TR_GRP_BEGIN_B) && (current_grp_depth >= 0) && (current_grp_depth == GLOBALS->group_depth)) { AddBlankTrace(prefix+1); } | |
1314 | 1319 | return(v!=NULL); |
1315 | 1320 | } |
1316 | 1321 | else |
1167 | 1167 | return(TCL_OK); |
1168 | 1168 | } |
1169 | 1169 | |
1170 | static int gtkwavetcl_addCommentTracesFromList(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) | |
1171 | { | |
1172 | char reportString[33]; | |
1173 | Tcl_Obj *aobj; | |
1174 | ||
1175 | if(objc==2) | |
1176 | { | |
1177 | char *s = Tcl_GetString(objv[1]); | |
1178 | char** elem = NULL; | |
1179 | int i, l = 0; | |
1180 | ||
1181 | elem = zSplitTclList(s, &l); | |
1182 | if(elem) | |
1183 | { | |
1184 | for(i=0;i<l;i++) | |
1185 | { | |
1186 | InsertBlankTrace(elem[i], 0); | |
1187 | } | |
1188 | free_2(elem); | |
1189 | } | |
1190 | ||
1191 | GLOBALS->signalwindow_width_dirty=1; | |
1192 | MaxSignalLength(); | |
1193 | signalarea_configure_event(GLOBALS->signalarea, NULL); | |
1194 | wavearea_configure_event(GLOBALS->wavearea, NULL); | |
1195 | ||
1196 | sprintf(reportString, "%d", l); | |
1197 | ||
1198 | aobj = Tcl_NewStringObj(reportString, -1); | |
1199 | Tcl_SetObjResult(interp, aobj); | |
1200 | } | |
1201 | else | |
1202 | { | |
1203 | return(gtkwavetcl_badNumArgs(clientData, interp, objc, objv, 1)); | |
1204 | } | |
1205 | ||
1206 | return(TCL_OK); | |
1207 | } | |
1170 | 1208 | |
1171 | 1209 | static int gtkwavetcl_addSignalsFromList(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) |
1172 | 1210 | { |
2243 | 2281 | |
2244 | 2282 | tcl_cmdstruct gtkwave_commands[] = |
2245 | 2283 | { |
2284 | {"addCommentTracesFromList", gtkwavetcl_addCommentTracesFromList}, | |
2246 | 2285 | {"addSignalsFromList", gtkwavetcl_addSignalsFromList}, |
2247 | 2286 | {"deleteSignalsFromList", gtkwavetcl_deleteSignalsFromList}, |
2248 | 2287 | {"deleteSignalsFromListIncludingDuplicates", gtkwavetcl_deleteSignalsFromListIncludingDuplicates}, |
2294 | 2333 | {"installFileFilter", gtkwavetcl_installFileFilter}, |
2295 | 2334 | {"installProcFilter", gtkwavetcl_installProcFilter}, |
2296 | 2335 | {"installTransFilter", gtkwavetcl_installTransFilter}, |
2336 | {"loadFile", gtkwavetcl_loadFile}, | |
2297 | 2337 | {"nop", gtkwavetcl_nop}, |
2338 | {"presentWindow", gtkwavetcl_presentWindow}, | |
2339 | {"processTclList", gtkwavetcl_processTclList}, /* not for general-purpose use */ | |
2340 | {"reLoadFile", gtkwavetcl_reLoadFile}, | |
2298 | 2341 | {"setBaselineMarker", gtkwavetcl_setBaselineMarker}, |
2299 | 2342 | {"setCurrentTranslateEnums", gtkwavetcl_setCurrentTranslateEnums}, |
2300 | 2343 | {"setCurrentTranslateFile", gtkwavetcl_setCurrentTranslateFile}, |
2312 | 2355 | {"setWindowStartTime", gtkwavetcl_setWindowStartTime}, |
2313 | 2356 | {"setZoomFactor", gtkwavetcl_setZoomFactor}, |
2314 | 2357 | {"setZoomRangeTimes", gtkwavetcl_setZoomRangeTimes}, |
2315 | {"loadFile", gtkwavetcl_loadFile}, | |
2316 | {"reLoadFile", gtkwavetcl_reLoadFile}, | |
2317 | {"presentWindow", gtkwavetcl_presentWindow}, | |
2318 | 2358 | {"showSignal", gtkwavetcl_showSignal}, |
2359 | {"signalChangeList", gtkwavetcl_signalChangeList}, /* changed from signal_change_list for consistency! */ | |
2319 | 2360 | {"unhighlightSignalsFromList", gtkwavetcl_unhighlightSignalsFromList}, |
2320 | {"signalChangeList", gtkwavetcl_signalChangeList}, /* changed from signal_change_list for consistency! */ | |
2321 | {"processTclList", gtkwavetcl_processTclList}, /* not for general-purpose use */ | |
2322 | 2361 | {"", NULL} /* sentinel */ |
2323 | 2362 | }; |
2324 | 2363 |
1120 | 1120 | else if(!strcmp(p, "VHDL_ST_GENFOR")) { exclhier |= exclone << TREE_VHDL_ST_GENFOR; } |
1121 | 1121 | else if(!strcmp(p, "VHDL_ST_INSTANCE")) { exclhier |= exclone << TREE_VHDL_ST_INSTANCE; } |
1122 | 1122 | else if(!strcmp(p, "VHDL_ST_PACKAGE")) { exclhier |= exclone << TREE_VHDL_ST_PACKAGE; } |
1123 | else if(!strcmp(p, "VHDL_ST_PACKAGE")) { exclhier |= exclone << TREE_VHDL_ST_PACKAGE; } | |
1124 | 1123 | |
1125 | 1124 | else if(!strcmp(p, "VHDL_ST_SIGNAL")) { exclhier |= exclone << TREE_VHDL_ST_SIGNAL; } |
1126 | 1125 | else if(!strcmp(p, "VHDL_ST_PORTIN")) { exclhier |= exclone << TREE_VHDL_ST_PORTIN; } |