Codebase list gtkwave / 41743d5
Import upstream version 3.3.115 Debian Janitor 11 months ago
17 changed file(s) with 2470 addition(s) and 283 deletion(s). Raw diff Collapse all Expand all
18301830 3.3.113 04oct22 Bugfix-only release.
18311831 High CPU utilization when nothing is happening.
18321832 3.3.114 23nov22 Buffer overflow fixes in FST reader.
1833 3.3.115 28mar23 Fix VZT reader with -fstrict-aliasing.
1834 Fix use_multi_state condition in vzt_write.c.
1835 Fix for UNDEF vs strings at start of a vzt file.
1836 Fix sleep() time scaling redefine for mingw.
1837 Use MapViewOfFileEx for mmap on Windows (fstapi).
1838 Define FST_DO_MISALIGNED_OPS on AArch64 (fstapi).
1839 Fixed attrbegin short length problem.
00 ##########################################################################
11
2 GTKWave 3.3.113 Wave Viewer is Copyright (C) 1999-2023 Tony Bybell.
2 GTKWave 3.3.115 Wave Viewer is Copyright (C) 1999-2023 Tony Bybell.
33 Portions of GTKWave are Copyright (C) 1999-2023 Udi Finkelstein.
44 Context support is Copyright (C) 2007-2023 Kermin Elliott Fleming.
55 Trace group support is Copyright (C) 2009-2023 Donald Baltus.
7878 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
7979 $(top_srcdir)/configure $(am__configure_deps) \
8080 $(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \
81 README compile config.guess config.sub depcomp install-sh \
82 missing ylwrap
81 compile config.guess config.sub depcomp install-sh missing \
82 ylwrap
8383 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
8484 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
8585 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+0
-192
README less more
0 1) Type ./configure
1 2) make
2 3) make install (as root)
3
4 Make sure you copy the .gtkwaverc file to your home directory or to your
5 VCD project directory. It contains the prefs for a good configuration
6 that most people find ergonomic. It is not strictly necessary however.
7
8 [Note: for mingw builds with gtk+-1, you might need a fake gtk-config file like
9 the following..]
10
11 <<snip>>
12 #!/bin/sh
13
14 if [ "$1" == "--libs" ]
15 then
16 echo -L/home/bybell/libs -lgck -lgdk-1.3 -lgimp-1.2 -lgimpi -lgimpui-1.2 -lglib-1.3 -lgmodule-1.3 -lgnu-intl -lgobject-1.3 -lgthread-1.3 -lgtk-1.3 -liconv-1.3 -ljpeg -llibgplugin_a -llibgplugin_b -lpng -lpthread32 -ltiff-lzw -ltiff-nolzw -ltiff
17 fi
18
19 if [ "$1" == "--cflags" ]
20 then
21 echo " -mms-bitfields -I/home/bybell/src/glib -I/home/bybell/src/gtk+/gtk -I/home/bybell/src/gtk+/gdk -I/home/bybell/src/gtk+ "
22 fi
23 <<snip>>
24
25 [Note2: for mingw with gtk+-2, you don't need to do anything except have
26 pkg-config in your PATH however the following note is from Thomas Uhle.]
27
28 Important to know is to compile with CFLAGS=-mms-bitfields in Windows in order to link correctly
29 to the GTK+ dlls. This is how I did configure GTKWave with additional optimisation switches:
30
31 ./configure CFLAGS='-Wall -O3 -mcpu=i686 -mms-bitfields -ffast-math -fstrict-aliasing'
32
33 After that you may just call make the usual way.
34
35
36
37 Note that Ver Structural Verilog Compiler AET files are no longer supported.
38 They have been superceded by LXT. Also note that the AMULET group will be
39 taking over maintenance of the viewer effective immediately.
40
41 -251201ajb bybell@nc.rr.com
42
43
44 AMULET has ceased development of the 2.x branch of the viewer. 1.3
45 apparently is the only active version currently.
46
47 -150405ajb bybell@nc.rr.com
48
49
50 The 1.3 series has been promoted to 3.x in order to prevent confusion over
51 what version of the viewer is the latest. Starting with 3.x, the viewer
52 supports source code annotation.
53
54 -030406ajb bybell@nc.rr.com
55
56
57 Add these flags to your compile for new warnings on AMD64:
58 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic
59
60 on i386:
61 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables
62
63 -150407ajb
64
65
66 For cvs access to the experimental, pre-release sourcetree on Sourceforge:
67 cvs -d:pserver:anonymous@gtkwave.cvs.sourceforge.net:/cvsroot/gtkwave login
68 [press enter]
69 cvs -z3 -d:pserver:anonymous@gtkwave.cvs.sourceforge.net:/cvsroot/gtkwave co -P gtkwave3
70
71 -191208ajb bybell@nc.rr.com
72
73
74 CVS is no longer being updated, for SVN access:
75 svn co https://gtkwave.svn.sourceforge.net/svnroot/gtkwave gtkwave
76
77 -310511ajb
78
79 ===============================================================================
80
81 Note (1) For Ubuntu users:
82
83 I had to do the following to get it to install directly. Please
84 include in INSTALL .txt as an option for ubuntu users. Other linux
85 distributions might have other things to do.
86
87 sudo apt-get install libgtk2.0-dev
88 ./configure --with-tcl=/usr/lib/tcl8.4 --with-tk=/usr/lib/tk8.4
89
90 -030109ajb bybell@nc.rr.com
91
92
93 Note (2) For Ubuntu users:
94
95 If your compile fails because gzopen64 cannot be found, you will either have
96 to fix your Ubuntu install or use the version of libz in gtkwave:
97
98 ./configure --enable-local-libz
99
100 -140409ajb bybell@nc.rr.com
101
102 Note (3) For Ubuntu users (version 11.10):
103
104 sudo apt-get install libjudy-dev
105 sudo apt-get install libbz2-dev
106 sudo apt-get install liblzma-dev
107 sudo apt-get install libgconf2-dev
108 sudo apt-get install libgtk2.0-dev
109 sudo apt-get install tcl-dev
110 sudo apt-get install tk-dev
111 sudo apt-get install gperf
112 sudo apt-get install gtk2-engines-pixbuf
113
114 Configure then as:
115
116 ./configure --enable-judy --enable-struct-pack --with-gconf
117
118 -010212ajb bybell@nc.rr.com
119
120 ===============================================================================
121
122 Notes for Mac OSX users:
123
124 Install MacPorts then
125
126 sudo port -v selfupdate
127 sudo port install Judy tcl tk xz-devel gtk2
128
129 If Quartz is used:
130 sudo port install gtk-osx-application
131
132 ./configure --prefix=/opt/local --enable-judy --enable-struct-pack "CFLAGS=-I/opt/local/include -O2 -g" LDFLAGS=-L/opt/local/lib --no-create --no-recursion
133
134 Tcl works in the OSX version of gtkwave starting with version 3.3.26.
135
136 At this point all features working on Linux should be functional on the Mac,
137 except that twinwave does not render to a single window when Quartz is used
138 instead of X11.
139
140 If you wish to use llvm, also add "CC=llvm-gcc" and change the "-O2" in CFLAGS
141 to "-O4".
142
143 At the current time Quartz support is experimental. Please report any bugs
144 encountered as compared to X11 function.
145
146 ===
147
148 Note that the preferred environment for Quartz builds is jhbuild. To build
149 gtkwave as an app bundle (while in jhbuild shell):
150
151 ./configure --enable-judy --enable-struct-pack --prefix=/Users/$USER/gtk/inst
152 make
153 make install
154 cd contrib/bundle_for_osx
155 ./make_bundle.sh
156
157 This assumes that Judy arrays and XZ were both already compiled and installed.
158 If Judy arrays are not installed, do not add --enable-judy.
159 If XZ is not installed, add --disable-xz.
160
161 The current environment used is modulesets. Bug 664894 has an interim fix in
162 the binary distribution by applying patches using the
163 contrib/bundle_for_osx/gtk_diff_against_modulesets.patch file.
164
165 -311211ajb bybell@nc.rr.com
166
167 ===============================================================================
168
169 MSYS2 notes for creating a working environment for compiling gtkwave:
170
171 pacman -Syuu
172 [repeat "pacman -Syuu" multiple times until environment stabilizes]
173 pacman -S --needed base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain git subversion mercurial mingw-w64-i686-cmake mingw-w64-x86_64-cmake
174 pacman -S base-devel mingw-w64-toolchain mingw-w64-i686-gtk2
175 pacman -S mingw-w64-i686-gtk2
176 pacman -S mingw-w64-x86_64-gtk2
177 pacman -S mingw-w64-i686-gtk3
178 pacman -S mingw-w64-x86_64-gtk3
179
180 -121217ajb bybell@rocketmail.com
181
182 ===============================================================================
183
184 Add --enable-gtk3 to the ./configure invocation to build against GTK3.
185
186 --enable-gtk3 Causes the GTK+ frontend to be built with gtk3
187 instead of gtk2.
188
189 -150718ajb bybell@rocketmail.com
190
191 ===============================================================================
0 # GTKWave
1
2 ## Installation
3
4 2) If you compile a GIT version: Type `./autogen.sh`
5 2) Type `./configure --enable-gtk3` (or `./configure` for GTK+ 2)
6 3) `make`
7 4) `make install` (as root)
8
9 Make sure you copy the `.gtkwaverc` file to your home directory or to your
10 VCD project directory. It contains the prefs for a good configuration
11 that most people find ergonomic. It is not strictly necessary however.
12
13 [Note: for mingw with gtk+-2, you don't need to do anything except have
14 pkg-config in your PATH however the following note is from Thomas Uhle.]
15
16 Important to know is to compile with `CFLAGS=-mms-bitfields` in Windows in order to link correctly
17 to the GTK+ dlls. This is how I did configure GTKWave with additional optimisation switches:
18
19 ```sh
20 ./configure CFLAGS='-Wall -O3 -mcpu=i686 -mms-bitfields -ffast-math -fstrict-aliasing'
21 ```
22
23 After that you may just call make the usual way.
24
25 ## Misc. Notes
26
27 Note that Ver Structural Verilog Compiler AET files are no longer supported.
28 They have been superceded by LXT. Also note that the AMULET group will be
29 taking over maintenance of the viewer effective immediately.
30
31
32 Add these flags to your compile for new warnings on AMD64:
33 `-g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic`
34
35 on i386:
36 `-g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables`
37
38 ## Note (1) For Ubuntu users:
39
40 I had to do the following to get it to install directly. Please
41 include in INSTALL .txt as an option for ubuntu users. Other linux
42 distributions might have other things to do.
43
44 ```sh
45 sudo apt-get install libgtk2.0-dev
46 ./configure --with-tcl=/usr/lib/tcl8.4 --with-tk=/usr/lib/tk8.4
47 ```
48
49
50 ## Note (2) For Ubuntu users:
51
52 If your compile fails because gzopen64 cannot be found, you will either have
53 to fix your Ubuntu install or use the version of libz in gtkwave:
54
55 ```sh
56 ./configure --enable-local-libz
57 ```
58
59 ## Note (3) For Ubuntu users (version 11.10):
60
61 ```sh
62 sudo apt-get install libjudy-dev
63 sudo apt-get install libbz2-dev
64 sudo apt-get install liblzma-dev
65 sudo apt-get install libgconf2-dev
66 sudo apt-get install libgtk2.0-dev
67 sudo apt-get install tcl-dev
68 sudo apt-get install tk-dev
69 sudo apt-get install gperf
70 sudo apt-get install gtk2-engines-pixbuf
71 ```
72
73 Configure then as:
74
75 ```sh
76 ./configure --enable-judy --enable-struct-pack --with-gconf
77 ```
78
79
80 ## Notes for Mac OSX users:
81
82 Install MacPorts then
83
84 ```sh
85 sudo port -v selfupdate
86 sudo port install Judy tcl tk xz-devel gtk2
87 ```
88
89 If Quartz is used:
90
91 ```sh
92 sudo port install gtk-osx-application
93
94 ./configure --prefix=/opt/local --enable-judy --enable-struct-pack "CFLAGS=-I/opt/local/include -O2 -g" LDFLAGS=-L/opt/local/lib --no-create --no-recursion
95 ```
96
97 Tcl works in the OSX version of gtkwave starting with version 3.3.26.
98
99 At this point all features working on Linux should be functional on the Mac,
100 except that twinwave does not render to a single window when Quartz is used
101 instead of X11.
102
103 If you wish to use llvm, also add `CC=llvm-gcc` and change the `-O2` in CFLAGS
104 to `-O4`.
105
106 At the current time Quartz support is experimental. Please report any bugs
107 encountered as compared to X11 function.
108
109 Note that the preferred environment for Quartz builds is jhbuild. To build
110 gtkwave as an app bundle (while in jhbuild shell):
111
112 ```sh
113 ./configure --enable-judy --enable-struct-pack --prefix=/Users/$USER/gtk/inst
114 make
115 make install
116 cd contrib/bundle_for_osx
117 ./make_bundle.sh
118 ```
119
120 This assumes that Judy arrays and XZ were both already compiled and installed.
121 If Judy arrays are not installed, do not add `--enable-judy`.
122 If XZ is not installed, add `--disable-xz`.
123
124 The current environment used is modulesets. Bug 664894 has an interim fix in
125 the binary distribution by applying patches using the
126 `contrib/bundle_for_osx/gtk_diff_against_modulesets.patch` file.
127
128 ## MSYS2 notes for creating a working environment for compiling gtkwave:
129
130 ```sh
131 pacman -Syuu
132 [repeat "pacman -Syuu" multiple times until environment stabilizes]
133 pacman -S --needed base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain git subversion mercurial mingw-w64-i686-cmake mingw-w64-x86_64-cmake
134 pacman -S base-devel mingw-w64-toolchain mingw-w64-i686-gtk2
135 pacman -S mingw-w64-i686-gtk2
136 pacman -S mingw-w64-x86_64-gtk2
137 pacman -S mingw-w64-i686-gtk3
138 pacman -S mingw-w64-x86_64-gtk3
139 ```
140
141
142 Add `--enable-gtk3` to the `./configure` invocation to build against GTK3.
143 This causes the GTK+ frontend to be built with gtk3 instead of gtk2.
144
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for gtkwave-gtk3 3.3.114.
2 # Generated by GNU Autoconf 2.69 for gtkwave-gtk3 3.3.115.
33 #
44 # Report bugs to <bybell@rocketmail.com>.
55 #
579579 # Identity of this package.
580580 PACKAGE_NAME='gtkwave-gtk3'
581581 PACKAGE_TARNAME='gtkwave-gtk3'
582 PACKAGE_VERSION='3.3.114'
583 PACKAGE_STRING='gtkwave-gtk3 3.3.114'
582 PACKAGE_VERSION='3.3.115'
583 PACKAGE_STRING='gtkwave-gtk3 3.3.115'
584584 PACKAGE_BUGREPORT='bybell@rocketmail.com'
585585 PACKAGE_URL=''
586586
13941394 # Omit some internal or obsolete options to make the list less imposing.
13951395 # This message is too long to be a string in the A/UX 3.1 sh.
13961396 cat <<_ACEOF
1397 \`configure' configures gtkwave-gtk3 3.3.114 to adapt to many kinds of systems.
1397 \`configure' configures gtkwave-gtk3 3.3.115 to adapt to many kinds of systems.
13981398
13991399 Usage: $0 [OPTION]... [VAR=VALUE]...
14001400
14601460
14611461 if test -n "$ac_init_help"; then
14621462 case $ac_init_help in
1463 short | recursive ) echo "Configuration of gtkwave-gtk3 3.3.114:";;
1463 short | recursive ) echo "Configuration of gtkwave-gtk3 3.3.115:";;
14641464 esac
14651465 cat <<\_ACEOF
14661466
16081608 test -n "$ac_init_help" && exit $ac_status
16091609 if $ac_init_version; then
16101610 cat <<\_ACEOF
1611 gtkwave-gtk3 configure 3.3.114
1611 gtkwave-gtk3 configure 3.3.115
16121612 generated by GNU Autoconf 2.69
16131613
16141614 Copyright (C) 2012 Free Software Foundation, Inc.
22522252 This file contains any messages produced by compilers while
22532253 running configure, to aid debugging if configure makes a mistake.
22542254
2255 It was created by gtkwave-gtk3 $as_me 3.3.114, which was
2255 It was created by gtkwave-gtk3 $as_me 3.3.115, which was
22562256 generated by GNU Autoconf 2.69. Invocation command line was
22572257
22582258 $ $0 $@
31193119
31203120 # Define the identity of the package.
31213121 PACKAGE='gtkwave-gtk3'
3122 VERSION='3.3.114'
3122 VERSION='3.3.115'
31233123
31243124
31253125 cat >>confdefs.h <<_ACEOF
1156711567 # report actual input values of CONFIG_FILES etc. instead of their
1156811568 # values after options handling.
1156911569 ac_log="
11570 This file was extended by gtkwave-gtk3 $as_me 3.3.114, which was
11570 This file was extended by gtkwave-gtk3 $as_me 3.3.115, which was
1157111571 generated by GNU Autoconf 2.69. Invocation command line was
1157211572
1157311573 CONFIG_FILES = $CONFIG_FILES
1163311633 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1163411634 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1163511635 ac_cs_version="\\
11636 gtkwave-gtk3 config.status 3.3.114
11636 gtkwave-gtk3 config.status 3.3.115
1163711637 configured by $0, generated by GNU Autoconf 2.69,
1163811638 with options \\"\$ac_cs_config\\"
1163911639
11 # Process this file with autoconf to produce a configure script.
22
33 AC_PREREQ(2.59)
4 AC_INIT(gtkwave-gtk3, 3.3.114, bybell@rocketmail.com)
4 AC_INIT(gtkwave-gtk3, 3.3.115, bybell@rocketmail.com)
55 AC_CONFIG_SRCDIR([src/vcd.c])
66 AM_INIT_AUTOMAKE
77 AC_CONFIG_HEADER([config.h])
77 <key>CFBundleExecutable</key>
88 <string>gtkwave</string>
99 <key>CFBundleGetInfoString</key>
10 <string>3.3.114, (C) 1999-2023 Tony Bybell http://gtkwave.sourceforge.net</string>
10 <string>3.3.115, (C) 1999-2023 Tony Bybell http://gtkwave.sourceforge.net</string>
1111 <key>CFBundleIconFile</key>
1212 <string>gtkwave.icns</string>
1313 <key>CFBundleIdentifier</key>
1717 <key>CFBundlePackageType</key>
1818 <string>APPL</string>
1919 <key>CFBundleShortVersionString</key>
20 <string>3.3.114</string>
20 <string>3.3.115</string>
2121 <key>CFBundleSignature</key>
2222 <string>????</string>
2323 <key>CFBundleVersion</key>
24 <string>3.3.114</string>
24 <string>3.3.115</string>
2525 <key>NSHumanReadableCopyright</key>
2626 <string>Copyright 1999 - 2023 Tony Bybell, GNU General Public License.</string>
2727 <key>LSMinimumSystemVersion</key>
0 ## -*- makefile -*-
1 ##
2 ## To compile this, add AC_PROG_LIBTOOL to configure.ac
3 ## also add contrib/vpi/Makefile to AC_CONFIG_FILES
4 ## also run libtoolize to generate ltmain.sh.
5 ##
6 ## This is not built by default. In the future this will be a normal part of
7 ## the build process.
8 ##
9 ## Note that this explicitly uses the libz library found in this
10 ## distro as this might be necessary if your simulator is not already linked
11 ## against it.
12 ##
13 ## 20jan09ajb
14 ##
15
16 lib_LTLIBRARIES= libsysfst.la
17
18 libsysvzt_la_SOURCES= ../../src/libz/adler32.c ../../src/libz/compress.c ../../src/libz/crc32.c ../../src/libz/crc32.h \
19 ../../src/libz/deflate.c ../../src/libz/deflate.h ../../src/libz/gzio.c ../../src/libz/infback.c ../../src/libz/inffast.c \
20 ../../src/libz/inffast.h ../../src/libz/inffixed.h ../../src/libz/inflate.c ../../src/libz/inflate.h \
21 ../../src/libz/inftrees.c ../../src/libz/inftrees.h ../../src/libz/trees.c ../../src/libz/trees.h ../../src/libz/uncompr.c \
22 ../../src/libz/zconf.h ../../src/libz/zlib.h ../../src/libz/zutil.c ../../src/libz/zutil.h \
23 ../../src/helpers/fst/fstapi.c ../../src/helpers/fst/fstapi.h ../../src/helpers/fst/fastlz.c ../../src/helpers/fst/fastlz.h \
24 sys_fst.c
25
26
27 libsysfst_la_LDFLAGS = -version-info 1:0:0
28
29 AM_CFLAGS= -I../../src/libz/ -I../../src/helpers/fst/ -I.
0 /*****************************************************************************
1 * acc_user.h
2 *
3 * IEEE 1364-2000 Verilog HDL Programming Language Interface (PLI).
4 *
5 * This file contains the constant definitions, structure definitions, and
6 * routine declarations for the Verilog Programming Language Interface ACC
7 * access routines.
8 *
9 ****************************************************************************/
10
11 #ifndef ACC_USER_H
12 #define ACC_USER_H
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18
19 /*---------------------------------------------------------------------------*/
20 /*--------------------------- Portability Help ------------------------------*/
21 /*---------------------------------------------------------------------------*/
22 /* Sized variables */
23 #ifndef PLI_TYPES
24 #define PLI_TYPES
25 typedef int PLI_INT32;
26 typedef unsigned int PLI_UINT32;
27 typedef short PLI_INT16;
28 typedef unsigned short PLI_UINT16;
29 typedef char PLI_BYTE8;
30 typedef unsigned char PLI_UBYTE8;
31 #endif
32
33 /* export a symbol */
34 #if WIN32
35 #ifndef PLI_DLLISPEC
36 #define PLI_DLLISPEC __declspec(dllimport)
37 #define ACC_USER_DEFINED_DLLISPEC 1
38 #endif
39 #else
40 #ifndef PLI_DLLISPEC
41 #define PLI_DLLISPEC
42 #endif
43 #endif
44
45 /* import a symbol */
46 #if WIN32
47 #ifndef PLI_DLLESPEC
48 #define PLI_DLLESPEC __declspec(dllexport)
49 #define ACC_USER_DEFINED_DLLESPEC 1
50 #endif
51 #else
52 #ifndef PLI_DLLESPEC
53 #define PLI_DLLESPEC
54 #endif
55 #endif
56
57 /* mark a function as external */
58 #ifndef PLI_EXTERN
59 #define PLI_EXTERN
60 #endif
61
62 /* mark a variable as external */
63 #ifndef PLI_VEXTERN
64 #define PLI_VEXTERN extern
65 #endif
66
67 #ifndef PLI_PROTOTYPES
68 #define PLI_PROTOTYPES
69 #define PROTO_PARAMS(params) params
70 /* object is imported by the application */
71 #define XXTERN PLI_EXTERN PLI_DLLISPEC
72 /* object is exported by the application */
73 #define EETERN PLI_EXTERN PLI_DLLESPEC
74 #endif
75
76 /*
77 * The following group of defines exists purely for backwards compatibility
78 */
79 #ifndef PLI_EXTRAS
80 #define PLI_EXTRAS
81 #define bool int
82 #define true 1
83 #define TRUE 1
84 #define false 0
85 #define FALSE 0
86 #define null 0L
87 #endif
88
89
90 /*---------------------------------------------------------------------------*/
91 /*------------------------------- definitions -------------------------------*/
92 /*---------------------------------------------------------------------------*/
93
94 /*----------------------------- general defines -----------------------------*/
95 typedef PLI_INT32 *HANDLE;
96 #ifndef VPI_USER_CDS_H
97 typedef PLI_INT32 *handle;
98 #endif
99
100 /*------------------------------- object types ------------------------------*/
101 #define accModule 20
102 #define accScope 21
103 #define accNet 25
104 #define accReg 30
105 #define accRegister accReg
106 #define accPort 35
107 #define accTerminal 45
108 #define accInputTerminal 46
109 #define accOutputTerminal 47
110 #define accInoutTerminal 48
111 #define accCombPrim 140
112 #define accSeqPrim 142
113 #define accAndGate 144
114 #define accNandGate 146
115 #define accNorGate 148
116 #define accOrGate 150
117 #define accXorGate 152
118 #define accXnorGate 154
119 #define accBufGate 156
120 #define accNotGate 158
121 #define accBufif0Gate 160
122 #define accBufif1Gate 162
123 #define accNotif0Gate 164
124 #define accNotif1Gate 166
125 #define accNmosGate 168
126 #define accPmosGate 170
127 #define accCmosGate 172
128 #define accRnmosGate 174
129 #define accRpmosGate 176
130 #define accRcmosGate 178
131 #define accRtranGate 180
132 #define accRtranif0Gate 182
133 #define accRtranif1Gate 184
134 #define accTranGate 186
135 #define accTranif0Gate 188
136 #define accTranif1Gate 190
137 #define accPullupGate 192
138 #define accPulldownGate 194
139 #define accIntegerParam 200
140 #define accIntParam accIntegerParam
141 #define accRealParam 202
142 #define accStringParam 204
143 #define accPath 206
144 #define accTchk 208
145 #define accPrimitive 210
146 #define accBit 212
147 #define accPortBit 214
148 #define accNetBit 216
149 #define accRegBit 218
150 #define accParameter 220
151 #define accSpecparam 222
152 #define accTopModule 224
153 #define accModuleInstance 226
154 #define accCellInstance 228
155 #define accModPath 230
156 #define accWirePath 234
157 #define accInterModPath 236
158 #define accScalarPort 250
159 #define accBitSelectPort 252
160 #define accPartSelectPort 254
161 #define accVectorPort 256
162 #define accConcatPort 258
163 #define accWire 260
164 #define accWand 261
165 #define accWor 262
166 #define accTri 263
167 #define accTriand 264
168 #define accTrior 265
169 #define accTri0 266
170 #define accTri1 267
171 #define accTrireg 268
172 #define accSupply0 269
173 #define accSupply1 270
174 #define accNamedEvent 280
175 #define accEventVar accNamedEvent
176 #define accIntegerVar 281
177 #define accIntVar 281
178 #define accRealVar 282
179 #define accTimeVar 283
180 #define accScalar 300
181 #define accVector 302
182 #define accCollapsedNet 304
183 #define accExpandedVector 306
184 #define accUnExpandedVector 307
185 #define accProtected 308
186 #define accSetup 366
187 #define accHold 367
188 #define accWidth 368
189 #define accPeriod 369
190 #define accRecovery 370
191 #define accSkew 371
192 #define accNochange 376
193 #define accNoChange accNochange
194 #define accSetuphold 377
195 #define accInput 402
196 #define accOutput 404
197 #define accInout 406
198 #define accMixedIo 407
199 #define accPositive 408
200 #define accNegative 410
201 #define accUnknown 412
202 #define accPathTerminal 420
203 #define accPathInput 422
204 #define accPathOutput 424
205 #define accDataPath 426
206 #define accTchkTerminal 428
207 #define accBitSelect 500
208 #define accPartSelect 502
209 #define accTask 504
210 #define accFunction 506
211 #define accStatement 508
212 #define accTaskCall 510
213 #define accFunctionCall 512
214 #define accSystemTask 514
215 #define accSystemFunction 516
216 #define accSystemRealFunction 518
217 #define accUserTask 520
218 #define accUserFunction 522
219 #define accUserRealFunction 524
220 #define accNamedBeginStat 560
221 #define accNamedForkStat 564
222 #define accConstant 600
223 #define accConcat 610
224 #define accOperator 620
225 #define accMinTypMax 696
226 #define accModPathHasIfnone 715
227
228 /*------------------ parameter values for acc_configure() -------------------*/
229 #define accPathDelayCount 1
230 #define accPathDelimStr 2
231 #define accDisplayErrors 3
232 #define accDefaultAttr0 4
233 #define accToHiZDelay 5
234 #define accEnableArgs 6
235 #define accDisplayWarnings 8
236 #define accDevelopmentVersion 11
237 #define accMapToMipd 17
238 #define accMinTypMaxDelays 19
239
240 /*------------ edge information used by acc_handle_tchk(), etc. ------------*/
241 #define accNoedge 0
242 #define accNoEdge 0
243 #define accEdge01 1
244 #define accEdge10 2
245 #define accEdge0x 4
246 #define accEdgex1 8
247 #define accEdge1x 16
248 #define accEdgex0 32
249 #define accPosedge 13
250 #define accPosEdge accPosedge
251 #define accNegedge 50
252 #define accNegEdge accNegedge
253
254 /*------------------------------- delay modes -------------------------------*/
255 #define accDelayModeNone 0
256 #define accDelayModePath 1
257 #define accDelayModeDistrib 2
258 #define accDelayModeUnit 3
259 #define accDelayModeZero 4
260 #define accDelayModeMTM 5
261
262 /*------------ values for type field in t_setval_delay structure ------------*/
263 #define accNoDelay 0
264 #define accInertialDelay 1
265 #define accTransportDelay 2
266 #define accPureTransportDelay 3
267 #define accForceFlag 4
268 #define accReleaseFlag 5
269 #define accAssignFlag 6
270 #define accDeassignFlag 7
271
272 /*------------ values for type field in t_setval_value structure ------------*/
273 #define accBinStrVal 1
274 #define accOctStrVal 2
275 #define accDecStrVal 3
276 #define accHexStrVal 4
277 #define accScalarVal 5
278 #define accIntVal 6
279 #define accRealVal 7
280 #define accStringVal 8
281 #define accVectorVal 10
282
283 /*------------------------------ scalar values ------------------------------*/
284 #define acc0 0
285 #define acc1 1
286 #define accX 2
287 #define accZ 3
288
289 /*---------------------------- VCL scalar values ----------------------------*/
290 #define vcl0 acc0
291 #define vcl1 acc1
292 #define vclX accX
293 #define vclx vclX
294 #define vclZ accZ
295 #define vclz vclZ
296
297 /*----------- values for vc_reason field in t_vc_record structure -----------*/
298 #define logic_value_change 1
299 #define strength_value_change 2
300 #define real_value_change 3
301 #define vector_value_change 4
302 #define event_value_change 5
303 #define integer_value_change 6
304 #define time_value_change 7
305 #define sregister_value_change 8
306 #define vregister_value_change 9
307 #define realtime_value_change 10
308
309 /*--------------------------- VCL strength values ---------------------------*/
310 #define vclSupply 7
311 #define vclStrong 6
312 #define vclPull 5
313 #define vclLarge 4
314 #define vclWeak 3
315 #define vclMedium 2
316 #define vclSmall 1
317 #define vclHighZ 0
318
319 /*----------------------- flags used with acc_vcl_add -----------------------*/
320 #define vcl_verilog_logic 2
321 #define VCL_VERILOG_LOGIC vcl_verilog_logic
322 #define vcl_verilog_strength 3
323 #define VCL_VERILOG_STRENGTH vcl_verilog_strength
324
325 /*---------------------- flags used with acc_vcl_delete ---------------------*/
326 #define vcl_verilog vcl_verilog_logic
327 #define VCL_VERILOG vcl_verilog
328
329 /*---------- values for the type field in the t_acc_time structure --------- */
330 #define accTime 1
331 #define accSimTime 2
332 #define accRealTime 3
333
334 /*------------------------------ product types ------------------------------*/
335 #define accSimulator 1
336 #define accTimingAnalyzer 2
337 #define accFaultSimulator 3
338 #define accOther 4
339
340
341 /*---------------------------------------------------------------------------*/
342 /*-------------------------- structure definitions --------------------------*/
343 /*---------------------------------------------------------------------------*/
344
345 typedef PLI_INT32 (*consumer_function)();
346
347 /*----------------- data structure used with acc_set_value() ----------------*/
348 typedef struct t_acc_time
349 {
350 PLI_INT32 type;
351 PLI_INT32 low,
352 high;
353 double real;
354 } s_acc_time, *p_acc_time;
355
356 /*----------------- data structure used with acc_set_value() ----------------*/
357 typedef struct t_setval_delay
358 {
359 s_acc_time time;
360 PLI_INT32 model;
361 } s_setval_delay, *p_setval_delay;
362
363 /*--------------------- data structure of vector values ---------------------*/
364 typedef struct t_acc_vecval
365 {
366 PLI_INT32 aval;
367 PLI_INT32 bval;
368 } s_acc_vecval, *p_acc_vecval;
369
370 /*------ data structure used with acc_set_value() and acc_fetch_value() -----*/
371 typedef struct t_setval_value
372 {
373 PLI_INT32 format;
374 union
375 {
376 PLI_BYTE8 *str;
377 PLI_INT32 scalar;
378 PLI_INT32 integer;
379 double real;
380 p_acc_vecval vector;
381 } value;
382 } s_setval_value, *p_setval_value, s_acc_value, *p_acc_value;
383
384 /*----------------------- structure for VCL strengths -----------------------*/
385 typedef struct t_strengths
386 {
387 PLI_UBYTE8 logic_value;
388 PLI_UBYTE8 strength1;
389 PLI_UBYTE8 strength2;
390 } s_strengths, *p_strengths;
391
392 /*--------------- structure passed to callback routine for VCL --------------*/
393 typedef struct t_vc_record
394 {
395 PLI_INT32 vc_reason;
396 PLI_INT32 vc_hightime;
397 PLI_INT32 vc_lowtime;
398 PLI_BYTE8 *user_data;
399 union
400 {
401 PLI_UBYTE8 logic_value;
402 double real_value;
403 handle vector_handle;
404 s_strengths strengths_s;
405 } out_value;
406 } s_vc_record, *p_vc_record;
407
408 /*------------- structure used with acc_fetch_location() routine ------------*/
409 typedef struct t_location
410 {
411 PLI_INT32 line_no;
412 PLI_BYTE8 *filename;
413 } s_location, *p_location;
414
415 /*---------- structure used with acc_fetch_timescale_info() routine ---------*/
416 typedef struct t_timescale_info
417 {
418 PLI_INT16 unit;
419 PLI_INT16 precision;
420 } s_timescale_info, *p_timescale_info;
421
422
423 /*---------------------------------------------------------------------------*/
424 /*-------------------------- routine declarations ---------------------------*/
425 /*---------------------------------------------------------------------------*/
426
427 XXTERN PLI_INT32 acc_append_delays PROTO_PARAMS((handle object, ...));
428 XXTERN PLI_INT32 acc_append_pulsere PROTO_PARAMS((handle object, double val1r, double val1x, ...));
429 XXTERN void acc_close PROTO_PARAMS((void));
430 XXTERN handle *acc_collect PROTO_PARAMS((handle (*p_next_routine)(), handle scope_object, PLI_INT32 *aof_count));
431 XXTERN PLI_INT32 acc_compare_handles PROTO_PARAMS((handle h1, handle h2));
432 XXTERN PLI_INT32 acc_configure PROTO_PARAMS((PLI_INT32 item, PLI_BYTE8 *value));
433 XXTERN PLI_INT32 acc_count PROTO_PARAMS((handle (*next_func)(), handle object_handle));
434 XXTERN PLI_INT32 acc_fetch_argc PROTO_PARAMS((void));
435 XXTERN PLI_BYTE8 **acc_fetch_argv PROTO_PARAMS((void));
436 XXTERN double acc_fetch_attribute PROTO_PARAMS((handle object, ...));
437 XXTERN PLI_INT32 acc_fetch_attribute_int PROTO_PARAMS((handle object, ...));
438 XXTERN PLI_BYTE8 *acc_fetch_attribute_str PROTO_PARAMS((handle object, ...));
439 XXTERN PLI_BYTE8 *acc_fetch_defname PROTO_PARAMS((handle object_handle));
440 XXTERN PLI_INT32 acc_fetch_delay_mode PROTO_PARAMS((handle object_p));
441 XXTERN PLI_INT32 acc_fetch_delays PROTO_PARAMS((handle object, ...));
442 XXTERN PLI_INT32 acc_fetch_direction PROTO_PARAMS((handle object_handle));
443 XXTERN PLI_INT32 acc_fetch_edge PROTO_PARAMS((handle acc_obj));
444 XXTERN PLI_BYTE8 *acc_fetch_fullname PROTO_PARAMS((handle object_handle));
445 XXTERN PLI_INT32 acc_fetch_fulltype PROTO_PARAMS((handle object_h));
446 XXTERN PLI_INT32 acc_fetch_index PROTO_PARAMS((handle object_handle));
447 XXTERN double acc_fetch_itfarg PROTO_PARAMS((PLI_INT32 n, handle tfinst));
448 XXTERN PLI_INT32 acc_fetch_itfarg_int PROTO_PARAMS((PLI_INT32 n, handle tfinst));
449 XXTERN PLI_BYTE8 *acc_fetch_itfarg_str PROTO_PARAMS((PLI_INT32 n, handle tfinst));
450 XXTERN PLI_INT32 acc_fetch_location PROTO_PARAMS((p_location location_p, handle object));
451 XXTERN PLI_BYTE8 *acc_fetch_name PROTO_PARAMS((handle object_handle));
452 XXTERN PLI_INT32 acc_fetch_paramtype PROTO_PARAMS((handle param_p));
453 XXTERN double acc_fetch_paramval PROTO_PARAMS((handle param));
454 XXTERN PLI_INT32 acc_fetch_polarity PROTO_PARAMS((handle path));
455 XXTERN PLI_INT32 acc_fetch_precision PROTO_PARAMS((void));
456 XXTERN PLI_INT32 acc_fetch_pulsere PROTO_PARAMS((handle path_p, double *val1r, double *val1e, ...));
457 XXTERN PLI_INT32 acc_fetch_range PROTO_PARAMS((handle node, PLI_INT32 *msb, PLI_INT32 *lsb));
458 XXTERN PLI_INT32 acc_fetch_size PROTO_PARAMS((handle obj_h));
459 XXTERN double acc_fetch_tfarg PROTO_PARAMS((PLI_INT32 n));
460 XXTERN PLI_INT32 acc_fetch_tfarg_int PROTO_PARAMS((PLI_INT32 n));
461 XXTERN PLI_BYTE8 *acc_fetch_tfarg_str PROTO_PARAMS((PLI_INT32 n));
462 XXTERN void acc_fetch_timescale_info PROTO_PARAMS((handle obj, p_timescale_info aof_timescale_info));
463 XXTERN PLI_INT32 acc_fetch_type PROTO_PARAMS((handle object_handle));
464 XXTERN PLI_BYTE8 *acc_fetch_type_str PROTO_PARAMS((PLI_INT32 type));
465 XXTERN PLI_BYTE8 *acc_fetch_value PROTO_PARAMS((handle object_handle, PLI_BYTE8 *format_str, p_acc_value acc_value_p));
466 XXTERN void acc_free PROTO_PARAMS((handle *array_ptr));
467 XXTERN handle acc_handle_by_name PROTO_PARAMS((PLI_BYTE8 *inst_name, handle scope_p));
468 XXTERN handle acc_handle_condition PROTO_PARAMS((handle obj));
469 XXTERN handle acc_handle_conn PROTO_PARAMS((handle term_p));
470 XXTERN handle acc_handle_datapath PROTO_PARAMS((handle path));
471 XXTERN handle acc_handle_hiconn PROTO_PARAMS((handle port_ref));
472 XXTERN handle acc_handle_interactive_scope PROTO_PARAMS((void));
473 XXTERN handle acc_handle_itfarg PROTO_PARAMS((PLI_INT32 n, handle tfinst));
474 XXTERN handle acc_handle_loconn PROTO_PARAMS((handle port_ref));
475 XXTERN handle acc_handle_modpath PROTO_PARAMS((handle mod_p, PLI_BYTE8 *pathin_name, PLI_BYTE8 *pathout_name, ...));
476 XXTERN handle acc_handle_notifier PROTO_PARAMS((handle tchk));
477 XXTERN handle acc_handle_object PROTO_PARAMS((PLI_BYTE8 *inst_name, ...));
478 XXTERN handle acc_handle_parent PROTO_PARAMS((handle object_p));
479 XXTERN handle acc_handle_path PROTO_PARAMS((handle source, handle destination));
480 XXTERN handle acc_handle_pathin PROTO_PARAMS((handle path_p));
481 XXTERN handle acc_handle_pathout PROTO_PARAMS((handle path_p));
482 XXTERN handle acc_handle_port PROTO_PARAMS((handle mod_handle, PLI_INT32 port_num, ...));
483 XXTERN handle acc_handle_scope PROTO_PARAMS((handle object));
484 XXTERN handle acc_handle_simulated_net PROTO_PARAMS((handle net_h));
485 XXTERN handle acc_handle_tchk PROTO_PARAMS((handle mod_p, PLI_INT32 tchk_type, PLI_BYTE8 *arg1_conn_name, PLI_INT32 arg1_edgetype, ...));
486 XXTERN handle acc_handle_tchkarg1 PROTO_PARAMS((handle tchk));
487 XXTERN handle acc_handle_tchkarg2 PROTO_PARAMS((handle tchk));
488 XXTERN handle acc_handle_terminal PROTO_PARAMS((handle gate_handle, PLI_INT32 terminal_index));
489 XXTERN handle acc_handle_tfarg PROTO_PARAMS((PLI_INT32 n));
490 XXTERN handle acc_handle_tfinst PROTO_PARAMS((void));
491 XXTERN PLI_INT32 acc_initialize PROTO_PARAMS((void));
492 XXTERN handle acc_next PROTO_PARAMS((PLI_INT32 *type_list, handle h_scope, handle h_object));
493 XXTERN handle acc_next_bit PROTO_PARAMS ((handle vector, handle bit));
494 XXTERN handle acc_next_cell PROTO_PARAMS((handle scope, handle cell));
495 XXTERN handle acc_next_cell_load PROTO_PARAMS((handle net_handle, handle load));
496 XXTERN handle acc_next_child PROTO_PARAMS((handle mod_handle, handle child));
497 XXTERN handle acc_next_driver PROTO_PARAMS((handle net, handle driver));
498 XXTERN handle acc_next_hiconn PROTO_PARAMS((handle port, handle hiconn));
499 XXTERN handle acc_next_input PROTO_PARAMS((handle path, handle pathin));
500 XXTERN handle acc_next_load PROTO_PARAMS((handle net, handle load));
501 XXTERN handle acc_next_loconn PROTO_PARAMS((handle port, handle loconn));
502 XXTERN handle acc_next_modpath PROTO_PARAMS((handle mod_p, handle path));
503 XXTERN handle acc_next_net PROTO_PARAMS((handle mod_handle, handle net));
504 XXTERN handle acc_next_output PROTO_PARAMS((handle path, handle pathout));
505 XXTERN handle acc_next_parameter PROTO_PARAMS((handle module_p, handle param));
506 XXTERN handle acc_next_port PROTO_PARAMS((handle ref_obj_p, handle port));
507 XXTERN handle acc_next_portout PROTO_PARAMS((handle mod_p, handle port));
508 XXTERN handle acc_next_primitive PROTO_PARAMS((handle mod_handle, handle prim));
509 XXTERN handle acc_next_scope PROTO_PARAMS((handle ref_scope_p, handle scope));
510 XXTERN handle acc_next_specparam PROTO_PARAMS((handle module_p, handle sparam));
511 XXTERN handle acc_next_tchk PROTO_PARAMS((handle mod_p, handle tchk));
512 XXTERN handle acc_next_terminal PROTO_PARAMS((handle gate_handle, handle term));
513 XXTERN handle acc_next_topmod PROTO_PARAMS((handle topmod));
514 XXTERN PLI_INT32 acc_object_in_typelist PROTO_PARAMS((handle object, PLI_INT32 *type_list));
515 XXTERN PLI_INT32 acc_object_of_type PROTO_PARAMS((handle object, PLI_INT32 type));
516 XXTERN PLI_INT32 acc_product_type PROTO_PARAMS((void));
517 XXTERN PLI_BYTE8 *acc_product_version PROTO_PARAMS((void));
518 XXTERN PLI_INT32 acc_release_object PROTO_PARAMS((handle obj));
519 XXTERN PLI_INT32 acc_replace_delays PROTO_PARAMS((handle object, ...));
520 XXTERN PLI_INT32 acc_replace_pulsere PROTO_PARAMS((handle object, double val1r, double val1x, ...));
521 XXTERN void acc_reset_buffer PROTO_PARAMS((void));
522 XXTERN PLI_INT32 acc_set_interactive_scope PROTO_PARAMS((handle scope, PLI_INT32 callback_flag));
523 XXTERN PLI_INT32 acc_set_pulsere PROTO_PARAMS((handle path_p, double val1r, double val1e));
524 XXTERN PLI_BYTE8 *acc_set_scope PROTO_PARAMS((handle object, ...));
525 XXTERN PLI_INT32 acc_set_value PROTO_PARAMS((handle obj, p_setval_value setval_p, p_setval_delay delay_p));
526 XXTERN void acc_vcl_add PROTO_PARAMS((handle object_p, PLI_INT32 (*consumer)(p_vc_record), PLI_BYTE8 *user_data, PLI_INT32 vcl_flags));
527 XXTERN void acc_vcl_delete PROTO_PARAMS((handle object_p, PLI_INT32 (*consumer)(p_vc_record), PLI_BYTE8 *user_data, PLI_INT32 vcl_flags));
528 XXTERN PLI_BYTE8 *acc_version PROTO_PARAMS((void));
529
530
531 /*---------------------------------------------------------------------------*/
532 /*----------------------- global variable definitions -----------------------*/
533 /*---------------------------------------------------------------------------*/
534
535 PLI_VEXTERN PLI_DLLISPEC PLI_INT32 acc_error_flag;
536
537
538 /*---------------------------------------------------------------------------*/
539 /*---------------------------- macro definitions ----------------------------*/
540 /*---------------------------------------------------------------------------*/
541
542 #define acc_handle_calling_mod_m acc_handle_parent((handle)tf_getinstance())
543
544 #undef PLI_EXTERN
545 #undef PLI_VEXTERN
546
547 #ifdef ACC_USER_DEFINED_DLLISPEC
548 #undef ACC_USER_DEFINED_DLLISPEC
549 #undef PLI_DLLISPEC
550 #endif
551 #ifdef ACC_USER_DEFINED_DLLESPEC
552 #undef ACC_USER_DEFINED_DLLESPEC
553 #undef PLI_DLLESPEC
554 #endif
555
556 #ifdef PLI_PROTOTYPES
557 #undef PLI_PROTOTYPES
558 #undef PROTO_PARAMS
559 #undef XXTERN
560 #undef EETERN
561 #endif
562
563 #ifdef __cplusplus
564 }
565 #endif
566
567 #endif /* ACC_USER_H */
0 /*
1
2 FST dumper for NC Verilog / Verilog-XL
3 to compile/run under AIX:
4
5 ar -xv /lib/libz.a # to get libz.so.1
6 xlc -O3 -c sys_fst.c fstapi.c fastlz.c
7 ld -G -o sys_fst.so sys_fst.o fstapi.o fastlz.o libz.so.1 -bnoentry -bexpall -lld -lc
8
9 [nc]verilog r.v +loadvpi=sys_fst.so:sys_fst_register +access+r
10
11
12 FST dumper for VCS
13 to compile/run under LINUX:
14
15 gcc -O2 -c -fPIC *.c
16 ld -G -o sys_fst.so ../../src/libz/*.o *.o
17 vcs +v2k -R +vpi +acc+2 +memchbk -full64 t.v -P sys_fst.tab sys_fst.so
18
19 sys_fst.tab:
20
21 $fstdumpfile check=sys_dumpfile_compiletf call=sys_dumpfile_calltf acc+=r:*
22 $fstdumpvars check=sys_dumpvars_compiletf call=sys_dumpvars_calltf acc+=r:*
23 $fstdumpoff check=sys_dumpoff_compiletf call=sys_dumpoff_calltf acc+=r:*
24
25 */
26
27 #include <vpi_user.h>
28 #include <acc_user.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <string.h>
32 #include <assert.h>
33 #include <time.h>
34 #include <inttypes.h>
35 #include "fstapi.h"
36
37 struct fst_info {
38 struct fst_info *dump_chain;
39 vpiHandle item;
40 s_vpi_value value;
41
42 fstHandle fstSym;
43 unsigned is_real:1;
44 unsigned is_changed:1;
45 };
46
47 /*************************************************/
48
49 static struct fstContext *ctx = NULL;
50 static uint64_t prev64 = 0;
51
52 static char *dump_path = NULL;
53
54 static int dump_is_off = 0;
55
56 static struct fst_info *fst_dump_list = 0;
57
58 static int dumpvars_status = 0; /* 0:fresh 1:cb installed,
59 * 2:callback done */
60 static uint64_t dumpvars_time;
61
62
63 static uint64_t
64 timerec_to_time64(s_vpi_time * vt)
65 {
66 uint64_t hi = vt->high;
67 uint64_t lo = vt->low;
68
69 return ((hi << 32) | lo);
70 }
71
72
73 static int
74 dump_header_pending(void)
75 {
76 return (dumpvars_status != 2);
77 }
78
79
80 int variable_cb_rosync(p_cb_data cause);
81
82
83 int
84 variable_cb_rosync(p_cb_data cause)
85 {
86 p_vpi_time tim = cause->time;
87 uint64_t now64 = timerec_to_time64(tim);
88 struct fst_info *a_info = fst_dump_list;
89 s_vpi_value value;
90
91 if((now64 > prev64) || (!now64))
92 {
93 fstWriterEmitTimeChange(ctx, now64);
94 prev64 = now64;
95 }
96
97 while (a_info) {
98 if (!a_info->is_real) {
99 value.value.str = NULL;
100 value.format = vpiBinStrVal;
101
102 vpi_get_value(a_info->item, &value);
103 fstWriterEmitValueChange(ctx, a_info->fstSym, value.value.str);
104 } else {
105 double d;
106 value.format = vpiRealVal;
107
108 vpi_get_value(a_info->item, &value);
109 d = value.value.real;
110 fstWriterEmitValueChange(ctx, a_info->fstSym, &d);
111 }
112
113
114 a_info->is_changed = 0;
115 struct fst_info *a_info_next = a_info->dump_chain;
116 a_info->dump_chain = NULL;
117 a_info = a_info_next;
118 }
119
120 fst_dump_list = NULL;
121 return (0);
122
123 }
124
125
126 static void
127 install_rosync_cb(void)
128 {
129 struct t_cb_data cb;
130 struct t_vpi_time time;
131
132 memset(&cb, 0, sizeof(cb));
133 memset(&time, 0, sizeof(time));
134 time.type = vpiSimTime;
135
136 cb.time = &time;
137 cb.reason = cbReadOnlySynch;
138 cb.cb_rtn = variable_cb_rosync;
139 cb.user_data = NULL;
140 cb.obj = NULL;
141
142 vpi_free_object(vpi_register_cb(&cb));
143 }
144
145
146 int
147 variable_cb(p_cb_data cause)
148 {
149 struct fst_info *info = (struct fst_info *) cause->user_data;
150
151 if (dump_is_off)
152 return (0);
153 if (dump_header_pending())
154 return (0);
155 if (info->is_changed)
156 return (0);
157
158 if (!fst_dump_list) {
159 install_rosync_cb();
160 }
161 info->is_changed = 1;
162 info->dump_chain = fst_dump_list;
163 fst_dump_list = info;
164
165 return (0);
166 }
167
168
169 static int
170 dumpvars_cb(p_cb_data cause)
171 {
172 if (dumpvars_status != 1)
173 return (0);
174
175 dumpvars_status = 2;
176
177 dumpvars_time = timerec_to_time64(cause->time);
178
179 return (0);
180 }
181
182
183 static int
184 install_dumpvars_callback(void)
185 {
186 struct t_cb_data cb;
187 struct t_vpi_time time;
188
189 if (dumpvars_status == 1)
190 return (0);
191
192 if (dumpvars_status == 2) {
193 vpi_mcd_printf(1, "Error:"
194 " $fstdumpvars ignored,"
195 " previously called at simtime %"PRIu64
196 "\n", dumpvars_time);
197 return (1);
198 }
199 memset(&cb, 0, sizeof(cb));
200 memset(&time, 0, sizeof(time));
201 time.type = vpiSimTime;
202 cb.time = &time;
203 cb.reason = cbReadOnlySynch;
204 cb.cb_rtn = dumpvars_cb;
205 cb.user_data = NULL;
206 cb.obj = NULL;
207
208 vpi_free_object(vpi_register_cb(&cb));
209
210 dumpvars_status = 1;
211 return (0);
212 }
213
214
215 static int
216 end_of_sim_cb(p_cb_data cause)
217 {
218 if (ctx)
219 {
220 fstWriterClose(ctx);
221 ctx = NULL;
222 prev64 = 0;
223 }
224 return (0);
225 }
226
227 static int
228 next_time_cb(p_cb_data cause)
229 {
230 struct t_cb_data cb;
231 struct t_vpi_time vtime;
232
233 p_vpi_time tim = cause->time;
234 uint64_t now64 = timerec_to_time64(tim);
235
236 if(now64 > prev64)
237 {
238 fstWriterEmitTimeChange(ctx, now64);
239 prev64 = now64;
240 }
241
242 memset(&cb, 0, sizeof(cb));
243 memset(&vtime, 0, sizeof(vtime));
244
245 vtime.type = vpiSimTime;
246 cb.time = &vtime;
247 cb.reason = cbNextSimTime;
248 cb.cb_rtn = next_time_cb;
249 cb.user_data = NULL;
250 cb.obj = NULL;
251
252 vpi_free_object(vpi_register_cb(&cb));
253
254 return (0);
255 }
256
257
258 static void
259 open_dumpfile(void)
260 {
261 struct t_cb_data cb;
262 struct t_vpi_time vtime;
263
264 if (dump_path == NULL) {
265 dump_path = strdup("dump.fst");
266 }
267 {
268 time_t walltime;
269
270 /*
271 * primary
272 */
273 ctx = fstWriterCreate(dump_path, 1);
274 prev64 = 0;
275 fstWriterSetPackType(ctx, FST_WR_PT_LZ4);
276 /* fstWriterSetParallelMode(ctx, 1); */
277
278 time(&walltime);
279 fstWriterSetDate(ctx, asctime(localtime(&walltime)));
280
281 fstWriterSetVersion(ctx, acc_product_version());
282
283 free(dump_path);
284 dump_path = NULL;
285
286 memset(&cb, 0, sizeof(cb));
287 memset(&vtime, 0, sizeof(vtime));
288
289 vtime.type = vpiSimTime;
290 cb.time = &vtime;
291 cb.reason = cbEndOfSimulation;
292 cb.cb_rtn = end_of_sim_cb;
293 cb.user_data = NULL;
294 cb.obj = NULL;
295
296 vpi_free_object(vpi_register_cb(&cb));
297
298 memset(&cb, 0, sizeof(cb));
299 memset(&vtime, 0, sizeof(vtime));
300
301 vtime.type = vpiSimTime;
302 cb.time = &vtime;
303 cb.reason = cbNextSimTime;
304 cb.cb_rtn = next_time_cb;
305 cb.user_data = NULL;
306 cb.obj = NULL;
307
308 vpi_free_object(vpi_register_cb(&cb));
309 }
310 }
311
312
313 int
314 sys_dumpfile_compiletf(char *name)
315 {
316 vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
317 vpiHandle argv = vpi_iterate(vpiArgument, sys);
318 vpiHandle item;
319
320 char *path;
321
322 if (argv && (item = vpi_scan(argv))) {
323 s_vpi_value value;
324
325 if (vpi_get(vpiType, item) != vpiConstant
326 || vpi_get(vpiConstType, item) != vpiStringConst) {
327 vpi_mcd_printf(1,
328 "FST Error:"
329 " %s parameter must be a string constant\n",
330 name);
331 return (0);
332 }
333 value.format = vpiStringVal;
334 vpi_get_value(item, &value);
335 path = strdup(value.value.str);
336
337 vpi_free_object(argv);
338 } else {
339 path = strdup("dump.fst");
340 }
341
342 if (dump_path) {
343 vpi_mcd_printf(1, "FST Warning:"
344 " Overriding dumpfile path %s with %s\n",
345 dump_path, path);
346 free(dump_path);
347 }
348 dump_path = path;
349
350 return (0);
351 }
352
353
354 int
355 sys_dumpfile_calltf(char *name)
356 {
357 return (0);
358 }
359
360
361 static int
362 draw_module_type(vpiHandle item, int typ)
363 {
364 vpiHandle iter = vpi_iterate(typ, item);
365 vpiHandle net;
366 const char *name;
367 struct t_cb_data cb;
368 struct fst_info *info;
369 struct t_vpi_time time;
370 int vtyp;
371 int ilrange,
372 irrange;
373
374 if (!iter)
375 return (0);
376
377 while ((net = vpi_scan(iter))) {
378 int siz;
379
380 info = calloc(1, sizeof(*info));
381
382 if (typ == vpiVariables) {
383 siz = vpi_get(vpiSize, net);
384 ilrange = siz - 1;
385 irrange = 0;
386 } else if (vpi_get(vpiVector, net)) {
387 s_vpi_value lvalue,
388 rvalue;
389 vpiHandle lrange = vpi_handle(vpiLeftRange, net);
390 vpiHandle rrange = vpi_handle(vpiRightRange, net);
391
392 lvalue.value.integer = 0;
393 lvalue.format = vpiIntVal;
394 vpi_get_value(lrange, &lvalue);
395
396 rvalue.value.integer = 0;
397 rvalue.format = vpiIntVal;
398 vpi_get_value(rrange, &rvalue);
399
400 siz = vpi_get(vpiSize, net);
401
402 ilrange = lvalue.value.integer;
403 irrange = rvalue.value.integer;
404 } else {
405 siz = 1;
406 ilrange = irrange = -1;
407 }
408
409 name = vpi_get_str(vpiName, net);
410
411 switch (typ) {
412 case vpiNet:
413 {
414 int vartype = vpi_get(vpiNetType, net);
415 switch (vartype) {
416 case vpiWand:
417 vtyp = FST_VT_VCD_WAND;
418 break;
419 case vpiWor:
420 vtyp = FST_VT_VCD_WOR;
421 break;
422 case vpiTri:
423 vtyp = FST_VT_VCD_TRI;
424 break;
425 case vpiTri0:
426 vtyp = FST_VT_VCD_TRI0;
427 break;
428 case vpiTri1:
429 vtyp = FST_VT_VCD_TRI1;
430 break;
431 case vpiTriReg:
432 vtyp = FST_VT_VCD_TRIREG;
433 break;
434 case vpiTriAnd:
435 vtyp = FST_VT_VCD_TRIAND;
436 break;
437 case vpiTriOr:
438 vtyp = FST_VT_VCD_TRIOR;
439 break;
440 case vpiSupply0:
441 vtyp = FST_VT_VCD_SUPPLY0;
442 break;
443 case vpiSupply1:
444 vtyp = FST_VT_VCD_SUPPLY1;
445 break;
446 case vpiWire:
447 default:
448 vtyp = FST_VT_VCD_WIRE;
449 break;
450 }
451 break;
452 }
453 case vpiReg:
454 vtyp = FST_VT_VCD_REG;
455 break;
456 case vpiVariables:
457 {
458 int vartype = vpi_get(vpiType, net);
459 switch (vartype) {
460 case vpiTimeVar:
461 vtyp = FST_VT_VCD_TIME;
462 break;
463 case vpiRealVar:
464 vtyp = FST_VT_VCD_REAL;
465 info->is_real = 1;
466 break;
467 case vpiIntegerVar:
468 default:
469 vtyp = FST_VT_VCD_INTEGER;
470 break;
471 }
472 }
473 break;
474 default:
475 vtyp = FST_VT_VCD_WIRE;
476 break;
477 }
478
479 if (((ilrange == -1) && (irrange == -1)) || (typ == vpiVariables)) {
480 info->fstSym =
481 fstWriterCreateVar(ctx, vtyp, FST_VD_IMPLICIT, siz, name,
482 0);
483 } else {
484 char *n2 = malloc(strlen(name) + 64);
485 int len = ilrange - irrange;
486 if(len < 0) len = - len;
487 len++;
488
489 if (ilrange == irrange) {
490 if(siz == len)
491 {
492 sprintf(n2, "%s [%d]", name, irrange);
493 }
494 else
495 {
496 sprintf(n2, "%s [%d][%d:0]", name, irrange, siz/len-1);
497 }
498 } else {
499 if(siz == len)
500 {
501 sprintf(n2, "%s [%d:%d]", name, ilrange, irrange);
502 }
503 else
504 {
505 sprintf(n2, "%s [%d:%d][%d:0]", name, ilrange, irrange, siz/len-1);
506 }
507 }
508
509 info->fstSym =
510 fstWriterCreateVar(ctx, vtyp, FST_VD_IMPLICIT, siz, n2, 0);
511 free(n2);
512 }
513
514 info->item = net;
515 info->is_changed = 1;
516
517 info->dump_chain = fst_dump_list;
518 fst_dump_list = info;
519
520
521 memset(&cb, 0, sizeof(cb));
522 memset(&time, 0, sizeof(time));
523 time.type = vpiSimTime;
524
525 cb.time = &time;
526 cb.user_data = (char *) info;
527
528 cb.value = &info->value; /* NC seems to be ok with NULL, but VCS needs &info->value */
529 info->value.format = vpiObjTypeVal;
530 cb.obj = net;
531 cb.reason = cbValueChange;
532 cb.cb_rtn = variable_cb;
533
534 vpi_free_object(vpi_register_cb(&cb));
535 }
536
537 return (0);
538 }
539
540
541 static int
542 draw_module(vpiHandle item, int typ)
543 {
544 if (typ == vpiModule) {
545 draw_module_type(item, vpiNet);
546 }
547 draw_module_type(item, vpiReg);
548 draw_module_type(item, vpiVariables);
549
550 return (0);
551 }
552
553
554 static int
555 draw_scope_fst(vpiHandle item, int depth, int depth_max)
556 {
557 const char *fstscopnam;
558 char *defname = NULL;
559 vpiHandle orig = item;
560
561 if ((depth_max) && (depth >= depth_max))
562 return (0);
563
564 if (depth == 0) {
565 int vpitype = vpi_get(vpiType, item);
566 int fsttype;
567
568 int lineno = vpi_get(vpiLineNo, item);
569 const char *fname = vpi_get_str(vpiFile, item);
570 fstWriterSetSourceInstantiationStem(ctx, fname, lineno, 1);
571
572 lineno = vpi_get(vpiDefLineNo, item);
573 fname = vpi_get_str(vpiDefFile, item);
574 fstWriterSetSourceStem(ctx, fname, lineno, 1);
575
576 switch (vpitype) {
577 case vpiTaskFunc:
578 case vpiTask:
579 fsttype = FST_ST_VCD_TASK;
580 break;
581 case vpiFunction:
582 fsttype = FST_ST_VCD_FUNCTION;
583 break;
584 case vpiNamedBegin:
585 fsttype = FST_ST_VCD_BEGIN;
586 break;
587 case vpiNamedFork:
588 fsttype = FST_ST_VCD_FORK;
589 break;
590 case vpiModule:
591 default:
592 fsttype = FST_ST_VCD_MODULE;
593 defname = strdup(vpi_get_str(vpiDefName, item));
594 break;
595 }
596
597 fstscopnam = vpi_get_str(vpiName, item);
598 if(defname && !strcmp(defname, fstscopnam)) { free(defname); defname = NULL; } /* no sense in storing a duplicate name */
599 fstWriterSetScope(ctx, fsttype, fstscopnam, defname);
600 if(defname) free(defname);
601
602 draw_module(item, vpitype);
603 if (vpitype == vpiModule) {
604 draw_scope_fst(item, depth + 1, depth_max);
605 }
606
607 fstWriterSetUpscope(ctx);
608 } else {
609 vpiHandle iter = vpi_iterate(vpiInternalScope, orig);
610
611 if (iter)
612 while ((item = vpi_scan(iter))) {
613 int vpitype = vpi_get(vpiType, item);
614 int fsttype;
615
616 int lineno = vpi_get(vpiLineNo, item);
617 const char *fname = vpi_get_str(vpiFile, item);
618 fstWriterSetSourceInstantiationStem(ctx, fname, lineno, 1);
619
620 lineno = vpi_get(vpiDefLineNo, item);
621 fname = vpi_get_str(vpiDefFile, item);
622 fstWriterSetSourceStem(ctx, fname, lineno, 1);
623
624 switch (vpitype) {
625 case vpiTaskFunc:
626 case vpiTask:
627 fsttype = FST_ST_VCD_TASK;
628 break;
629 case vpiFunction:
630 fsttype = FST_ST_VCD_FUNCTION;
631 break;
632 case vpiNamedBegin:
633 fsttype = FST_ST_VCD_BEGIN;
634 break;
635 case vpiNamedFork:
636 fsttype = FST_ST_VCD_FORK;
637 break;
638 case vpiModule:
639 default:
640 fsttype = FST_ST_VCD_MODULE;
641 defname = strdup(vpi_get_str(vpiDefName, item));
642 break;
643 }
644
645
646 fstscopnam = vpi_get_str(vpiName, item);
647 if(defname && !strcmp(defname, fstscopnam)) { free(defname); defname = NULL; } /* no sense in storing a duplicate name */
648 fstWriterSetScope(ctx, fsttype, fstscopnam, defname);
649 if(defname) free(defname);
650
651 draw_module(item, vpitype);
652
653 if (vpitype == vpiModule) {
654 draw_scope_fst(item, depth + 1, depth_max);
655 }
656 fstWriterSetUpscope(ctx);
657 }
658 }
659
660 return (0);
661 }
662
663
664 /*
665 * This function is also used in sys_fst to check the arguments of the fst
666 * variant of $dumpvars.
667 */
668 int
669 sys_dumpvars_compiletf(char *name)
670 {
671 vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
672 vpiHandle argv = vpi_iterate(vpiArgument, sys);
673 vpiHandle tmp;
674
675 if (argv == 0)
676 return (0);
677
678 tmp = vpi_scan(argv);
679 assert(tmp);
680
681 switch (vpi_get(vpiType, tmp)) {
682 case vpiConstant:
683 if (vpi_get(vpiConstType, tmp) == vpiStringConst) {
684 vpi_printf("ERROR: %s argument must be "
685 "a number constant.\n", name);
686 vpi_control(vpiFinish, 1);
687 }
688 break;
689
690 case vpiNet:
691 case vpiReg:
692 case vpiIntegerVar:
693 case vpiMemoryWord:
694 break;
695
696 default:
697 vpi_printf("ERROR: %s argument must be " "a number constant.\n",
698 name);
699 vpi_control(vpiFinish, 1);
700 break;
701 }
702
703 vpi_free_object(argv);
704 return (0);
705 }
706
707
708 int
709 sys_dumpvars_calltf(char *name)
710 {
711 unsigned depth;
712 s_vpi_value value;
713 vpiHandle item = 0;
714 vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
715 vpiHandle argv;
716
717 if (ctx == 0) {
718 open_dumpfile();
719 if (ctx == 0)
720 return (0);
721 }
722 if (install_dumpvars_callback()) {
723 return (0);
724 }
725 argv = vpi_iterate(vpiArgument, sys);
726
727 depth = 0;
728 if (argv && (item = vpi_scan(argv)))
729 switch (vpi_get(vpiType, item)) {
730 case vpiConstant:
731 case vpiNet:
732 case vpiReg:
733 case vpiIntegerVar:
734 case vpiMemoryWord:
735 value.format = vpiIntVal;
736 vpi_get_value(item, &value);
737 depth = value.value.integer;
738 break;
739 }
740
741 if (!argv) {
742 vpiHandle parent = vpi_handle(vpiScope, sys);
743 while (parent) {
744 item = parent;
745 parent = vpi_handle(vpiScope, item);
746 }
747
748 } else if (!item || !(item = vpi_scan(argv))) {
749 item = vpi_handle(vpiScope, sys);
750 argv = 0x0;
751 }
752 for (; item; item = argv ? vpi_scan(argv) : 0x0) {
753 draw_scope_fst(item, 0, depth);
754 }
755
756
757 {
758 struct fst_info *a_info;
759 int prec = vpi_get(vpiTimePrecision, 0);
760
761 fstWriterSetTimescale(ctx, prec);
762 fstWriterEmitTimeChange(ctx, 0);
763
764 install_rosync_cb();
765 }
766
767 return (0);
768 }
769
770
771 int
772 sys_dumpoff_compiletf(char *name)
773 {
774 return (0);
775 }
776
777
778 int
779 sys_dumpoff_calltf(char *name)
780 {
781 dump_is_off = 1;
782
783 return (0);
784 }
785
786
787 void
788 sys_fst_register()
789 {
790 s_vpi_systf_data tf_data;
791
792 tf_data.type = vpiSysTask;
793 tf_data.tfname = "$fstdumpfile";
794 tf_data.calltf = sys_dumpfile_calltf;
795 tf_data.compiletf = sys_dumpfile_compiletf;
796 tf_data.sizetf = 0;
797 tf_data.user_data = "$fstdumpfile";
798 vpi_register_systf(&tf_data);
799
800 tf_data.type = vpiSysTask;
801 tf_data.tfname = "$fstdumpvars";
802 tf_data.calltf = sys_dumpvars_calltf;
803 tf_data.compiletf = sys_dumpvars_compiletf;
804 tf_data.sizetf = 0;
805 tf_data.user_data = "$fstdumpvars";
806 vpi_register_systf(&tf_data);
807
808 tf_data.type = vpiSysTask;
809 tf_data.tfname = "$fstdumpoff";
810 tf_data.calltf = sys_dumpoff_calltf;
811 tf_data.compiletf = sys_dumpoff_compiletf;
812 tf_data.sizetf = 0;
813 tf_data.user_data = "$fstdumpoff";
814 vpi_register_systf(&tf_data);
815 }
0 /***************************************************************************
1 * vpi_user.h
2 *
3 * IEEE 1364-2000 Verilog HDL Programming Language Interface (PLI).
4 *
5 * This file contains the constant definitions, structure definitions, and
6 * routine declarations used by the Verilog PLI procedural interface VPI
7 * access routines.
8 *
9 **************************************************************************/
10 /***************************************************************************
11 * NOTE: the constant values 1 through 299 are reserved for use in this
12 * vpi_user.h file.
13 **************************************************************************/
14 #ifndef VPI_USER_H
15 #define VPI_USER_H
16
17 #include <stdarg.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 /*------------------------------------------------------------------------*/
24 /*-------------------------- Portability Help ----------------------------*/
25 /*------------------------------------------------------------------------*/
26 /* Sized variables */
27 #ifndef PLI_TYPES
28 #define PLI_TYPES
29 typedef int PLI_INT32;
30 typedef unsigned int PLI_UINT32;
31 typedef short PLI_INT16;
32 typedef unsigned short PLI_UINT16;
33 typedef char PLI_BYTE8;
34 typedef unsigned char PLI_UBYTE8;
35 #endif
36 /* Use to export a symbol */
37 #if WIN32
38 #ifndef PLI_DLLISPEC
39 #define PLI_DLLISPEC __declspec(dllimport)
40 #define VPI_USER_DEFINED_DLLISPEC 1
41 #endif
42 #else
43 #ifndef PLI_DLLISPEC
44 #define PLI_DLLISPEC
45 #endif
46 #endif
47
48 /* Use to import a symbol */
49 #if WIN32
50 #ifndef PLI_DLLESPEC
51 #define PLI_DLLESPEC __declspec(dllexport)
52 #define VPI_USER_DEFINED_DLLESPEC 1
53 #endif
54 #else
55 #ifndef PLI_DLLESPEC
56 #define PLI_DLLESPEC
57 #endif
58 #endif
59
60 /* Use to mark a function as external */
61 #ifndef PLI_EXTERN
62 #define PLI_EXTERN
63 #endif
64 /* Use to mark a variable as external */
65 #ifndef PLI_VEXTERN
66 #define PLI_VEXTERN extern
67 #endif
68 #ifndef PLI_PROTOTYPES
69 #define PLI_PROTOTYPES
70 #define PROTO_PARAMS(params) params
71 /* object is defined imported by the application */
72 #define XXTERN PLI_EXTERN PLI_DLLISPEC
73 /* object is exported by the application */
74 #define EETERN PLI_EXTERN PLI_DLLESPEC
75 #endif
76
77 /******************************** TYPEDEFS ********************************/
78 typedef PLI_UINT32 *vpiHandle;
79 /****************************** OBJECT TYPES ******************************/
80 #define vpiAlways 1 /* always block */
81 #define vpiAssignStmt 2 /* quasi-continuous assignment */
82 #define vpiAssignment 3 /* procedural assignment */
83 #define vpiBegin 4 /* block statement */
84 #define vpiCase 5 /* case statement */
85 #define vpiCaseItem 6 /* case statement item */
86 #define vpiConstant 7 /* numerical constant or literal string */
87 #define vpiContAssign 8 /* continuous assignment */
88 #define vpiDeassign 9 /* deassignment statement */
89 #define vpiDefParam 10 /* defparam */
90 #define vpiDelayControl 11 /* delay statement (e.g. #10) */
91 #define vpiDisable 12 /* named block disable statement */
92 #define vpiEventControl 13 /* wait on event, e.g. @e */
93 #define vpiEventStmt 14 /* event trigger, e.g. ->e */
94 #define vpiFor 15 /* for statement */
95 #define vpiForce 16 /* force statement */
96 #define vpiForever 17 /* forever statement */
97 #define vpiFork 18 /* fork-join block */
98 #define vpiFuncCall 19 /* HDL function call */
99 #define vpiFunction 20 /* HDL function */
100 #define vpiGate 21 /* primitive gate */
101 #define vpiIf 22 /* if statement */
102 #define vpiIfElse 23 /* if-else statement */
103 #define vpiInitial 24 /* initial block */
104 #define vpiIntegerVar 25 /* integer variable */
105 #define vpiInterModPath 26 /* intermodule wire delay */
106 #define vpiIterator 27 /* iterator */
107 #define vpiIODecl 28 /* input/output declaration */
108 #define vpiMemory 29 /* behavioral memory */
109 #define vpiMemoryWord 30 /* single word of memory */
110 #define vpiModPath 31 /* module path for path delays */
111 #define vpiModule 32 /* module instance */
112 #define vpiNamedBegin 33 /* named block statement */
113 #define vpiNamedEvent 34 /* event variable */
114 #define vpiNamedFork 35 /* named fork-join block */
115 #define vpiNet 36 /* scalar or vector net */
116 #define vpiNetBit 37 /* bit of vector net */
117 #define vpiNullStmt 38 /* a semicolon, Ie. #10 ; */
118 #define vpiOperation 39 /* behavioral operation */
119 #define vpiParamAssign 40 /* module parameter assignment */
120 #define vpiParameter 41 /* module parameter */
121 #define vpiPartSelect 42 /* part select */
122 #define vpiPathTerm 43 /* terminal of module path */
123 #define vpiPort 44 /* module port */
124 #define vpiPortBit 45 /* bit of vector module port */
125 #define vpiPrimTerm 46 /* primitive terminal */
126 #define vpiRealVar 47 /* real variable */
127 #define vpiReg 48 /* scalar or vector reg */
128 #define vpiRegBit 49 /* bit of vector reg */
129 #define vpiRelease 50 /* release statement */
130 #define vpiRepeat 51 /* repeat statement */
131 #define vpiRepeatControl 52 /* repeat control in an assign stmt */
132 #define vpiSchedEvent 53 /* vpi_put_value() event */
133 #define vpiSpecParam 54 /* specparam */
134 #define vpiSwitch 55 /* transistor switch */
135 #define vpiSysFuncCall 56 /* system function call */
136 #define vpiSysTaskCall 57 /* system task call */
137 #define vpiTableEntry 58 /* UDP state table entry */
138 #define vpiTask 59 /* HDL task */
139 #define vpiTaskCall 60 /* HDL task call */
140 #define vpiTchk 61 /* timing check */
141 #define vpiTchkTerm 62 /* terminal of timing check */
142 #define vpiTimeVar 63 /* time variable */
143 #define vpiTimeQueue 64 /* simulation event queue */
144 #define vpiUdp 65 /* user-defined primitive */
145 #define vpiUdpDefn 66 /* UDP definition */
146 #define vpiUserSystf 67 /* user defined system task or function */
147 #define vpiVarSelect 68 /* variable array selection */
148 #define vpiWait 69 /* wait statement */
149 #define vpiWhile 70 /* while statement */
150
151 /****************** object types added with 1364-2000 *********************/
152 #define vpiAttribute 105 /* attribute of an object */
153 #define vpiBitSelect 106 /* Bit select of parameter, var select */
154 #define vpiCallback 107 /* callback object */
155 #define vpiDelayTerm 108 /* Delay term which is a load or driver */
156 #define vpiDelayDevice 109 /* Delay object within a net */
157 #define vpiFrame 110 /* reentrant task/func frame */
158 #define vpiGateArray 111 /* gate instance array */
159 #define vpiModuleArray 112 /* module instance array */
160 #define vpiPrimitiveArray 113 /* vpiprimitiveArray type */
161 #define vpiNetArray 114 /* multidimensional net */
162 #define vpiRange 115 /* range declaration */
163 #define vpiRegArray 116 /* multidimensional reg */
164 #define vpiSwitchArray 117 /* switch instance array */
165 #define vpiUdpArray 118 /* UDP instance array */
166 #define vpiContAssignBit 128 /* Bit of a vector continuous assignment */
167 #define vpiNamedEventArray 129 /* multidimensional named event */
168
169 /******************************** METHODS *********************************/
170 /************* methods used to traverse 1 to 1 relationships **************/
171 #define vpiCondition 71 /* condition expression */
172 #define vpiDelay 72 /* net or gate delay */
173 #define vpiElseStmt 73 /* else statement */
174 #define vpiForIncStmt 74 /* increment statement in for loop */
175 #define vpiForInitStmt 75 /* initialization statement in for loop */
176 #define vpiHighConn 76 /* higher connection to port */
177 #define vpiLhs 77 /* left-hand side of assignment */
178 #define vpiIndex 78 /* index of var select, bit select, etc. */
179 #define vpiLeftRange 79 /* left range of vector or part select */
180 #define vpiLowConn 80 /* lower connection to port */
181 #define vpiParent 81 /* parent object */
182 #define vpiRhs 82 /* right-hand side of assignment */
183 #define vpiRightRange 83 /* right range of vector or part select */
184 #define vpiScope 84 /* containing scope object */
185 #define vpiSysTfCall 85 /* task function call */
186 #define vpiTchkDataTerm 86 /* timing check data term */
187 #define vpiTchkNotifier 87 /* timing check notifier */
188 #define vpiTchkRefTerm 88 /* timing check reference term */
189
190 /************ methods used to traverse 1 to many relationships ************/
191 #define vpiArgument 89 /* argument to (system) task/function */
192 #define vpiBit 90 /* bit of vector net or port */
193 #define vpiDriver 91 /* driver for a net */
194 #define vpiInternalScope 92 /* internal scope in module */
195 #define vpiLoad 93 /* load on net or reg */
196 #define vpiModDataPathIn 94 /* data terminal of a module path */
197 #define vpiModPathIn 95 /* Input terminal of a module path */
198 #define vpiModPathOut 96 /* output terminal of a module path */
199 #define vpiOperand 97 /* operand of expression */
200 #define vpiPortInst 98 /* connected port instance */
201 #define vpiProcess 99 /* process in module */
202 #define vpiVariables 100 /* variables in module */
203 #define vpiUse 101 /* usage */
204
205 /***** methods which can traverse 1 to 1, or 1 to many relationships ******/
206 #define vpiExpr 102 /* connected expression */
207 #define vpiPrimitive 103 /* primitive (gate, switch, UDP) */
208 #define vpiStmt 104 /* statement in process or task */
209
210 /********************* methods added with 1364-2000 ***********************/
211 #define vpiActiveTimeFormat 119 /* active $timeformat() system task */
212 #define vpiInTerm 120 /* To get to a delay device's drivers. */
213 #define vpiInstanceArray 121 /* vpiInstance arrays */
214 #define vpiLocalDriver 122 /* local drivers (within a module */
215 #define vpiLocalLoad 123 /* local loads (within a module */
216 #define vpiOutTerm 124 /* To get to a delay device's loads. */
217 #define vpiPorts 125 /* Module port */
218 #define vpiSimNet 126 /* simulated net after collapsing */
219 #define vpiTaskFunc 127 /* HDL task or function */
220
221 /******************************* PROPERTIES *******************************/
222 /************************ generic object properties ***********************/
223 #define vpiUndefined -1 /* undefined property */
224 #define vpiType 1 /* type of object */
225 #define vpiName 2 /* local name of object */
226 #define vpiFullName 3 /* full hierarchical name */
227 #define vpiSize 4 /* size of gate, net, port, etc. */
228 #define vpiFile 5 /* File name in which the object is used */
229 #define vpiLineNo 6 /* line number where the object is used */
230
231 /*************************** module properties ****************************/
232 #define vpiTopModule 7 /* top-level module (boolean) */
233 #define vpiCellInstance 8 /* cell (boolean) */
234 #define vpiDefName 9 /* module definition name */
235 #define vpiProtected 10 /* source protected module (boolean) */
236 #define vpiTimeUnit 11 /* module time unit */
237 #define vpiTimePrecision 12 /* module time precision */
238 #define vpiDefNetType 13 /* default net type */
239 #define vpiUnconnDrive 14 /* unconnected port drive strength */
240 #define vpiHighZ 1 /* No default drive given */
241 #define vpiPull1 2 /* default pull1 drive */
242 #define vpiPull0 3 /* default pull0 drive */
243 #define vpiDefFile 15 /* File name where the module is defined */
244 #define vpiDefLineNo 16 /* line number for module definition */
245 #define vpiDefDelayMode 47 /* Default delay mode for a module */
246 #define vpiDelayModeNone 1 /* no delay mode specified */
247 #define vpiDelayModePath 2 /* path delay mode */
248 #define vpiDelayModeDistrib 3 /* distributed delay mode */
249 #define vpiDelayModeUnit 4 /* unit delay mode */
250 #define vpiDelayModeZero 5 /* zero delay mode */
251 #define vpiDelayModeMTM 6 /* min:typ:max delay mode */
252 #define vpiDefDecayTime 48 /* Default decay time for a module */
253
254 /************************ port and net properties *************************/
255 #define vpiScalar 17 /* scalar (boolean) */
256 #define vpiVector 18 /* vector (boolean) */
257 #define vpiExplicitName 19 /* port is explicitly named */
258 #define vpiDirection 20 /* direction of port: */
259 #define vpiInput 1 /* input */
260 #define vpiOutput 2 /* output */
261 #define vpiInout 3 /* inout */
262 #define vpiMixedIO 4 /* mixed input-output */
263 #define vpiNoDirection 5 /* no direction */
264 #define vpiConnByName 21 /* connected by name (boolean) */
265 #define vpiNetType 22 /* net subtypes: */
266 #define vpiWire 1 /* wire net */
267 #define vpiWand 2 /* wire-and net */
268 #define vpiWor 3 /* wire-or net */
269 #define vpiTri 4 /* three-state net */
270 #define vpiTri0 5 /* pull-down net */
271 #define vpiTri1 6 /* pull-up net */
272 #define vpiTriReg 7 /* tri state reg net */
273 #define vpiTriAnd 8 /* three-state wire-and net */
274 #define vpiTriOr 9 /* three-state wire-or net */
275 #define vpiSupply1 10 /* supply 1 net */
276 #define vpiSupply0 11 /* supply zero net */
277 #define vpiNone 12 /* no default net type (1364-2000) */
278 #define vpiExplicitScalared 23 /* explicitly scalared (boolean) */
279 #define vpiExplicitVectored 24 /* explicitly vectored (boolean) */
280 #define vpiExpanded 25 /* expanded vector net (boolean) */
281 #define vpiImplicitDecl 26 /* implicitly declared net (boolean) */
282 #define vpiChargeStrength 27 /* charge decay strength of net */
283
284 /* Defined as part of strengths section.
285 #define vpiLargeCharge 0x10
286 #define vpiMediumCharge 0x04
287 #define vpiSmallCharge 0x02
288 */
289
290 #define vpiArray 28 /* variable array (boolean) */
291 #define vpiPortIndex 29 /* Port index */
292 /********************** gate and terminal properties **********************/
293 #define vpiTermIndex 30 /* Index of a primitive terminal */
294 #define vpiStrength0 31 /* 0-strength of net or gate */
295 #define vpiStrength1 32 /* 1-strength of net or gate */
296 #define vpiPrimType 33 /* prmitive subtypes: */
297 #define vpiAndPrim 1 /* and gate */
298 #define vpiNandPrim 2 /* nand gate */
299 #define vpiNorPrim 3 /* nor gate */
300 #define vpiOrPrim 4 /* or gate */
301 #define vpiXorPrim 5 /* xor gate */
302 #define vpiXnorPrim 6 /* xnor gate */
303 #define vpiBufPrim 7 /* buffer */
304 #define vpiNotPrim 8 /* not gate */
305 #define vpiBufif0Prim 9 /* zero-enabled buffer */
306 #define vpiBufif1Prim 10 /* one-enabled buffer */
307 #define vpiNotif0Prim 11 /* zero-enabled not gate */
308 #define vpiNotif1Prim 12 /* one-enabled not gate */
309 #define vpiNmosPrim 13 /* nmos switch */
310 #define vpiPmosPrim 14 /* pmos switch */
311 #define vpiCmosPrim 15 /* cmos switch */
312 #define vpiRnmosPrim 16 /* resistive nmos switch */
313 #define vpiRpmosPrim 17 /* resistive pmos switch */
314 #define vpiRcmosPrim 18 /* resistive cmos switch */
315 #define vpiRtranPrim 19 /* resistive bidirectional */
316 #define vpiRtranif0Prim 20 /* zero-enable resistive bidirectional */
317 #define vpiRtranif1Prim 21 /* one-enable resistive bidirectional */
318 #define vpiTranPrim 22 /* bidirectional */
319 #define vpiTranif0Prim 23 /* zero-enabled bidirectional */
320 #define vpiTranif1Prim 24 /* one-enabled bidirectional */
321 #define vpiPullupPrim 25 /* pullup */
322 #define vpiPulldownPrim 26 /* pulldown */
323 #define vpiSeqPrim 27 /* sequential UDP */
324 #define vpiCombPrim 28 /* combinational UDP */
325
326 /************** path, path terminal, timing check properties **************/
327 #define vpiPolarity 34 /* polarity of module path... */
328 #define vpiDataPolarity 35 /* ...or data path: */
329 #define vpiPositive 1 /* positive */
330 #define vpiNegative 2 /* negative */
331 #define vpiUnknown 3 /* unknown (unspecified) */
332 #define vpiEdge 36 /* edge type of module path: */
333 #define vpiNoEdge 0x00000000 /* no edge */
334 #define vpiEdge01 0x00000001 /* 0 -> 1 */
335 #define vpiEdge10 0x00000002 /* 1 -> 0 */
336 #define vpiEdge0x 0x00000004 /* 0 -> x */
337 #define vpiEdgex1 0x00000008 /* x -> 1 */
338 #define vpiEdge1x 0x00000010 /* 1 -> x */
339 #define vpiEdgex0 0x00000020 /* x -> 0 */
340 #define vpiPosEdge (vpiEdgex1 | vpiEdge01 | vpiEdge0x)
341 #define vpiNegEdge (vpiEdgex0 | vpiEdge10 | vpiEdge1x)
342 #define vpiAnyEdge (vpiPosEdge | vpiNegEdge)
343
344 #define vpiPathType 37 /* path delay connection subtypes: */
345 #define vpiPathFull 1 /* ( a *> b ) */
346 #define vpiPathParallel 2 /* ( a => b ) */
347 #define vpiTchkType 38 /* timing check subtypes: */
348 #define vpiSetup 1 /* $setup */
349 #define vpiHold 2 /* $hold */
350 #define vpiPeriod 3 /* $period */
351 #define vpiWidth 4 /* $width */
352 #define vpiSkew 5 /* $skew */
353 #define vpiRecovery 6 /* $recovery */
354 #define vpiNoChange 7 /* $nochange */
355 #define vpiSetupHold 8 /* $setuphold */
356 #define vpiFullskew 9 /* $fullskew -- added for 1364-2000 */
357 #define vpiRecrem 10 /* $recrem -- added for 1364-2000 */
358 #define vpiRemoval 11 /* $removal -- added for 1364-2000 */
359 #define vpiTimeskew 12 /* $timeskew -- added for 1364-2000 */
360
361 /************************* expression properties **************************/
362 #define vpiOpType 39 /* operation subtypes: */
363 #define vpiMinusOp 1 /* unary minus */
364 #define vpiPlusOp 2 /* unary plus */
365 #define vpiNotOp 3 /* unary not */
366 #define vpiBitNegOp 4 /* bitwise negation */
367 #define vpiUnaryAndOp 5 /* bitwise reduction and */
368 #define vpiUnaryNandOp 6 /* bitwise reduction nand */
369 #define vpiUnaryOrOp 7 /* bitwise reduction or */
370 #define vpiUnaryNorOp 8 /* bitwise reduction nor */
371 #define vpiUnaryXorOp 9 /* bitwise reduction xor */
372 #define vpiUnaryXNorOp 10 /* bitwise reduction xnor */
373 #define vpiSubOp 11 /* binary subtraction */
374 #define vpiDivOp 12 /* binary division */
375 #define vpiModOp 13 /* binary modulus */
376 #define vpiEqOp 14 /* binary equality */
377 #define vpiNeqOp 15 /* binary inequality */
378 #define vpiCaseEqOp 16 /* case (x and z) equality */
379 #define vpiCaseNeqOp 17 /* case inequality */
380 #define vpiGtOp 18 /* binary greater than */
381 #define vpiGeOp 19 /* binary greater than or equal */
382 #define vpiLtOp 20 /* binary less than */
383 #define vpiLeOp 21 /* binary less than or equal */
384 #define vpiLShiftOp 22 /* binary left shift */
385 #define vpiRShiftOp 23 /* binary right shift */
386 #define vpiAddOp 24 /* binary addition */
387 #define vpiMultOp 25 /* binary multiplication */
388 #define vpiLogAndOp 26 /* binary logical and */
389 #define vpiLogOrOp 27 /* binary logical or */
390 #define vpiBitAndOp 28 /* binary bitwise and */
391 #define vpiBitOrOp 29 /* binary bitwise or */
392 #define vpiBitXorOp 30 /* binary bitwise xor */
393 #define vpiBitXNorOp 31 /* binary bitwise xnor */
394 #define vpiBitXnorOp vpiBitXNorOp /* added with 1364-2000 */
395 #define vpiConditionOp 32 /* ternary conditional */
396 #define vpiConcatOp 33 /* n-ary concatenation */
397 #define vpiMultiConcatOp 34 /* repeated concatenation */
398 #define vpiEventOrOp 35 /* event or */
399 #define vpiNullOp 36 /* null operation */
400 #define vpiListOp 37 /* list of expressions */
401 #define vpiMinTypMaxOp 38 /* min:typ:max: delay expression */
402 #define vpiPosedgeOp 39 /* posedge */
403 #define vpiNegedgeOp 40 /* negedge */
404 #define vpiArithLShiftOp 41 /* arithmetic left shift (1364-2000) */
405 #define vpiArithRShiftOp 42 /* arithmetic right shift (1364-2000) */
406 #define vpiPowerOp 43 /* arithmetic power op (1364-2000) */
407
408 #define vpiConstType 40 /* constant subtypes: */
409 #define vpiDecConst 1 /* decimal integer */
410 #define vpiRealConst 2 /* real */
411 #define vpiBinaryConst 3 /* binary integer */
412 #define vpiOctConst 4 /* octal integer */
413 #define vpiHexConst 5 /* hexadecimal integer */
414 #define vpiStringConst 6 /* string literal */
415 #define vpiIntConst 7 /* HDL integer constant (1364-2000) */
416 #define vpiBlocking 41 /* blocking assignment (boolean) */
417 #define vpiCaseType 42 /* case statement subtypes: */
418 #define vpiCaseExact 1 /* exact match */
419 #define vpiCaseX 2 /* ignore X's */
420 #define vpiCaseZ 3 /* ignore Z's */
421 #define vpiNetDeclAssign 43 /* assign part of decl (boolean) */
422
423 /************** task/function properties **************/
424 #define vpiFuncType 44 /* HDL function and system function type */
425 #define vpiIntFunc 1 /* returns integer */
426 #define vpiRealFunc 2 /* returns real */
427 #define vpiTimeFunc 3 /* returns time */
428 #define vpiSizedFunc 4 /* returns an arbitrary size */
429 #define vpiSizedSignedFunc 5 /* returns sized signed value */
430
431 /* alias 1364-1995 system function subtypes to 1364-2000 function subtypes */
432 #define vpiSysFuncType vpiFuncType
433 #define vpiSysFuncInt vpiIntFunc
434 #define vpiSysFuncReal vpiRealFunc
435 #define vpiSysFuncTime vpiTimeFunc
436 #define vpiSysFuncSized vpiSizedFunc
437 #define vpiUserDefn 45 /* user defined system task/func (boolean) */
438 #define vpiScheduled 46 /* object still scheduled (boolean) */
439
440 /*********************** properties added with 1364-2000 *******************/
441 #define vpiActive 49 /* reentrant task/func frame is active */
442 #define vpiAutomatic 50 /* task/func obj is automatic */
443 #define vpiCell 51 /* configuration cell */
444 #define vpiConfig 52 /* configuration config file */
445 #define vpiConstantSelect 53 /* (boolean) bit or part select indices
446 are constant expressions */
447 #define vpiDecompile 54 /* decompile the object */
448 #define vpiDefAttribute 55 /* Attribute defined for the obj */
449 #define vpiDelayType 56 /* delay subtype */
450 #define vpiModPathDelay 1 /* module path delay */
451 #define vpiInterModPathDelay 2 /* intermodule path delay */
452 #define vpiMIPDelay 3 /* module input port delay */
453 #define vpiIteratorType 57 /* object type of an iterator */
454 #define vpiLibrary 58 /* configuration library */
455 #define vpiMultiArray 59 /* Object is a multidimensional array */
456 #define vpiOffset 60 /* offset from LSB */
457 #define vpiResolvedNetType 61 /* net subtype after resolution, returns
458 same subtypes as vpiNetType */
459 #define vpiSaveRestartID 62 /* unique ID for save/restart data */
460 #define vpiSaveRestartLocation 63 /* name of save/restart data file */
461 #define vpiValid 64 /* reentrant task/func frame is valid */
462 #define vpiSigned 65 /* TRUE for vpiIODecl and any object in
463 the expression class if the object
464 has the signed attribute */
465 #define vpiLocalParam 70 /* TRUE when a param is declared as a
466 localparam */
467 #define vpiModPathHasIfNone 71 /* Mod path has an ifnone statement */
468
469 /************* vpi_control() constants (added with 1364-2000) *************/
470 #define vpiStop 66 /* execute simulator's $stop */
471 #define vpiFinish 67 /* execute simulator's $finish */
472 #define vpiReset 68 /* execute simulator's $reset */
473 #define vpiSetInteractiveScope 69 /* set simulator's interactive scope */
474
475 /************************** I/O related defines ***************************/
476 #define VPI_MCD_STDOUT 0x00000001
477
478 /************************** STRUCTURE DEFINITIONS *************************/
479 /***************************** time structure *****************************/
480 typedef struct t_vpi_time
481 {
482 PLI_INT32 type; /* [vpiScaledRealTime, vpiSimTime, vpiSuppressTime] */
483 PLI_UINT32 high, low; /* for vpiSimTime */
484 double real; /* for vpiScaledRealTime */
485 } s_vpi_time, *p_vpi_time;
486
487 /* time types */
488 #define vpiScaledRealTime 1
489 #define vpiSimTime 2
490 #define vpiSuppressTime 3
491
492 /**************************** delay structures ****************************/
493 typedef struct t_vpi_delay
494 {
495 struct t_vpi_time *da; /* pointer to user allocated array of delay values */
496 PLI_INT32 no_of_delays; /* number of delays */
497 PLI_INT32 time_type; /* [vpiScaledRealTime, vpiSimTime, vpiSuppressTime] */
498 PLI_INT32 mtm_flag; /* true for mtm values */
499 PLI_INT32 append_flag; /* true for append */
500 PLI_INT32 pulsere_flag; /* true for pulsere values */
501 } s_vpi_delay, *p_vpi_delay;
502
503 /**************************** value structures ****************************/
504 /* vector value */
505 typedef struct t_vpi_vecval
506 {
507 /* following fields are repeated enough times to contain vector */
508 PLI_INT32 aval, bval; /* bit encoding: ab: 00=0, 10=1, 11=X, 01=Z */
509 } s_vpi_vecval, *p_vpi_vecval;
510
511 /* strength (scalar) value */
512 typedef struct t_vpi_strengthval
513 {
514 PLI_INT32 logic; /* vpi[0,1,X,Z] */
515 PLI_INT32 s0, s1; /* refer to strength coding below */
516 } s_vpi_strengthval, *p_vpi_strengthval;
517
518 /* strength values */
519 #define vpiSupplyDrive 0x80
520 #define vpiStrongDrive 0x40
521 #define vpiPullDrive 0x20
522 #define vpiWeakDrive 0x08
523 #define vpiLargeCharge 0x10
524 #define vpiMediumCharge 0x04
525 #define vpiSmallCharge 0x02
526 #define vpiHiZ 0x01
527
528 /* generic value */
529 typedef struct t_vpi_value
530 {
531 PLI_INT32 format; /* vpi[[Bin,Oct,Dec,Hex]Str,Scalar,Int,Real,String,
532 Vector,Strength,Suppress,Time,ObjType]Val */
533 union
534 {
535 PLI_BYTE8 *str; /* string value */
536 PLI_INT32 scalar; /* vpi[0,1,X,Z] */
537 PLI_INT32 integer; /* integer value */
538 double real; /* real value */
539 struct t_vpi_time *time; /* time value */
540 struct t_vpi_vecval *vector; /* vector value */
541 struct t_vpi_strengthval *strength; /* strength value */
542 PLI_BYTE8 *misc; /* ...other */
543 } value;
544 } s_vpi_value, *p_vpi_value;
545
546 /* value formats */
547 #define vpiBinStrVal 1
548 #define vpiOctStrVal 2
549 #define vpiDecStrVal 3
550 #define vpiHexStrVal 4
551 #define vpiScalarVal 5
552 #define vpiIntVal 6
553 #define vpiRealVal 7
554 #define vpiStringVal 8
555 #define vpiVectorVal 9
556 #define vpiStrengthVal 10
557 #define vpiTimeVal 11
558 #define vpiObjTypeVal 12
559 #define vpiSuppressVal 13
560
561 /* delay modes */
562 #define vpiNoDelay 1
563 #define vpiInertialDelay 2
564 #define vpiTransportDelay 3
565 #define vpiPureTransportDelay 4
566
567 /* force and release flags */
568 #define vpiForceFlag 5
569 #define vpiReleaseFlag 6
570
571 /* scheduled event cancel flag */
572 #define vpiCancelEvent 7
573
574 /* bit mask for the flags argument to vpi_put_value() */
575 #define vpiReturnEvent 0x1000
576
577 /* scalar values */
578 #define vpi0 0
579 #define vpi1 1
580 #define vpiZ 2
581 #define vpiX 3
582 #define vpiH 4
583 #define vpiL 5
584 #define vpiDontCare 6
585
586 /*
587 #define vpiNoChange 7 Defined under vpiTchkType, but
588 can be used here.
589 */
590 /********************* system task/function structure *********************/
591 typedef struct t_vpi_systf_data
592 {
593 PLI_INT32 type; /* vpiSysTask, vpiSysFunc */
594 PLI_INT32 sysfunctype; /* vpiSysTask, vpi[Int,Real,Time,Sized,
595 SizedSigned] Func */
596 PLI_BYTE8 *tfname; /* first character must be `$' */
597 PLI_INT32 (*calltf)();
598 PLI_INT32 (*compiletf)();
599 PLI_INT32 (*sizetf)(); /* for sized function callbacks only */
600 PLI_BYTE8 *user_data;
601 } s_vpi_systf_data, *p_vpi_systf_data;
602
603 #define vpiSysTask 1
604 #define vpiSysFunc 2
605 /* the subtypes are defined under the vpiFuncType property */
606
607 /***************** Verilog execution information structure ****************/
608 typedef struct t_vpi_vlog_info
609 {
610 PLI_INT32 argc;
611 PLI_BYTE8 **argv;
612 PLI_BYTE8 *product;
613 PLI_BYTE8 *version;
614 } s_vpi_vlog_info, *p_vpi_vlog_info;
615
616 /******************** PLI error information structure *********************/
617 typedef struct t_vpi_error_info
618 {
619 PLI_INT32 state; /* vpi[Compile,PLI,Run] */
620 PLI_INT32 level; /* vpi[Notice,Warning,Error,System,Internal] */
621 PLI_BYTE8 *message;
622 PLI_BYTE8 *product;
623 PLI_BYTE8 *code;
624 PLI_BYTE8 *file;
625 PLI_INT32 line;
626 } s_vpi_error_info, *p_vpi_error_info;
627
628
629 /* error types */
630 #define vpiCompile 1
631 #define vpiPLI 2
632 #define vpiRun 3
633
634 #define vpiNotice 1
635 #define vpiWarning 2
636 #define vpiError 3
637 #define vpiSystem 4
638 #define vpiInternal 5
639
640 /************************** callback structures ***************************/
641 /* normal callback structure */
642 typedef struct t_cb_data
643 {
644 PLI_INT32 reason; /* callback reason */
645 PLI_INT32 (*cb_rtn)(struct t_cb_data *); /* call routine */
646 vpiHandle obj; /* trigger object */
647 p_vpi_time time; /* callback time */
648 p_vpi_value value; /* trigger object value */
649 PLI_INT32 index; /* index of the memory word or var select that changed */
650 PLI_BYTE8 *user_data;
651 } s_cb_data, *p_cb_data;
652
653 /**************************** CALLBACK REASONS ****************************/
654 /*************************** Simulation related ***************************/
655 #define cbValueChange 1
656 #define cbStmt 2
657 #define cbForce 3
658 #define cbRelease 4
659
660 /****************************** Time related ******************************/
661 #define cbAtStartOfSimTime 5
662 #define cbReadWriteSynch 6
663 #define cbReadOnlySynch 7
664 #define cbNextSimTime 8
665 #define cbAfterDelay 9
666
667 /***************************** Action related *****************************/
668 #define cbEndOfCompile 10
669 #define cbStartOfSimulation 11
670 #define cbEndOfSimulation 12
671 #define cbError 13
672 #define cbTchkViolation 14
673 #define cbStartOfSave 15
674 #define cbEndOfSave 16
675 #define cbStartOfRestart 17
676 #define cbEndOfRestart 18
677 #define cbStartOfReset 19
678 #define cbEndOfReset 20
679 #define cbEnterInteractive 21
680 #define cbExitInteractive 22
681 #define cbInteractiveScopeChange 23
682 #define cbUnresolvedSystf 24
683
684 /************************** Added with 1364-2000 **************************/
685 #define cbAssign 25
686 #define cbDeassign 26
687 #define cbDisable 27
688 #define cbPLIError 28
689 #define cbSignal 29
690
691 /************************* FUNCTION DECLARATIONS **************************/
692 /* callback related */
693 XXTERN vpiHandle vpi_register_cb PROTO_PARAMS((p_cb_data cb_data_p));
694 XXTERN PLI_INT32 vpi_remove_cb PROTO_PARAMS((vpiHandle cb_obj));
695 XXTERN void vpi_get_cb_info PROTO_PARAMS((vpiHandle object,
696 p_cb_data cb_data_p));
697 XXTERN vpiHandle vpi_register_systf PROTO_PARAMS((p_vpi_systf_data
698 systf_data_p));
699 XXTERN void vpi_get_systf_info PROTO_PARAMS((vpiHandle object,
700 p_vpi_systf_data systf_data_p));
701 /* for obtaining handles */
702 XXTERN vpiHandle vpi_handle_by_name PROTO_PARAMS((PLI_BYTE8 *name,
703 vpiHandle scope));
704 XXTERN vpiHandle vpi_handle_by_index PROTO_PARAMS((vpiHandle object,
705 PLI_INT32 indx));
706
707 /* for traversing relationships */
708 XXTERN vpiHandle vpi_handle PROTO_PARAMS((PLI_INT32 type,
709 vpiHandle refHandle));
710 XXTERN vpiHandle vpi_handle_multi PROTO_PARAMS((PLI_INT32 type,
711 vpiHandle refHandle1,
712 vpiHandle refHandle2, ... ));
713 XXTERN vpiHandle vpi_iterate PROTO_PARAMS((PLI_INT32 type,
714 vpiHandle refHandle));
715 XXTERN vpiHandle vpi_scan PROTO_PARAMS((vpiHandle iterator));
716
717 /* for processing properties */
718 XXTERN PLI_INT32 vpi_get PROTO_PARAMS((PLI_INT32 property,
719 vpiHandle object));
720
721 XXTERN PLI_BYTE8 *vpi_get_str PROTO_PARAMS((PLI_INT32 property,
722 vpiHandle object));
723 /* delay processing */
724 XXTERN void vpi_get_delays PROTO_PARAMS((vpiHandle object,
725 p_vpi_delay delay_p));
726 XXTERN void vpi_put_delays PROTO_PARAMS((vpiHandle object,
727 p_vpi_delay delay_p));
728
729 /* value processing */
730 XXTERN void vpi_get_value PROTO_PARAMS((vpiHandle expr, p_vpi_value value_p));
731 XXTERN vpiHandle vpi_put_value PROTO_PARAMS((vpiHandle object,
732 p_vpi_value value_p,
733 p_vpi_time time_p,
734 PLI_INT32 flags));
735
736 /* time processing */
737 XXTERN void vpi_get_time PROTO_PARAMS((vpiHandle object,
738 p_vpi_time time_p));
739
740 /* I/O routines */
741 XXTERN PLI_UINT32 vpi_mcd_open PROTO_PARAMS((PLI_BYTE8 *fileName));
742 XXTERN PLI_UINT32 vpi_mcd_close PROTO_PARAMS((PLI_UINT32 mcd));
743 XXTERN PLI_BYTE8 *vpi_mcd_name PROTO_PARAMS((PLI_UINT32 cd));
744 XXTERN PLI_INT32 vpi_mcd_printf PROTO_PARAMS((PLI_UINT32 mcd,
745 PLI_BYTE8 *format, ...));
746
747 XXTERN PLI_INT32 vpi_printf PROTO_PARAMS((PLI_BYTE8 *format,
748 ...));
749 /* utility routines */
750 XXTERN PLI_INT32 vpi_compare_objects PROTO_PARAMS((vpiHandle object1,
751 vpiHandle object2));
752 XXTERN PLI_INT32 vpi_chk_error PROTO_PARAMS((p_vpi_error_info
753 error_info_p));
754 XXTERN PLI_INT32 vpi_free_object PROTO_PARAMS((vpiHandle object));
755 XXTERN PLI_INT32 vpi_get_vlog_info PROTO_PARAMS((p_vpi_vlog_info
756 vlog_info_p));
757
758 /* routines added with 1364-2000 */
759 XXTERN PLI_INT32 vpi_get_data PROTO_PARAMS((PLI_INT32 id,
760 PLI_BYTE8 *dataLoc,
761 PLI_INT32 numOfBytes));
762 XXTERN PLI_INT32 vpi_put_data PROTO_PARAMS((PLI_INT32 id,
763 PLI_BYTE8 *dataLoc,
764 PLI_INT32 numOfBytes));
765 XXTERN void *vpi_get_userdata PROTO_PARAMS((vpiHandle obj));
766 XXTERN PLI_INT32 vpi_put_userdata PROTO_PARAMS((vpiHandle obj,
767 void *userdata));
768 XXTERN PLI_INT32 vpi_vprintf PROTO_PARAMS((PLI_BYTE8 *format,
769 va_list ap));
770 XXTERN PLI_INT32 vpi_mcd_vprintf PROTO_PARAMS((PLI_UINT32 mcd,
771 PLI_BYTE8 *format, va_list ap));
772 XXTERN PLI_INT32 vpi_flush PROTO_PARAMS((void));
773 XXTERN PLI_INT32 vpi_mcd_flush PROTO_PARAMS((PLI_UINT32 mcd));
774 XXTERN PLI_INT32 vpi_control PROTO_PARAMS((PLI_INT32 operation,
775 ...));
776 XXTERN vpiHandle vpi_handle_by_multi_index PROTO_PARAMS((vpiHandle obj,
777 PLI_INT32 num_index,
778 PLI_INT32 *index_array));
779
780 /**************************** GLOBAL VARIABLES ****************************/
781 PLI_VEXTERN PLI_DLLESPEC void (*vlog_startup_routines[])();
782 /* array of function pointers, last pointer should be null */
783 #undef PLI_EXTERN
784 #undef PLI_VEXTERN
785 #ifdef VPI_USER_DEFINED_DLLISPEC
786 #undef VPI_USER_DEFINED_DLLISPEC
787 #undef PLI_DLLISPEC
788 #endif
789 #ifdef VPI_USER_DEFINED_DLLESPEC
790 #undef VPI_USER_DEFINED_DLLESPEC
791 IEEE
792 HARDWARE DESCRIPTION LANGUAGE Std 1364-2001
793 #undef PLI_DLLESPEC
794 #endif
795 #ifdef PLI_PROTOTYPES
796 #undef PLI_PROTOTYPES
797 #undef PROTO_PARAMS
798 #undef XXTERN
799 #undef EETERN
800 #endif
801
802 #ifdef __cplusplus
803 }
804 #endif
805
806 #endif /* VPI_USER_H */
0 #!/bin/sh
1 echo "Cleaning out SVN directories..."
2 find . | grep '\.svn' | tac | awk '{print "rm -rf "$0}' | sh
3
4 echo "Making distribution tarball from SVN directory..."
5 cd ../
6 cat ./gtkwave3-gtk3/configure.ac | grep AC_INIT | awk '{print $2}' | sed 's/,//' | \
7 awk '{print "mv gtkwave3-gtk3 gtkwave-gtk3-"$0" ; tar cvf gtkwave-gtk3-"$0".tar gtkwave-gtk3-"$0" ; gzip -9 gtkwave-gtk3-"$0".tar"}' | sh
8
9 echo "Done!"
4949 #include "fsdb_wrapper_api.h"
5050
5151 #ifdef __MINGW32__
52 #define sleep(x) Sleep(x)
52 #define sleep(x) Sleep(x * 1000)
5353 #endif
5454
5555 #if !defined __MINGW32__
5757 #endif
5858
5959 #ifdef __MINGW32__
60 #define WIN32_LEAN_AND_MEAN
6061 #include <windows.h>
6162 #endif
6263
130131 #define FST_GZIO_LEN (32768)
131132 #define FST_HDR_FOURPACK_DUO_SIZE (4*1024*1024)
132133
133 #if defined(__i386__) || defined(__x86_64__) || defined(_AIX)
134 #if defined(__i386__) || defined(__x86_64__) || defined(_AIX) || defined(__aarch64__)
134135 #define FST_DO_MISALIGNED_OPS
135136 #endif
136137
333334 /*
334335 * mmap compatibility
335336 */
336 #if defined __CYGWIN__ || defined __MINGW32__
337 #if defined __MINGW32__
337338 #include <limits.h>
338339 #define fstMmap(__addr,__len,__prot,__flags,__fd,__off) fstMmap2((__len), (__fd), (__off))
339 #define fstMunmap(__addr,__len) free(__addr)
340 #define fstMunmap(__addr,__len) UnmapViewOfFile((LPCVOID)__addr)
340341
341342 static void *fstMmap2(size_t __len, int __fd, fst_off_t __off)
342343 {
343 (void)__off;
344
345 unsigned char *pnt = (unsigned char *)malloc(__len);
346 fst_off_t cur_offs = lseek(__fd, 0, SEEK_CUR);
347 size_t i;
348
349 lseek(__fd, 0, SEEK_SET);
350 for(i=0;i<__len;i+=SSIZE_MAX)
351 {
352 read(__fd, pnt + i, ((__len - i) >= SSIZE_MAX) ? SSIZE_MAX : (__len - i));
353 }
354 lseek(__fd, cur_offs, SEEK_SET);
355 return(pnt);
344 HANDLE handle = CreateFileMapping((HANDLE)_get_osfhandle(__fd), NULL,
345 PAGE_READWRITE, (DWORD)(__len >> 32),
346 (DWORD)__len, NULL);
347 if (!handle) { return NULL; }
348
349 void *ptr = MapViewOfFileEx(handle, FILE_MAP_READ | FILE_MAP_WRITE,
350 0, (DWORD)__off, (SIZE_T)__len, (LPVOID)NULL);
351 CloseHandle(handle);
352 return ptr;
356353 }
357354 #else
358355 #include <sys/mman.h>
983980 */
984981 static void fstWriterMmapSanity(void *pnt, const char *file, int line, const char *usage)
985982 {
986 #if !defined(__CYGWIN__) && !defined(__MINGW32__)
987 if(pnt == MAP_FAILED)
983 if(pnt == NULL
984 #ifdef MAP_FAILED
985 || pnt == MAP_FAILED
986 #endif
987 )
988988 {
989989 fprintf(stderr, "fstMmap() assigned to %s failed: errno: %d, file %s, line %d.\n", usage, errno, file, line);
990 #if !defined(__MINGW32__)
990991 perror("Why");
992 #else
993 LPSTR mbuf = NULL;
994 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM
995 | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
996 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
997 (LPSTR)&mbuf, 0, NULL);
998 fprintf(stderr, "%s", mbuf);
999 LocalFree(mbuf);
1000 #endif
9911001 pnt = NULL;
9921002 }
993 #endif
9941003 }
9951004
9961005
10361045
10371046 static void fstDestroyMmaps(struct fstWriterContext *xc, int is_closing)
10381047 {
1039 #if !defined __CYGWIN__ && !defined __MINGW32__
10401048 (void)is_closing;
1041 #endif
10421049
10431050 fstMunmap(xc->valpos_mem, xc->maxhandle * 4 * sizeof(uint32_t));
10441051 xc->valpos_mem = NULL;
1045
1046 #if defined __CYGWIN__ || defined __MINGW32__
1047 if(xc->curval_mem)
1048 {
1049 if(!is_closing) /* need to flush out for next emulated mmap() read */
1050 {
1051 unsigned char *pnt = xc->curval_mem;
1052 int __fd = fileno(xc->curval_handle);
1053 fst_off_t cur_offs = lseek(__fd, 0, SEEK_CUR);
1054 size_t i;
1055 size_t __len = xc->maxvalpos;
1056
1057 lseek(__fd, 0, SEEK_SET);
1058 for(i=0;i<__len;i+=SSIZE_MAX)
1059 {
1060 write(__fd, pnt + i, ((__len - i) >= SSIZE_MAX) ? SSIZE_MAX : (__len - i));
1061 }
1062 lseek(__fd, cur_offs, SEEK_SET);
1063 }
1064 }
1065 #endif
10661052
10671053 fstMunmap(xc->curval_mem, xc->maxvalpos);
10681054 xc->curval_mem = NULL;
34113397 unsigned do_rewind : 1;
34123398 char str_scope_nam[FST_ID_NAM_SIZ+1];
34133399 char str_scope_comp[FST_ID_NAM_SIZ+1];
3400 char *str_scope_attr;
34143401
34153402 unsigned fseek_failed : 1;
34163403
41394126 cl = 0;
41404127 while((ch = fgetc(xc->fh)))
41414128 {
4142 if(cl <= FST_ID_NAM_SIZ)
4129 if(cl < FST_ID_NAM_SIZ)
41434130 {
41444131 pnt[cl++] = ch;
41454132 }
41514138 cl = 0;
41524139 while((ch = fgetc(xc->fh)))
41534140 {
4154 if(cl <= FST_ID_NAM_SIZ)
4141 if(cl < FST_ID_NAM_SIZ)
41554142 {
41564143 pnt[cl++] = ch;
41574144 }
41684155 xc->hier.htyp = FST_HT_ATTRBEGIN;
41694156 xc->hier.u.attr.typ = fgetc(xc->fh);
41704157 xc->hier.u.attr.subtype = fgetc(xc->fh);
4171 xc->hier.u.attr.name = pnt = xc->str_scope_nam;
4158 if(!xc->str_scope_attr)
4159 {
4160 xc->str_scope_attr = (char *)calloc(1, FST_ID_NAM_ATTR_SIZ+1);
4161 }
4162 xc->hier.u.attr.name = pnt = xc->str_scope_attr;
41724163 cl = 0;
41734164 while((ch = fgetc(xc->fh)))
41744165 {
4175 if(cl <= FST_ID_NAM_SIZ)
4166 if(cl < FST_ID_NAM_ATTR_SIZ)
41764167 {
41774168 pnt[cl++] = ch;
41784169 }
4179 }; /* scopename */
4170 }; /* attrname */
41804171 pnt[cl] = 0;
41814172 xc->hier.u.attr.name_length = cl;
41824173
42364227 cl = 0;
42374228 while((ch = fgetc(xc->fh)))
42384229 {
4239 if(cl <= FST_ID_NAM_SIZ)
4230 if(cl < FST_ID_NAM_SIZ)
42404231 {
42414232 pnt[cl++] = ch;
42424233 }
43754366 cl = 0;
43764367 while((ch = fgetc(xc->fh)))
43774368 {
4378 if(cl <= FST_ID_NAM_ATTR_SIZ)
4369 if(cl < FST_ID_NAM_ATTR_SIZ)
43794370 {
43804371 pnt[cl++] = ch;
43814372 }
43974388 cl = 0;
43984389 while((ch = fgetc(xc->fh)))
43994390 {
4400 if(cl <= FST_ID_NAM_ATTR_SIZ)
4391 if(cl < FST_ID_NAM_ATTR_SIZ)
44014392 {
44024393 pnt[cl++] = ch;
44034394 }
44864477 cl = 0;
44874478 while((ch = fgetc(xc->fh)))
44884479 {
4489 if(cl <= FST_ID_NAM_ATTR_SIZ)
4480 if(cl < FST_ID_NAM_ATTR_SIZ)
44904481 {
44914482 pnt[cl++] = ch;
44924483 }
49734964 free(xc->signal_typs); xc->signal_typs = NULL;
49744965 free(xc->signal_lens); xc->signal_lens = NULL;
49754966 free(xc->filename); xc->filename = NULL;
4967 free(xc->str_scope_attr); xc->str_scope_attr = NULL;
49764968
49774969 if(xc->fh)
49784970 {
170170 }
171171
172172
173 static vztint32_t vzt_rd_get_v32(char **mmx)
174 {
175 signed char *c;
176 signed char *beg;
173 static vztint32_t vzt_rd_get_v32(unsigned char **mmx)
174 {
175 unsigned char *c;
176 unsigned char *beg;
177177 vztint32_t val;
178 signed char **mm = (signed char **)mmx;
178 unsigned char **mm = mmx;
179179
180180 c = *mm;
181181 beg = c;
182182
183 if(*c>=0)
184 {
185 while(*c>=0) c++;
183 if(!(*c & 0x80))
184 {
185 while(!(*c & 0x80)) c++;
186186 *mm = c+1;
187187
188188 val = (vztint32_t)(*c&0x7f);
201201 return(val);
202202 }
203203
204 static vztint64_t vzt_rd_get_v64(char **mmx)
205 {
206 signed char *c;
207 signed char *beg;
204 static vztint64_t vzt_rd_get_v64(unsigned char **mmx)
205 {
206 unsigned char *c;
207 unsigned char *beg;
208208 vztint64_t val;
209 signed char **mm = (signed char **)mmx;
209 unsigned char **mm = mmx;
210210
211211 c = *mm;
212212 beg = c;
213213
214 if(*c>=0)
215 {
216 while(*c>=0) c++;
214 if(!(*c & 0x80))
215 {
216 while(!(*c & 0x80)) c++;
217217 *mm = c+1;
218218
219219 val = (vztint64_t)(*c&0x7f);
313313 vztint32_t *change_dict=NULL;
314314 vztint32_t *val_dict=NULL;
315315 unsigned int num_time_ticks, num_sections, num_dict_entries;
316 char *pnt = b->mem;
316 unsigned char *pnt = b->mem;
317317 vztint32_t i, j, m, num_dict_words;
318318 /* vztint32_t *block_end = (vztint32_t *)(pnt + b->uncompressed_siz); */
319319 vztint32_t *val_tmp;
781781 else
782782 {
783783 unsigned int spnt=vzt_rd_make_sindex(pnt);
784 char *msg = ((!i)&(!b->prev)) ? "UNDEF" : b->sindex[spnt];
784 char *msg = ((!i)&&(b->prev)) ? "UNDEF" : b->sindex[spnt];
785785 lt->value_change_callback(&lt, &b->times[i], &idx, &msg);
786786 }
787787 }
856856 else
857857 {
858858 unsigned int spnt=vzt_rd_make_sindex(pnt);
859 char *msg = ((!i)&(!b->prev)) ? "UNDEF" : b->sindex[spnt];
859 char *msg = ((!i)&&(b->prev)) ? "UNDEF" : b->sindex[spnt];
860860 lt->value_change_callback(&lt, &b->times[i], &idx, &msg);
861861 }
862862 }
907907 else
908908 {
909909 unsigned int spnt=vzt_rd_make_sindex(pnt);
910 char *msg = ((!i)&(!b->prev)) ? "UNDEF" : b->sindex[spnt];
910 char *msg = ((!i)&&(b->prev)) ? "UNDEF" : b->sindex[spnt];
911911 lt->value_change_callback(&lt, &b->times[i], &idx, &msg);
912912 }
913913 }
12581258 struct vzt_wr_symbol *s = lt->sorted_facs[j];
12591259 for(i=0;i<s->len;i++)
12601260 {
1261 lt->use_multi_state |= s->chgx[i];
1261 if (s->chgx[i] != 0) {
1262 lt->use_multi_state = 1;
1263 }
12621264 t = vzt_wr_dsvzt_splay(s->chgx[i], t);
12631265 if(!vzt_wr_dsvzt_success)
12641266 {
13071309 for(i=0;i<s->len;i++)
13081310 {
13091311 t = s->prevx[i]->child;
1310 lt->use_multi_state |= s->chgx[i];
1312 if (s->chgx[i] != 0) {
1313 lt->use_multi_state = 1;
1314 }
13111315 t = vzt_wr_dsvzt_splay(s->chgx[i], t);
13121316 if(!vzt_wr_dsvzt_success)
13131317 {