New upstream version 3.3.104
أحمد المحمودي (Ahmed El-Mahmoudy)
4 years ago
0 | GTKWave Wave Viewer is Copyright (C) 1999-2019 Tony Bybell. | |
1 | Windows compatibility and PS/MIF routines are Copyright (C) 1999-2019 Udi Finkelstein. | |
2 | Context support is Copyright (C) 2007-2019 Kermin Elliott Fleming. | |
3 | Trace group support is Copyright (C) 2009-2019 Donald Baltus. | |
4 | GHW and additional GUI support is Copyright (C) 2005-2019 Tristan Gingold. | |
5 | Analog support is Copyright (C) 2005-2019 Thomas Sailer. | |
6 | External DnD support is Copyright (C) 2008-2019 Concept Engineering GmbH. | |
7 | FastLZ is Copyright (C) 2005-2019 Ariya Hidayat. | |
0 | GTKWave Wave Viewer is Copyright (C) 1999-2020 Tony Bybell. | |
1 | Windows compatibility and PS/MIF routines are Copyright (C) 1999-2020 Udi Finkelstein. | |
2 | Context support is Copyright (C) 2007-2020 Kermin Elliott Fleming. | |
3 | Trace group support is Copyright (C) 2009-2020 Donald Baltus. | |
4 | GHW and additional GUI support is Copyright (C) 2005-2020 Tristan Gingold. | |
5 | Analog support is Copyright (C) 2005-2020 Thomas Sailer. | |
6 | External DnD support is Copyright (C) 2008-2020 Concept Engineering GmbH. | |
7 | FastLZ is Copyright (C) 2005-2020 Ariya Hidayat. | |
8 | 8 | Some public domain clip art by contributors at http://www.sxc.hu/ website. |
9 | 9 | Hierarchy marker icons from the Silk icons set by Mark James found at the http://www.famfamfam.com/lab/icons/silk/ website. |
10 | 10 | Portions of the TCL implementation, tcl_np.c and tcl_np.h are copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState Corporation, and other parties. |
11 | NSAlert is Copyright (C) 2011-2019 Philipp Mayerhofer. | |
12 | LZ4 is Copyright (C) 2011-2019 Yann Collet. | |
11 | NSAlert is Copyright (C) 2011-2020 Philipp Mayerhofer. | |
12 | LZ4 is Copyright (C) 2011-2020 Yann Collet. |
1717 | 1717 | Fix to make the coloration red on 'u' traces. (Bug from |
1718 | 1718 | Dinotrace-like rendering in 3.3.96.) |
1719 | 1719 | Typo fix on missing group start on vectors. |
1720 | 3.3.104 24jan20 Added support for loading .vf files (provided FSDB reader | |
1721 | libraries are enabled). | |
1722 | Added support for dumping variable types in vcd saveer, not | |
1723 | just using "wire" for non-reals/strings. | |
1724 | Fix for uninitialized values at time 0 for FST, FSDB loaders. |
0 | 0 | ########################################################################## |
1 | 1 | |
2 | GTKWave 3.3.103 Wave Viewer is Copyright (C) 1999-2019 Tony Bybell. | |
3 | Portions of GTKWave are Copyright (C) 1999-2019 Udi Finkelstein. | |
4 | Context support is Copyright (C) 2007-2019 Kermin Elliott Fleming. | |
5 | Trace group support is Copyright (C) 2009-2019 Donald Baltus. | |
6 | GHW and additional GUI support is Copyright (C) 2005-2019 Tristan Gingold. | |
7 | Analog support is Copyright (C) 2005-2019 Thomas Sailer. | |
8 | External DnD support is Copyright (C) 2008-2019 Concept Engineering GmbH. | |
9 | FastLZ is Copyright (C) 2005-2019 Ariya Hidayat. | |
10 | LZ4 is Copyright (C) 2011-2019 Yann Collet. | |
2 | GTKWave 3.3.104 Wave Viewer is Copyright (C) 1999-2020 Tony Bybell. | |
3 | Portions of GTKWave are Copyright (C) 1999-2020 Udi Finkelstein. | |
4 | Context support is Copyright (C) 2007-2020 Kermin Elliott Fleming. | |
5 | Trace group support is Copyright (C) 2009-2020 Donald Baltus. | |
6 | GHW and additional GUI support is Copyright (C) 2005-2020 Tristan Gingold. | |
7 | Analog support is Copyright (C) 2005-2020 Thomas Sailer. | |
8 | External DnD support is Copyright (C) 2008-2020 Concept Engineering GmbH. | |
9 | FastLZ is Copyright (C) 2005-2020 Ariya Hidayat. | |
10 | LZ4 is Copyright (C) 2011-2020 Yann Collet. | |
11 | 11 | |
12 | 12 | This program is free software; you can redistribute it and/or modify it |
13 | 13 | under the terms of the GNU General Public License as published by the Free |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for gtkwave 3.3.103. | |
2 | # Generated by GNU Autoconf 2.69 for gtkwave 3.3.104. | |
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.103' | |
583 | PACKAGE_STRING='gtkwave 3.3.103' | |
582 | PACKAGE_VERSION='3.3.104' | |
583 | PACKAGE_STRING='gtkwave 3.3.104' | |
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.103 to adapt to many kinds of systems. | |
1407 | \`configure' configures gtkwave 3.3.104 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.103:";; | |
1473 | short | recursive ) echo "Configuration of gtkwave 3.3.104:";; | |
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.103 | |
1632 | gtkwave configure 3.3.104 | |
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.103, which was | |
2276 | It was created by gtkwave $as_me 3.3.104, 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.103' | |
3143 | VERSION='3.3.104' | |
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.103, which was | |
11501 | This file was extended by gtkwave $as_me 3.3.104, 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.103 | |
11567 | gtkwave config.status 3.3.104 | |
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.103, bybell@rocketmail.com) | |
4 | AC_INIT(gtkwave, 3.3.104, bybell@rocketmail.com) | |
5 | 5 | AC_CONFIG_SRCDIR([src/vcd.c]) |
6 | 6 | AM_INIT_AUTOMAKE |
7 | 7 | AC_CONFIG_HEADER([config.h]) |
7 | 7 | <key>CFBundleExecutable</key> |
8 | 8 | <string>gtkwave</string> |
9 | 9 | <key>CFBundleGetInfoString</key> |
10 | <string>3.3.101, (C) 1999-2019 Tony Bybell http://gtkwave.sourceforge.net</string> | |
10 | <string>3.3.104, (C) 1999-2020 Tony Bybell http://gtkwave.sourceforge.net</string> | |
11 | 11 | <key>CFBundleIconFile</key> |
12 | 12 | <string>gtkwave.icns</string> |
13 | 13 | <key>CFBundleIdentifier</key> |
17 | 17 | <key>CFBundlePackageType</key> |
18 | 18 | <string>APPL</string> |
19 | 19 | <key>CFBundleShortVersionString</key> |
20 | <string>3.3.101</string> | |
20 | <string>3.3.104</string> | |
21 | 21 | <key>CFBundleSignature</key> |
22 | 22 | <string>????</string> |
23 | 23 | <key>CFBundleVersion</key> |
24 | <string>3.3.101</string> | |
24 | <string>3.3.104</string> | |
25 | 25 | <key>NSHumanReadableCopyright</key> |
26 | <string>Copyright 1999 - 2019 Tony Bybell, GNU General Public License.</string> | |
26 | <string>Copyright 1999 - 2020 Tony Bybell, GNU General Public License.</string> | |
27 | 27 | <key>LSMinimumSystemVersion</key> |
28 | 28 | <string>10.6</string> |
29 | 29 |
2170 | 2170 | */ |
2171 | 2171 | void import_extload_trace(nptr np) |
2172 | 2172 | { |
2173 | struct HistEnt *htemp, *histent_tail; | |
2173 | struct HistEnt *htemp, *htempx=NULL, *histent_tail; | |
2174 | 2174 | int len, i; |
2175 | 2175 | struct fac *f; |
2176 | 2176 | int txidx, txidx_in_trace; |
2358 | 2358 | htemp->v.h_val = AN_X; /* x */ |
2359 | 2359 | } |
2360 | 2360 | } |
2361 | htempx = htemp; | |
2361 | 2362 | htemp->time = MAX_HISTENT_TIME-1; |
2362 | 2363 | htemp->next = histent_tail; |
2363 | 2364 | |
2401 | 2402 | { |
2402 | 2403 | if(len>1) |
2403 | 2404 | { |
2404 | htemp2->v.h_vector = htemp->v.h_vector; | |
2405 | htemp2->v.h_vector = htempx->v.h_vector; | |
2405 | 2406 | } |
2406 | 2407 | else |
2407 | 2408 | { |
2408 | htemp2->v.h_val = htemp->v.h_val; | |
2409 | htemp2->v.h_val = htempx->v.h_val; | |
2409 | 2410 | } |
2410 | 2411 | } |
2411 | 2412 | htemp2->next = htemp; |
1663 | 1663 | else |
1664 | 1664 | { |
1665 | 1665 | htemp->v.h_val = AN_X; /* x */ |
1666 | htempx = htemp; | |
1666 | 1667 | } |
1667 | 1668 | htemp->time = MAX_HISTENT_TIME-1; |
1668 | 1669 | htemp->next = histent_tail; |
1704 | 1705 | } |
1705 | 1706 | else |
1706 | 1707 | { |
1707 | htemp2->v.h_val = htemp->v.h_val; | |
1708 | htemp2->v.h_val = htempx->v.h_val; | |
1708 | 1709 | } |
1709 | 1710 | htemp2->next = htemp; |
1710 | 1711 | htemp = htemp2; |
1920 | 1921 | else |
1921 | 1922 | { |
1922 | 1923 | htemp->v.h_val = AN_X; /* x */ |
1924 | htempx = htemp; | |
1923 | 1925 | } |
1924 | 1926 | htemp->time = MAX_HISTENT_TIME-1; |
1925 | 1927 | htemp->next = histent_tail; |
1961 | 1963 | } |
1962 | 1964 | else |
1963 | 1965 | { |
1964 | htemp2->v.h_val = htemp->v.h_val; | |
1966 | htemp2->v.h_val = htempx->v.h_val; | |
1965 | 1967 | } |
1966 | 1968 | htemp2->next = htemp; |
1967 | 1969 | htemp = htemp2; |
25 | 25 | /* 12345678901234567 */ |
26 | 26 | #define WAVE_GCONF_DIR_LEN (17) |
27 | 27 | |
28 | int wave_rpc_id; | |
28 | extern int wave_rpc_id; | |
29 | 29 | |
30 | 30 | void wave_gconf_init(int argc, char **argv); |
31 | 31 | gboolean wave_gconf_client_set_string(const gchar *key, const gchar *val); |
36 | 36 | * |
37 | 37 | */ |
38 | 38 | |
39 | #include <config.h> | |
39 | #ifndef FST_CONFIG_INCLUDE | |
40 | # define FST_CONFIG_INCLUDE <config.h> | |
41 | #endif | |
42 | #include FST_CONFIG_INCLUDE | |
40 | 43 | |
41 | 44 | #include "fstapi.h" |
42 | 45 | #include "fastlz.h" |
126 | 129 | #if defined(__APPLE__) && defined(__MACH__) |
127 | 130 | #define FST_MACOSX |
128 | 131 | #include <sys/sysctl.h> |
132 | #endif | |
133 | ||
134 | #ifdef __GNUC__ | |
135 | /* Boolean expression more often true than false */ | |
136 | #define FST_LIKELY(x) __builtin_expect(!!(x), 1) | |
137 | /* Boolean expression more often false than true */ | |
138 | #define FST_UNLIKELY(x) __builtin_expect(!!(x), 0) | |
139 | #else | |
140 | #define FST_LIKELY(x) (!!(x)) | |
141 | #define FST_UNLIKELY(x) (!!(x)) | |
129 | 142 | #endif |
130 | 143 | |
131 | 144 | #define FST_APIMESS "FSTAPI | " |
722 | 735 | |
723 | 736 | uint32_t *valpos_mem; |
724 | 737 | unsigned char *curval_mem; |
738 | ||
739 | unsigned char *outval_mem; /* for two-state / Verilator-style value changes */ | |
740 | uint32_t outval_alloc_siz; | |
725 | 741 | |
726 | 742 | char *filename; |
727 | 743 | |
1912 | 1928 | xc->skip_writing_section_hdr = 1; |
1913 | 1929 | if(!xc->size_limit_locked) |
1914 | 1930 | { |
1915 | if(xc->is_initial_time) /* simulation time never advanced so mock up the changes as time zero ones */ | |
1931 | if(FST_UNLIKELY(xc->is_initial_time)) /* simulation time never advanced so mock up the changes as time zero ones */ | |
1916 | 1932 | { |
1917 | 1933 | fstHandle dupe_idx; |
1918 | 1934 | |
1930 | 1946 | } |
1931 | 1947 | } |
1932 | 1948 | fstDestroyMmaps(xc, 1); |
1949 | if(xc->outval_mem) | |
1950 | { | |
1951 | free(xc->outval_mem); xc->outval_mem = NULL; | |
1952 | xc->outval_alloc_siz = 0; | |
1953 | } | |
1933 | 1954 | |
1934 | 1955 | /* write out geom section */ |
1935 | 1956 | fflush(xc->geom_handle); |
2874 | 2895 | uint32_t offs; |
2875 | 2896 | int len; |
2876 | 2897 | |
2877 | if((xc) && (handle <= xc->maxhandle)) | |
2898 | if(FST_LIKELY((xc) && (handle <= xc->maxhandle))) | |
2878 | 2899 | { |
2879 | 2900 | uint32_t fpos; |
2880 | 2901 | uint32_t *vm4ip; |
2881 | 2902 | |
2882 | if(!xc->valpos_mem) | |
2903 | if(FST_UNLIKELY(!xc->valpos_mem)) | |
2883 | 2904 | { |
2884 | 2905 | xc->vc_emitted = 1; |
2885 | 2906 | fstWriterCreateMmaps(xc); |
2889 | 2910 | vm4ip = &(xc->valpos_mem[4*handle]); |
2890 | 2911 | |
2891 | 2912 | len = vm4ip[1]; |
2892 | if(len) /* len of zero = variable length, use fstWriterEmitVariableLengthValueChange */ | |
2893 | { | |
2894 | if(!xc->is_initial_time) | |
2913 | if(FST_LIKELY(len)) /* len of zero = variable length, use fstWriterEmitVariableLengthValueChange */ | |
2914 | { | |
2915 | if(FST_LIKELY(!xc->is_initial_time)) | |
2895 | 2916 | { |
2896 | 2917 | fpos = xc->vchg_siz; |
2897 | 2918 | |
2898 | if((fpos + len + 10) > xc->vchg_alloc_siz) | |
2919 | if(FST_UNLIKELY((fpos + len + 10) > xc->vchg_alloc_siz)) | |
2899 | 2920 | { |
2900 | 2921 | xc->vchg_alloc_siz += (xc->fst_break_add_size + len); /* +len added in the case of extremely long vectors and small break add sizes */ |
2901 | 2922 | xc->vchg_mem = (unsigned char *)realloc(xc->vchg_mem, xc->vchg_alloc_siz); |
2902 | if(!xc->vchg_mem) | |
2923 | if(FST_UNLIKELY(!xc->vchg_mem)) | |
2903 | 2924 | { |
2904 | 2925 | fprintf(stderr, FST_APIMESS "Could not realloc() in fstWriterEmitValueChange, exiting.\n"); |
2905 | 2926 | exit(255); |
2984 | 3005 | } |
2985 | 3006 | } |
2986 | 3007 | |
3008 | void fstWriterEmitValueChange32(void *ctx, fstHandle handle, | |
3009 | uint32_t bits, uint32_t val) { | |
3010 | char buf[32]; | |
3011 | char *s = buf; | |
3012 | uint32_t i; | |
3013 | for (i = 0; i < bits; ++i) | |
3014 | { | |
3015 | *s++ = '0' + ((val >> (bits - i - 1)) & 1); | |
3016 | } | |
3017 | fstWriterEmitValueChange(ctx, handle, buf); | |
3018 | } | |
3019 | void fstWriterEmitValueChange64(void *ctx, fstHandle handle, | |
3020 | uint32_t bits, uint64_t val) { | |
3021 | char buf[64]; | |
3022 | char *s = buf; | |
3023 | uint32_t i; | |
3024 | for (i = 0; i < bits; ++i) | |
3025 | { | |
3026 | *s++ = '0' + ((val >> (bits - i - 1)) & 1); | |
3027 | } | |
3028 | fstWriterEmitValueChange(ctx, handle, buf); | |
3029 | } | |
3030 | void fstWriterEmitValueChangeVec32(void *ctx, fstHandle handle, | |
3031 | uint32_t bits, const uint32_t *val) { | |
3032 | struct fstWriterContext *xc = (struct fstWriterContext *)ctx; | |
3033 | if (FST_UNLIKELY(bits <= 32)) | |
3034 | { | |
3035 | fstWriterEmitValueChange32(ctx, handle, bits, val[0]); | |
3036 | } | |
3037 | else if(FST_LIKELY(xc)) | |
3038 | { | |
3039 | int bq = bits / 32; | |
3040 | int br = bits & 31; | |
3041 | int i; | |
3042 | int w; | |
3043 | uint32_t v; | |
3044 | unsigned char* s; | |
3045 | if (FST_UNLIKELY(bits > xc->outval_alloc_siz)) | |
3046 | { | |
3047 | xc->outval_alloc_siz = bits*2 + 1; | |
3048 | xc->outval_mem = (unsigned char*)realloc(xc->outval_mem, xc->outval_alloc_siz); | |
3049 | if (FST_UNLIKELY(!xc->outval_mem)) | |
3050 | { | |
3051 | fprintf(stderr, | |
3052 | FST_APIMESS "Could not realloc() in fstWriterEmitValueChangeVec32, exiting.\n"); | |
3053 | exit(255); | |
3054 | } | |
3055 | } | |
3056 | s = xc->outval_mem; | |
3057 | { | |
3058 | w = bq; | |
3059 | v = val[w]; | |
3060 | for (i = 0; i < br; ++i) | |
3061 | { | |
3062 | *s++ = '0' + ((v >> (br - i - 1)) & 1); | |
3063 | } | |
3064 | } | |
3065 | for (w = bq - 1; w >= 0; --w) | |
3066 | { | |
3067 | v = val[w]; | |
3068 | for (i = (32 - 4); i >= 0; i -= 4) { | |
3069 | s[0] = '0' + ((v >> (i + 3)) & 1); | |
3070 | s[1] = '0' + ((v >> (i + 2)) & 1); | |
3071 | s[2] = '0' + ((v >> (i + 1)) & 1); | |
3072 | s[3] = '0' + ((v >> (i + 0)) & 1); | |
3073 | s += 4; | |
3074 | } | |
3075 | } | |
3076 | fstWriterEmitValueChange(ctx, handle, xc->outval_mem); | |
3077 | } | |
3078 | } | |
3079 | void fstWriterEmitValueChangeVec64(void *ctx, fstHandle handle, | |
3080 | uint32_t bits, const uint64_t *val) { | |
3081 | struct fstWriterContext *xc = (struct fstWriterContext *)ctx; | |
3082 | if (FST_UNLIKELY(bits <= 64)) | |
3083 | { | |
3084 | fstWriterEmitValueChange64(ctx, handle, bits, val[0]); | |
3085 | } | |
3086 | else if(FST_LIKELY(xc)) | |
3087 | { | |
3088 | int bq = bits / 64; | |
3089 | int br = bits & 63; | |
3090 | int i; | |
3091 | int w; | |
3092 | uint32_t v; | |
3093 | unsigned char* s; | |
3094 | if (FST_UNLIKELY(bits > xc->outval_alloc_siz)) | |
3095 | { | |
3096 | xc->outval_alloc_siz = bits*2 + 1; | |
3097 | xc->outval_mem = (unsigned char*)realloc(xc->outval_mem, xc->outval_alloc_siz); | |
3098 | if (FST_UNLIKELY(!xc->outval_mem)) | |
3099 | { | |
3100 | fprintf(stderr, | |
3101 | FST_APIMESS "Could not realloc() in fstWriterEmitValueChangeVec64, exiting.\n"); | |
3102 | exit(255); | |
3103 | } | |
3104 | } | |
3105 | s = xc->outval_mem; | |
3106 | { | |
3107 | w = bq; | |
3108 | v = val[w]; | |
3109 | for (i = 0; i < br; ++i) | |
3110 | { | |
3111 | *s++ = '0' + ((v >> (br - i - 1)) & 1); | |
3112 | } | |
3113 | } | |
3114 | for (w = bq - 1; w >= 0; --w) { | |
3115 | v = val[w]; | |
3116 | for (i = (64 - 4); i >= 0; i -= 4) | |
3117 | { | |
3118 | s[0] = '0' + ((v >> (i + 3)) & 1); | |
3119 | s[1] = '0' + ((v >> (i + 2)) & 1); | |
3120 | s[2] = '0' + ((v >> (i + 1)) & 1); | |
3121 | s[3] = '0' + ((v >> (i + 0)) & 1); | |
3122 | s += 4; | |
3123 | } | |
3124 | } | |
3125 | fstWriterEmitValueChange(ctx, handle, xc->outval_mem); | |
3126 | } | |
3127 | } | |
3128 | ||
2987 | 3129 | |
2988 | 3130 | void fstWriterEmitVariableLengthValueChange(void *ctx, fstHandle handle, const void *val, uint32_t len) |
2989 | 3131 | { |
2990 | 3132 | struct fstWriterContext *xc = (struct fstWriterContext *)ctx; |
2991 | 3133 | const unsigned char *buf = (const unsigned char *)val; |
2992 | 3134 | |
2993 | if((xc) && (handle <= xc->maxhandle)) | |
3135 | if(FST_LIKELY((xc) && (handle <= xc->maxhandle))) | |
2994 | 3136 | { |
2995 | 3137 | uint32_t fpos; |
2996 | 3138 | uint32_t *vm4ip; |
2997 | 3139 | |
2998 | if(!xc->valpos_mem) | |
3140 | if(FST_UNLIKELY(!xc->valpos_mem)) | |
2999 | 3141 | { |
3000 | 3142 | xc->vc_emitted = 1; |
3001 | 3143 | fstWriterCreateMmaps(xc); |
3005 | 3147 | vm4ip = &(xc->valpos_mem[4*handle]); |
3006 | 3148 | |
3007 | 3149 | /* there is no initial time dump for variable length value changes */ |
3008 | if(!vm4ip[1]) /* len of zero = variable length */ | |
3150 | if(FST_LIKELY(!vm4ip[1])) /* len of zero = variable length */ | |
3009 | 3151 | { |
3010 | 3152 | fpos = xc->vchg_siz; |
3011 | 3153 | |
3012 | if((fpos + len + 10 + 5) > xc->vchg_alloc_siz) | |
3154 | if(FST_UNLIKELY((fpos + len + 10 + 5) > xc->vchg_alloc_siz)) | |
3013 | 3155 | { |
3014 | 3156 | xc->vchg_alloc_siz += (xc->fst_break_add_size + len + 5); /* +len added in the case of extremely long vectors and small break add sizes */ |
3015 | 3157 | xc->vchg_mem = (unsigned char *)realloc(xc->vchg_mem, xc->vchg_alloc_siz); |
3016 | if(!xc->vchg_mem) | |
3158 | if(FST_UNLIKELY(!xc->vchg_mem)) | |
3017 | 3159 | { |
3018 | 3160 | fprintf(stderr, FST_APIMESS "Could not realloc() in fstWriterEmitVariableLengthValueChange, exiting.\n"); |
3019 | 3161 | exit(255); |
3035 | 3177 | int skip = 0; |
3036 | 3178 | if(xc) |
3037 | 3179 | { |
3038 | if(xc->is_initial_time) | |
3180 | if(FST_UNLIKELY(xc->is_initial_time)) | |
3039 | 3181 | { |
3040 | 3182 | if(xc->size_limit_locked) /* this resets xc->is_initial_time to one */ |
3041 | 3183 | { |
354 | 354 | void fstWriterEmitDumpActive(void *ctx, int enable); |
355 | 355 | void fstWriterEmitEnumTableRef(void *ctx, fstEnumHandle handle); |
356 | 356 | void fstWriterEmitValueChange(void *ctx, fstHandle handle, const void *val); |
357 | void fstWriterEmitValueChange32(void *ctx, fstHandle handle, | |
358 | uint32_t bits, uint32_t val); | |
359 | void fstWriterEmitValueChange64(void *ctx, fstHandle handle, | |
360 | uint32_t bits, uint64_t val); | |
361 | void fstWriterEmitValueChangeVec32(void *ctx, fstHandle handle, | |
362 | uint32_t bits, const uint32_t *val); | |
363 | void fstWriterEmitValueChangeVec64(void *ctx, fstHandle handle, | |
364 | uint32_t bits, const uint64_t *val); | |
357 | 365 | void fstWriterEmitVariableLengthValueChange(void *ctx, fstHandle handle, const void *val, uint32_t len); |
358 | 366 | void fstWriterEmitTimeChange(void *ctx, uint64_t tim); |
359 | 367 | void fstWriterFlushContext(void *ctx); |
1466 | 1466 | #if defined(EXTLOAD_SUFFIX) |
1467 | 1467 | if( |
1468 | 1468 | (suffix_check(GLOBALS->loaded_file_name, "."EXTLOAD_SUFFIX ) && !opt_vcd) || |
1469 | (suffix_check(GLOBALS->loaded_file_name, ".vf" ) && !opt_vcd) || /* virtual file */ | |
1469 | 1470 | (suffix_check(GLOBALS->loaded_file_name, "."EXTLOAD_SUFFIX".gz" ) && !opt_vcd) || /* loader automatically does gzip -cd */ |
1470 | 1471 | (suffix_check(GLOBALS->loaded_file_name, "."EXTLOAD_SUFFIX".bz2") && !opt_vcd) /* loader automatically does bzip2 -cd */ |
1471 | 1472 | ) |
13 | 13 | #include "ghw.h" |
14 | 14 | #include "hierpack.h" |
15 | 15 | #include <time.h> |
16 | ||
17 | WAVE_NODEVARTYPE_STR | |
16 | 18 | |
17 | 19 | static void w32redirect_fprintf(int is_trans, FILE *sfd, const char *format, ...) |
18 | 20 | { |
607 | 609 | } |
608 | 610 | else |
609 | 611 | { |
610 | w32redirect_fprintf(is_trans, 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); | |
612 | w32redirect_fprintf(is_trans, GLOBALS->f_vcd_saver_c_1, "$var %s 1 %s %s $end\n", vartype_strings[GLOBALS->hp_vcd_saver_c_1[i]->item->vartype], vcdid(GLOBALS->hp_vcd_saver_c_1[i]->val, export_typ), netname); | |
611 | 613 | } |
612 | 614 | } |
613 | 615 | else |
619 | 621 | } |
620 | 622 | else |
621 | 623 | { |
622 | w32redirect_fprintf(is_trans, 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); | |
624 | w32redirect_fprintf(is_trans, GLOBALS->f_vcd_saver_c_1, "$var %s %d %s %s $end\n", vartype_strings[GLOBALS->hp_vcd_saver_c_1[i]->item->vartype], len, vcdid(GLOBALS->hp_vcd_saver_c_1[i]->val, export_typ), netname); | |
623 | 625 | } |
624 | 626 | GLOBALS->hp_vcd_saver_c_1[i]->len = len; |
625 | 627 | if(len > max_len) max_len = len; |