Merge tag 'upstream/3.3.39'
Upstream version 3.3.39
أحمد المحمودي (Ahmed El-Mahmoudy)
11 years ago
0 | 0 | Analog support is new as of 1.3.81 and should be considered experimental. |
1 | 1 | The analog waves are auto-scaling. Manual scaling will be added in a |
2 | 2 | future release. If you wish to make an analog wave taller, simply |
3 | highlight the wave you want to make larger and press CTRL-A to add extra | |
4 | rows to the wave. | |
3 | highlight the wave you want to make larger and right click-select Insert | |
4 | Analog Height Extension from the popup menu. | |
5 | 5 | |
6 | 6 | Note that currently double floats are not written in a platform |
7 | 7 | independent manner with GHW files. This should not be an issue unless you |
1236 | 1236 | Changed twinwave for MinGW so that it does not target two |
1237 | 1237 | panes in a single window. Something is apparently now |
1238 | 1238 | broken in the GtkSocket/GtkPlug implementation for Win32. |
1239 | 3.3.39 08aug12 Fixed relative pathnames when generated in MinGW and used | |
1240 | back on Linux. | |
1241 | Added --output filename option to fst2vcd, vzt2vcd, and | |
1242 | lxt2vcd. | |
1243 | Fix crash on OSX if gtk_widget_set_sensitive is called on | |
1244 | a separator. | |
1245 | Fixed OSX version so it looks for .gtkwaverc in the home | |
1246 | directory and if not found, probes the resource bundle for | |
1247 | Contents/Resources/examples/gtkwaverc (no dot in the name). | |
1248 | Added GTKWave User's Guide option to help menu on OSX. | |
1249 | Added + vs ++ separators for twinwave. | |
1250 | Dynamic resize fixes. |
0 | 0 | ########################################################################## |
1 | 1 | |
2 | GTKWave 3.3.37 Wave Viewer is Copyright (C) 1999-2012 Tony Bybell. | |
2 | GTKWave 3.3.39 Wave Viewer is Copyright (C) 1999-2012 Tony Bybell. | |
3 | 3 | Portions of GTKWave are Copyright (C) 1999-2012 Udi Finkelstein. |
4 | 4 | Context support is Copyright (C) 2007-2012 Kermin Elliott Fleming. |
5 | 5 | Trace group support is Copyright (C) 2009-2012 Donald Baltus. |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.63 for gtkwave 3.3.38. | |
2 | # Generated by GNU Autoconf 2.63 for gtkwave 3.3.39. | |
3 | 3 | # |
4 | 4 | # Report bugs to <bybell@rocketmail.com>. |
5 | 5 | # |
595 | 595 | # Identity of this package. |
596 | 596 | PACKAGE_NAME='gtkwave' |
597 | 597 | PACKAGE_TARNAME='gtkwave' |
598 | PACKAGE_VERSION='3.3.38' | |
599 | PACKAGE_STRING='gtkwave 3.3.38' | |
598 | PACKAGE_VERSION='3.3.39' | |
599 | PACKAGE_STRING='gtkwave 3.3.39' | |
600 | 600 | PACKAGE_BUGREPORT='bybell@rocketmail.com' |
601 | 601 | |
602 | 602 | ac_unique_file="src/vcd.c" |
1385 | 1385 | # Omit some internal or obsolete options to make the list less imposing. |
1386 | 1386 | # This message is too long to be a string in the A/UX 3.1 sh. |
1387 | 1387 | cat <<_ACEOF |
1388 | \`configure' configures gtkwave 3.3.38 to adapt to many kinds of systems. | |
1388 | \`configure' configures gtkwave 3.3.39 to adapt to many kinds of systems. | |
1389 | 1389 | |
1390 | 1390 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1391 | 1391 | |
1451 | 1451 | |
1452 | 1452 | if test -n "$ac_init_help"; then |
1453 | 1453 | case $ac_init_help in |
1454 | short | recursive ) echo "Configuration of gtkwave 3.3.38:";; | |
1454 | short | recursive ) echo "Configuration of gtkwave 3.3.39:";; | |
1455 | 1455 | esac |
1456 | 1456 | cat <<\_ACEOF |
1457 | 1457 | |
1588 | 1588 | test -n "$ac_init_help" && exit $ac_status |
1589 | 1589 | if $ac_init_version; then |
1590 | 1590 | cat <<\_ACEOF |
1591 | gtkwave configure 3.3.38 | |
1591 | gtkwave configure 3.3.39 | |
1592 | 1592 | generated by GNU Autoconf 2.63 |
1593 | 1593 | |
1594 | 1594 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
1602 | 1602 | This file contains any messages produced by compilers while |
1603 | 1603 | running configure, to aid debugging if configure makes a mistake. |
1604 | 1604 | |
1605 | It was created by gtkwave $as_me 3.3.38, which was | |
1605 | It was created by gtkwave $as_me 3.3.39, which was | |
1606 | 1606 | generated by GNU Autoconf 2.63. Invocation command line was |
1607 | 1607 | |
1608 | 1608 | $ $0 $@ |
2452 | 2452 | |
2453 | 2453 | # Define the identity of the package. |
2454 | 2454 | PACKAGE='gtkwave' |
2455 | VERSION='3.3.38' | |
2455 | VERSION='3.3.39' | |
2456 | 2456 | |
2457 | 2457 | |
2458 | 2458 | cat >>confdefs.h <<_ACEOF |
14296 | 14296 | # report actual input values of CONFIG_FILES etc. instead of their |
14297 | 14297 | # values after options handling. |
14298 | 14298 | ac_log=" |
14299 | This file was extended by gtkwave $as_me 3.3.38, which was | |
14299 | This file was extended by gtkwave $as_me 3.3.39, which was | |
14300 | 14300 | generated by GNU Autoconf 2.63. Invocation command line was |
14301 | 14301 | |
14302 | 14302 | CONFIG_FILES = $CONFIG_FILES |
14359 | 14359 | _ACEOF |
14360 | 14360 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
14361 | 14361 | ac_cs_version="\\ |
14362 | gtkwave config.status 3.3.38 | |
14362 | gtkwave config.status 3.3.39 | |
14363 | 14363 | configured by $0, generated by GNU Autoconf 2.63, |
14364 | 14364 | with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" |
14365 | 14365 |
1 | 1 | # Process this file with autoconf to produce a configure script. |
2 | 2 | |
3 | 3 | AC_PREREQ(2.59) |
4 | AC_INIT(gtkwave, 3.3.38, bybell@rocketmail.com) | |
4 | AC_INIT(gtkwave, 3.3.39, bybell@rocketmail.com) | |
5 | 5 | AC_CONFIG_SRCDIR([src/vcd.c]) |
6 | 6 | AM_INIT_AUTOMAKE |
7 | 7 | AC_CONFIG_HEADER([config.h]) |
64 | 64 | <binary>${prefix}/bin/vcd2vzt</binary> |
65 | 65 | <binary>${prefix}/bin/vzt2vcd</binary> |
66 | 66 | <binary>${prefix}/bin/vztminer</binary> |
67 | <binary>${prefix}/bin/fstminer</binary> | |
67 | 68 | <binary>${prefix}/bin/rtlbrowse</binary> |
68 | 69 | <binary>${prefix}/bin/vermin</binary> |
69 | 70 | |
212 | 213 | <data dest="${bundle}/Contents/Resources/man/vztminer.1"> |
213 | 214 | ${project}/../../man/vztminer.1 |
214 | 215 | </data> |
216 | <data dest="${bundle}/Contents/Resources/man/fstminer.1"> | |
217 | ${project}/../../man/fstminer.1 | |
218 | </data> | |
215 | 219 | <data dest="${bundle}/Contents/Resources/doc/gtkwave.odt"> |
216 | 220 | ${project}/../../doc/gtkwave.odt |
221 | </data> | |
222 | <data dest="${bundle}/Contents/Resources/doc/gtkwave.pdf"> | |
223 | ${project}/gtkwave.pdf | |
217 | 224 | </data> |
218 | 225 | |
219 | 226 |
0 | 0 | #!/bin/sh |
1 | ||
2 | if [ -f ./gtkwave.pdf ] | |
3 | then | |
4 | echo Skipping download of gtkwave.pdf | |
5 | else | |
6 | echo Downloading gtkwave.pdf... | |
7 | curl http://gtkwave.sourceforge.net/gtkwave.pdf >gtkwave.pdf | |
8 | fi | |
1 | 9 | |
2 | 10 | gcc -o ../../examples/transaction ../../examples/transaction.c -DHAVE_INTTYPES_H |
3 | 11 |
Binary diff not shown
0 | .TH "FST2VCD" "1" "3.2.2" "Anthony Bybell" "Filetype Conversion" | |
0 | .TH "FST2VCD" "1" "3.3.29" "Anthony Bybell" "Filetype Conversion" | |
1 | 1 | .SH "NAME" |
2 | 2 | .LP |
3 | 3 | fst2vcd \- Converts FST files to VCD |
6 | 6 | fst2vcd [\fIoption\fP]... [\fIFSTFILE\fP] |
7 | 7 | .SH "DESCRIPTION" |
8 | 8 | .LP |
9 | Converts FST files to VCD files on stdout. | |
9 | Converts FST files to VCD files. If an output filename is not specified, the VCD is emitted to stdout. | |
10 | 10 | |
11 | 11 | .SH "OPTIONS" |
12 | 12 | .LP |
13 | 13 | .TP |
14 | 14 | \fB\-f,\-\-fstname\fR <\fIfilename\fP> |
15 | 15 | Specify FST input filename. |
16 | .TP | |
17 | \fB\-o,\-\-output\fR <\fIfilename\fP> | |
18 | Specify optional VCD output filename. | |
16 | 19 | .TP |
17 | 20 | \fB\-h,\-\-help\fR |
18 | 21 | Display help then exit. |
0 | .TH "LXT2VCD" "1" "3.2.2" "Anthony Bybell" "Filetype Conversion" | |
0 | .TH "LXT2VCD" "1" "3.3.39" "Anthony Bybell" "Filetype Conversion" | |
1 | 1 | .SH "NAME" |
2 | 2 | .LP |
3 | 3 | lxt2vcd \- Converts LXT2 files to VCD |
6 | 6 | lxt2vcd [\fIoption\fP]... [\fILXT2FILE\fP] |
7 | 7 | .SH "DESCRIPTION" |
8 | 8 | .LP |
9 | Converts LXT2 files to VCD files on stdout. Note that "regular" LXT2 files will convert to VCD files with monotonically increasing time values. LXT2 | |
9 | Converts LXT2 files to VCD files on stdout. If an output filename is not specified, the VCD is emitted to stdout. Note that "regular" LXT2 files will convert to VCD files with monotonically increasing time values. LXT2 | |
10 | 10 | files which are dumped with the "partial" option (to speed up access in wave viewers) will dump with monotonically increasing time values per 2k block |
11 | 11 | of nets. This may be fixed in later versions of \fIlxt2vcd\fP. |
12 | 12 | |
15 | 15 | .TP |
16 | 16 | \fB\-l,\-\-lxtname\fR <\fIfilename\fP> |
17 | 17 | Specify LXT2 input filename. |
18 | .TP | |
19 | \fB\-o,\-\-output\fR <\fIfilename\fP> | |
20 | Specify optional VCD output filename. | |
18 | 21 | .TP |
19 | 22 | \fB\-f,\-\-flatearth\fR |
20 | 23 | Emit flattened hierarchies. |
0 | .TH "TWINWAVE" "1" "3.3.28" "Anthony Bybell" "Simulation Wave Viewer Multiplexer" | |
0 | .TH "TWINWAVE" "1" "3.3.39" "Anthony Bybell" "Simulation Wave Viewer Multiplexer" | |
1 | 1 | .SH "NAME" |
2 | 2 | .LP |
3 | twinwave \- Wraps multiple GTKWave sessions in one window | |
3 | twinwave \- Wraps multiple GTKWave sessions in one window or two synchronized windows | |
4 | 4 | .SH "SYNTAX" |
5 | 5 | .LP |
6 | twinwave <\fIarglist1\fP> + <\fIarglist2\fP> | |
6 | twinwave <\fIarglist1\fP> <\fIseparator\fP> <\fIarglist2\fP> | |
7 | 7 | .SH "DESCRIPTION" |
8 | 8 | .LP |
9 | Wraps multiple GTKWave sessions in one window with synchronized markers, horizontal scrolling, and zooming. | |
9 | Wraps multiple GTKWave sessions with synchronized markers, horizontal scrolling, and zooming. | |
10 | 10 | .SH "EXAMPLES" |
11 | 11 | .LP |
12 | 12 | To run this program the standard way type: |
13 | 13 | .TP |
14 | 14 | twinwave filename1.vcd filename1.sav + filename2.vcd filename2.sav |
15 | Two viewers are then opened in one window. | |
15 | Two synchronized viewers are then opened in one window. | |
16 | .TP | |
17 | twinwave filename1.vcd filename1.sav ++ filename2.vcd filename2.sav | |
18 | Two synchronized viewers are then opened in two windows. | |
16 | 19 | .SH "LIMITATIONS" |
17 | 20 | \fItwinwave\fP uses the GtkSocket/GtkPlug mechanism to embed two \fIgtkwave\fP(1) sessions into one window. The amount of |
18 | 21 | coupling is currently limited to communication of temporal information. Other than that, the two gtkwave processes are isolated |
20 | 23 | Keep in mind that using the same save file for each session |
21 | 24 | may cause unintended behavior problems if the save file is written back to disk: only the session written last will be saved. (i.e., |
22 | 25 | the save file isn't cloned and made unique to each session.) |
23 | Note that \fItwinwave\fP compiled against Quartz (not X11) on OSX does not place both sessions in a single window. | |
26 | Note that \fItwinwave\fP compiled against Quartz (not X11) on OSX as well as MinGW does not place both sessions in a single window. | |
24 | 27 | .LP |
25 | 28 | .SH "AUTHORS" |
26 | 29 | .LP |
0 | .TH "VZT2VCD" "1" "3.2.2" "Anthony Bybell" "Filetype Conversion" | |
0 | .TH "VZT2VCD" "1" "3.3.39" "Anthony Bybell" "Filetype Conversion" | |
1 | 1 | .SH "NAME" |
2 | 2 | .LP |
3 | 3 | vzt2vcd \- Converts VZT files to VCD |
6 | 6 | vzt2vcd [\fIoption\fP]... [\fIVZTFILE\fP] |
7 | 7 | .SH "DESCRIPTION" |
8 | 8 | .LP |
9 | Converts VZT files to VCD files on stdout. | |
9 | Converts VZT files to VCD files. If an output filename is not specified, the VCD is emitted to stdout. | |
10 | 10 | |
11 | 11 | .SH "OPTIONS" |
12 | 12 | .LP |
13 | 13 | .TP |
14 | 14 | \fB\-v,\-\-vztname\fR <\fIfilename\fP> |
15 | 15 | Specify VZT input filename. |
16 | .TP | |
17 | \fB\-o,\-\-output\fR <\fIfilename\fP> | |
18 | Specify optional VCD output filename. | |
16 | 19 | .TP |
17 | 20 | \fB\-f,\-\-flatearth\fR |
18 | 21 | Emit flattened hierarchies. |
12 | 12 | |
13 | 13 | #include "alert_sheet.m" |
14 | 14 | #include <sys/stat.h> |
15 | ||
16 | /*************************/ | |
17 | /* menu.c */ | |
18 | /*************************/ | |
19 | ||
20 | void gtk_open_external_file(const char *fpath) | |
21 | { | |
22 | NSString *nspath = [NSString stringWithUTF8String:fpath]; | |
23 | [[NSWorkspace sharedWorkspace] openFile:nspath]; | |
24 | } | |
25 | ||
15 | 26 | |
16 | 27 | /*************************/ |
17 | 28 | /* file.c */ |
14 | 14 | #endif |
15 | 15 | #include <gtk/gtk.h> |
16 | 16 | |
17 | void gtk_open_external_file(const char *fpath); | |
17 | 18 | char *gtk_file_req_bridge(const char *title, const char *fpath, const char *pattn, int is_writemode); |
18 | 19 | int gtk_simplereqbox_req_bridge(char *title, char *default_text, char *oktext, char *canceltext, int is_alert); |
19 | 20 | int entrybox_req_bridge(char *title, int width, char *dflt_text, char *comment, int maxch, char **out_text_entry); |
798 | 798 | 0, /* signal_fill_width 374 */ |
799 | 799 | 0, /* old_signal_fill_width 375 */ |
800 | 800 | 0, /* old_signal_fill_height */ |
801 | 1, /* right_align_active */ | |
801 | 802 | 1, /* fontheight 376 */ |
802 | 803 | 0, /* dnd_state 377 */ |
803 | 804 | 0, /* dnd_cursor_timer */ |
1229 | 1230 | 0, /* use_big_fonts 594 */ |
1230 | 1231 | 0, /* use_nonprop_fonts */ |
1231 | 1232 | ~0, /* do_resize_signals 595 */ |
1233 | ~0, /* first_unsized_signals */ | |
1232 | 1234 | 0, /* initial_signal_window_width */ |
1233 | 1235 | 0, /* constant_marker_update 596 */ |
1234 | 1236 | 0, /* use_roundcaps 597 */ |
797 | 797 | int signal_fill_width; /* from signalwindow.c 401 */ |
798 | 798 | int old_signal_fill_width; /* from signalwindow.c 402 */ |
799 | 799 | int old_signal_fill_height; /* from signalwindow.c 403 */ |
800 | int right_align_active; /* from signalwindow.c */ | |
800 | 801 | int fontheight; /* from signalwindow.c 404 */ |
801 | 802 | char dnd_state; /* from signalwindow.c 405 */ |
802 | 803 | unsigned int dnd_cursor_timer; /* from signalwindow.c */ |
1214 | 1215 | char use_big_fonts; /* from wavewindow.c 648 */ |
1215 | 1216 | char use_nonprop_fonts; /* from wavewindow.c 649 */ |
1216 | 1217 | char do_resize_signals; /* from wavewindow.c 650 */ |
1218 | char first_unsized_signals; | |
1217 | 1219 | int initial_signal_window_width; |
1218 | 1220 | char constant_marker_update; /* from wavewindow.c 651 */ |
1219 | 1221 | char use_roundcaps; /* from wavewindow.c 652 */ |
28 | 28 | |
29 | 29 | #include "wave_locale.h" |
30 | 30 | |
31 | #define FST_VCD_WRITE_BUF_SIZ (2 * 1024 * 1024) | |
32 | ||
31 | 33 | void print_help(char *nam) |
32 | 34 | { |
33 | 35 | #ifdef __linux__ |
34 | 36 | printf( |
35 | 37 | "Usage: %s [OPTION]... [FSTFILE]\n\n" |
36 | 38 | " -f, --fstname=FILE specify FST input filename\n" |
39 | " -o, --output=FILE specify output filename\n" | |
37 | 40 | " -h, --help display this help then exit\n\n" |
38 | "VCD is emitted to stdout.\n\n" | |
41 | "VCD is emitted to stdout if output filename is unspecified.\n\n" | |
39 | 42 | "Report bugs to <"PACKAGE_BUGREPORT">.\n",nam); |
40 | 43 | #else |
41 | 44 | printf( |
42 | 45 | "Usage: %s [OPTION]... [FSTFILE]\n\n" |
43 | 46 | " -f specify FST input filename\n" |
47 | " -o specify output filename\n" | |
44 | 48 | " -h display this help then exit\n\n" |
45 | ||
46 | "FST is emitted to stdout.\n\n" | |
49 | "VCD is emitted to stdout if output filename is unspecified.\n\n" | |
47 | 50 | "Report bugs to <"PACKAGE_BUGREPORT">.\n",nam); |
48 | 51 | #endif |
49 | 52 | |
55 | 58 | { |
56 | 59 | char opt_errors_encountered=0; |
57 | 60 | char *fstname=NULL; |
61 | char *outname=NULL; | |
62 | char *fvbuf=NULL; | |
58 | 63 | int c; |
59 | 64 | struct fstReaderContext *xc; |
60 | 65 | FILE *fv; |
69 | 74 | static struct option long_options[] = |
70 | 75 | { |
71 | 76 | {"fstname", 1, 0, 'f'}, |
77 | {"output", 1, 0, 'o'}, | |
72 | 78 | {"help", 0, 0, 'h'}, |
73 | 79 | {0, 0, 0, 0} |
74 | 80 | }; |
75 | 81 | |
76 | c = getopt_long (argc, argv, "f:h", long_options, &option_index); | |
82 | c = getopt_long (argc, argv, "f:o:h", long_options, &option_index); | |
77 | 83 | #else |
78 | c = getopt (argc, argv, "f:h"); | |
84 | c = getopt (argc, argv, "f:o:h"); | |
79 | 85 | #endif |
80 | 86 | |
81 | 87 | if (c == -1) break; /* no more args */ |
86 | 92 | if(fstname) free(fstname); |
87 | 93 | fstname = malloc(strlen(optarg)+1); |
88 | 94 | strcpy(fstname, optarg); |
95 | break; | |
96 | ||
97 | case 'o': | |
98 | if(outname) free(outname); | |
99 | outname = malloc(strlen(optarg)+1); | |
100 | strcpy(outname, optarg); | |
89 | 101 | break; |
90 | 102 | |
91 | 103 | case 'h': |
129 | 141 | |
130 | 142 | if(!xc) |
131 | 143 | { |
132 | fprintf(stderr, "could not open '%s', exiting.\n", fstname); | |
144 | fprintf(stderr, "Could not open '%s', exiting.\n", fstname); | |
133 | 145 | exit(255); |
134 | 146 | } |
135 | 147 | |
136 | fv = stdout; | |
148 | if(outname) | |
149 | { | |
150 | fv = fopen(outname, "wb"); | |
151 | if(!fv) | |
152 | { | |
153 | fprintf(stderr, "Could not open '%s', exiting.\n", outname); | |
154 | perror("Why"); | |
155 | exit(255); | |
156 | } | |
157 | fvbuf = malloc(FST_VCD_WRITE_BUF_SIZ); | |
158 | setvbuf(fv, fvbuf, _IOFBF, FST_VCD_WRITE_BUF_SIZ); | |
159 | } | |
160 | else | |
161 | { | |
162 | fv = stdout; | |
163 | } | |
164 | ||
137 | 165 | if(!fstReaderProcessHier(xc, fv)) /* these 3 lines do all the VCD writing work */ |
138 | 166 | { |
139 | 167 | fprintf(stderr, "could not process hierarchy for '%s', exiting.\n", fstname); |
143 | 171 | fstReaderIterBlocks(xc, NULL, NULL, fv); /* these 3 lines do all the VCD writing work */ |
144 | 172 | |
145 | 173 | fstReaderClose(xc); |
174 | ||
175 | if(outname) | |
176 | { | |
177 | free(outname); | |
178 | fclose(fv); | |
179 | } | |
180 | ||
181 | free(fvbuf); | |
146 | 182 | free(fstname); |
147 | 183 | |
148 | 184 | exit(0); |
33 | 33 | static int names_only = 0; |
34 | 34 | static char *killed_list = NULL; |
35 | 35 | char killed_value = 1; |
36 | ||
37 | extern void free_hier(void); | |
38 | extern char *output_hier(char *name); | |
39 | 36 | |
40 | 37 | char vcd_blackout; |
41 | 38 |
30 | 30 | |
31 | 31 | #include "wave_locale.h" |
32 | 32 | |
33 | #define LXT_VCD_WRITE_BUF_SIZ (2 * 1024 * 1024) | |
34 | ||
33 | 35 | int flat_earth = 0; |
34 | 36 | int notruncate = 0; |
37 | static FILE *fv = NULL; | |
38 | ||
35 | 39 | extern void free_hier(void); |
36 | extern char *output_hier(char *name); | |
40 | extern char *fv_output_hier(FILE *fv, char *name); | |
37 | 41 | |
38 | 42 | |
39 | 43 | /* |
122 | 126 | if(vcd_prevtime != *pnt_time) |
123 | 127 | { |
124 | 128 | vcd_prevtime = *pnt_time; |
125 | printf("#"LXT2_RD_LLD"\n", *pnt_time); | |
129 | fprintf(fv, "#"LXT2_RD_LLD"\n", *pnt_time); | |
126 | 130 | } |
127 | 131 | |
128 | 132 | if(!(*pnt_value)[0]) |
130 | 134 | if(!vcd_blackout) |
131 | 135 | { |
132 | 136 | vcd_blackout = 1; |
133 | printf("$dumpoff\n"); | |
137 | fprintf(fv, "$dumpoff\n"); | |
134 | 138 | } |
135 | 139 | |
136 | 140 | return; |
140 | 144 | if(vcd_blackout) |
141 | 145 | { |
142 | 146 | vcd_blackout = 0; |
143 | printf("$dumpon\n"); | |
147 | fprintf(fv, "$dumpon\n"); | |
144 | 148 | } |
145 | 149 | } |
146 | 150 | |
147 | 151 | if(g->flags & LXT2_RD_SYM_F_DOUBLE) |
148 | 152 | { |
149 | printf("r%s %s\n", *pnt_value, vcdid(*pnt_facidx)); | |
153 | fprintf(fv, "r%s %s\n", *pnt_value, vcdid(*pnt_facidx)); | |
150 | 154 | } |
151 | 155 | else |
152 | 156 | if(g->flags & LXT2_RD_SYM_F_STRING) |
153 | 157 | { |
154 | printf("s%s %s\n", *pnt_value, vcdid(*pnt_facidx)); | |
158 | fprintf(fv, "s%s %s\n", *pnt_value, vcdid(*pnt_facidx)); | |
155 | 159 | } |
156 | 160 | else |
157 | 161 | { |
158 | 162 | if(g->len==1) |
159 | 163 | { |
160 | printf("%c%s\n", (*pnt_value)[0], vcdid(*pnt_facidx)); | |
164 | fprintf(fv, "%c%s\n", (*pnt_value)[0], vcdid(*pnt_facidx)); | |
161 | 165 | } |
162 | 166 | else |
163 | 167 | { |
164 | printf("b%s %s\n", vcd_truncate_bitvec(*pnt_value), vcdid(*pnt_facidx)); | |
168 | fprintf(fv, "b%s %s\n", vcd_truncate_bitvec(*pnt_value), vcdid(*pnt_facidx)); | |
165 | 169 | } |
166 | 170 | } |
167 | 171 | } |
215 | 219 | } |
216 | 220 | |
217 | 221 | time(&walltime); |
218 | printf("$date\n"); | |
219 | printf("\t%s",asctime(localtime(&walltime))); | |
220 | printf("$end\n"); | |
221 | printf("$version\n\tlxt2vcd\n$end\n"); | |
222 | printf("$timescale %d%c%c $end\n", time_scale, time_dimension, !scale ? ' ' : 's'); | |
222 | fprintf(fv, "$date\n"); | |
223 | fprintf(fv, "\t%s",asctime(localtime(&walltime))); | |
224 | fprintf(fv, "$end\n"); | |
225 | fprintf(fv, "$version\n\tlxt2vcd\n$end\n"); | |
226 | fprintf(fv, "$timescale %d%c%c $end\n", time_scale, time_dimension, !scale ? ' ' : 's'); | |
223 | 227 | |
224 | 228 | timezero = lxt2_rd_get_timezero(lt); |
225 | 229 | if(timezero) |
226 | 230 | { |
227 | printf("$timezero "LXT2_RD_LLD" $end\n", timezero); | |
231 | fprintf(fv, "$timezero "LXT2_RD_LLD" $end\n", timezero); | |
228 | 232 | } |
229 | 233 | |
230 | 234 | for(i=0;i<numfacs;i++) |
234 | 238 | |
235 | 239 | if(!flat_earth) |
236 | 240 | { |
237 | netname = output_hier(lxt2_rd_get_facname(lt, i)); | |
241 | netname = fv_output_hier(fv, lxt2_rd_get_facname(lt, i)); | |
238 | 242 | } |
239 | 243 | else |
240 | 244 | { |
243 | 247 | |
244 | 248 | if(g->flags & LXT2_RD_SYM_F_DOUBLE) |
245 | 249 | { |
246 | printf("$var real 1 %s %s $end\n", vcdid(newindx), netname); | |
250 | fprintf(fv, "$var real 1 %s %s $end\n", vcdid(newindx), netname); | |
247 | 251 | } |
248 | 252 | else |
249 | 253 | if(g->flags & LXT2_RD_SYM_F_STRING) |
250 | 254 | { |
251 | printf("$var real 1 %s %s $end\n", vcdid(newindx), netname); | |
255 | fprintf(fv, "$var real 1 %s %s $end\n", vcdid(newindx), netname); | |
252 | 256 | } |
253 | 257 | else |
254 | 258 | |
257 | 261 | { |
258 | 262 | if(g->msb!=-1) |
259 | 263 | { |
260 | printf("$var wire 1 %s %s ["LXT2_RD_LD"] $end\n", vcdid(newindx), netname, g->msb); | |
264 | fprintf(fv, "$var wire 1 %s %s ["LXT2_RD_LD"] $end\n", vcdid(newindx), netname, g->msb); | |
261 | 265 | } |
262 | 266 | else |
263 | 267 | { |
264 | printf("$var wire 1 %s %s $end\n", vcdid(newindx), netname); | |
268 | fprintf(fv, "$var wire 1 %s %s $end\n", vcdid(newindx), netname); | |
265 | 269 | } |
266 | 270 | } |
267 | 271 | else |
268 | 272 | { |
269 | 273 | if(!(g->flags & LXT2_RD_SYM_F_INTEGER)) |
270 | 274 | { |
271 | printf("$var wire "LXT2_RD_LD" %s %s ["LXT2_RD_LD":"LXT2_RD_LD"] $end\n", g->len, vcdid(newindx), netname, g->msb, g->lsb); | |
275 | fprintf(fv, "$var wire "LXT2_RD_LD" %s %s ["LXT2_RD_LD":"LXT2_RD_LD"] $end\n", g->len, vcdid(newindx), netname, g->msb, g->lsb); | |
272 | 276 | } |
273 | 277 | else |
274 | 278 | { |
275 | printf("$var integer "LXT2_RD_LD" %s %s $end\n", g->len, vcdid(newindx), netname); | |
279 | fprintf(fv, "$var integer "LXT2_RD_LD" %s %s $end\n", g->len, vcdid(newindx), netname); | |
276 | 280 | } |
277 | 281 | } |
278 | 282 | } |
280 | 284 | |
281 | 285 | if(!flat_earth) |
282 | 286 | { |
283 | output_hier(""); /* flush any remaining hierarchy if not back to toplevel */ | |
287 | fv_output_hier(fv, ""); /* flush any remaining hierarchy if not back to toplevel */ | |
284 | 288 | free_hier(); |
285 | 289 | } |
286 | 290 | |
287 | printf("$enddefinitions $end\n"); | |
288 | printf("$dumpvars\n"); | |
291 | fprintf(fv, "$enddefinitions $end\n"); | |
292 | fprintf(fv, "$dumpvars\n"); | |
289 | 293 | |
290 | 294 | vcd_prevtime = lxt2_rd_get_start_time(lt)-1; |
291 | 295 | |
293 | 297 | |
294 | 298 | if(vcd_prevtime!=lxt2_rd_get_end_time(lt)) |
295 | 299 | { |
296 | printf("#"LXT2_RD_LLD"\n", lxt2_rd_get_end_time(lt)); | |
300 | fprintf(fv, "#"LXT2_RD_LLD"\n", lxt2_rd_get_end_time(lt)); | |
297 | 301 | } |
298 | 302 | |
299 | 303 | lxt2_rd_close(lt); |
315 | 319 | printf( |
316 | 320 | "Usage: %s [OPTION]... [LXT2FILE]\n\n" |
317 | 321 | " -l, --lxtname=FILE specify LXT2 input filename\n" |
322 | " -o, --output=FILE specify output filename\n" | |
318 | 323 | " -f, --flatearth emit flattened hierarchies\n" |
319 | 324 | " -n, --notruncate do not shorten bitvectors\n" |
320 | 325 | " -h, --help display this help then exit\n\n" |
321 | "VCD is emitted to stdout.\n\n" | |
326 | "VCD is emitted to stdout if output filename is unspecified.\n\n" | |
322 | 327 | "Report bugs to <"PACKAGE_BUGREPORT">.\n",nam); |
323 | 328 | #else |
324 | 329 | printf( |
325 | 330 | "Usage: %s [OPTION]... [LXT2FILE]\n\n" |
326 | 331 | " -l specify LXT2 input filename\n" |
332 | " -o specify output filename\n" | |
327 | 333 | " -f emit flattened hierarchies\n" |
328 | 334 | " -n do not shorten bitvectors\n" |
329 | 335 | " -h display this help then exit\n\n" |
330 | ||
331 | "VCD is emitted to stdout.\n\n" | |
336 | "VCD is emitted to stdout if output filename is unspecified.\n\n" | |
332 | 337 | "Report bugs to <"PACKAGE_BUGREPORT">.\n",nam); |
333 | 338 | #endif |
334 | 339 | |
340 | 345 | { |
341 | 346 | char opt_errors_encountered=0; |
342 | 347 | char *lxname=NULL; |
348 | char *outname=NULL; | |
349 | char *fvbuf=NULL; | |
343 | 350 | int c; |
344 | 351 | int rc; |
345 | 352 | |
353 | 360 | static struct option long_options[] = |
354 | 361 | { |
355 | 362 | {"lxtname", 1, 0, 'l'}, |
363 | {"output", 1, 0, 'o'}, | |
356 | 364 | {"flatearth", 0, 0, 'f'}, |
357 | 365 | {"notruncate", 0, 0, 'n'}, |
358 | 366 | {"help", 0, 0, 'h'}, |
359 | 367 | {0, 0, 0, 0} |
360 | 368 | }; |
361 | 369 | |
362 | c = getopt_long (argc, argv, "l:fnh", long_options, &option_index); | |
370 | c = getopt_long (argc, argv, "l:o:fnh", long_options, &option_index); | |
363 | 371 | #else |
364 | c = getopt (argc, argv, "l:fnh"); | |
372 | c = getopt (argc, argv, "l:o:fnh"); | |
365 | 373 | #endif |
366 | 374 | |
367 | 375 | if (c == -1) break; /* no more args */ |
374 | 382 | strcpy(lxname, optarg); |
375 | 383 | break; |
376 | 384 | |
385 | case 'o': | |
386 | if(outname) free(outname); | |
387 | outname = malloc(strlen(optarg)+1); | |
388 | strcpy(outname, optarg); | |
389 | break; | |
390 | ||
377 | 391 | case 'f': flat_earth=1; |
378 | 392 | break; |
379 | 393 | |
416 | 430 | print_help(argv[0]); |
417 | 431 | } |
418 | 432 | |
433 | if(outname) | |
434 | { | |
435 | fv = fopen(outname, "wb"); | |
436 | if(!fv) | |
437 | { | |
438 | fprintf(stderr, "Could not open '%s', exiting.\n", outname); | |
439 | perror("Why"); | |
440 | exit(255); | |
441 | } | |
442 | fvbuf = malloc(LXT_VCD_WRITE_BUF_SIZ); | |
443 | setvbuf(fv, fvbuf, _IOFBF, LXT_VCD_WRITE_BUF_SIZ); | |
444 | } | |
445 | else | |
446 | { | |
447 | fv = stdout; | |
448 | } | |
449 | ||
419 | 450 | rc=process_lxt(lxname); |
451 | ||
452 | if(outname) | |
453 | { | |
454 | free(outname); | |
455 | fclose(fv); | |
456 | } | |
457 | ||
458 | free(fvbuf); | |
420 | 459 | free(lxname); |
421 | 460 | |
422 | 461 | return(rc); |
51 | 51 | * navigate up and down the scope hierarchy and |
52 | 52 | * emit the appropriate vcd scope primitives |
53 | 53 | */ |
54 | static void diff_hier(struct namehier *nh1, struct namehier *nh2) | |
54 | static void diff_hier(FILE *fv, struct namehier *nh1, struct namehier *nh2) | |
55 | 55 | { |
56 | 56 | if(!nh2) |
57 | 57 | { |
58 | 58 | while((nh1)&&(nh1->not_final)) |
59 | 59 | { |
60 | printf("$scope module %s $end\n", nh1->name); | |
60 | fprintf(fv, "$scope module %s $end\n", nh1->name); | |
61 | 61 | nh1=nh1->next; |
62 | 62 | } |
63 | 63 | return; |
74 | 74 | { |
75 | 75 | while((nh1)&&(nh1->not_final)) |
76 | 76 | { |
77 | printf("$scope module %s $end\n", nh1->name); | |
77 | fprintf(fv, "$scope module %s $end\n", nh1->name); | |
78 | 78 | nh1=nh1->next; |
79 | 79 | } |
80 | 80 | break; |
84 | 84 | { |
85 | 85 | while((nh2)&&(nh2->not_final)) |
86 | 86 | { |
87 | printf("$upscope $end\n"); | |
87 | fprintf(fv, "$upscope $end\n"); | |
88 | 88 | nh2=nh2->next; |
89 | 89 | } |
90 | 90 | break; |
95 | 95 | /* prune old hier */ |
96 | 96 | while((nh2)&&(nh2->not_final)) |
97 | 97 | { |
98 | printf("$upscope $end\n"); | |
98 | fprintf(fv, "$upscope $end\n"); | |
99 | 99 | nh2=nh2->next; |
100 | 100 | } |
101 | 101 | |
102 | 102 | /* add new hier */ |
103 | 103 | while((nh1)&&(nh1->not_final)) |
104 | 104 | { |
105 | printf("$scope module %s $end\n", nh1->name); | |
105 | fprintf(fv, "$scope module %s $end\n", nh1->name); | |
106 | 106 | nh1=nh1->next; |
107 | 107 | } |
108 | 108 | break; |
117 | 117 | /* |
118 | 118 | * output scopedata for a given name if needed, return pointer to name string |
119 | 119 | */ |
120 | char *output_hier(char *name) | |
120 | char *fv_output_hier(FILE *fv, char *name) | |
121 | 121 | { |
122 | 122 | char *pnt, *pnt2; |
123 | 123 | char *s; |
150 | 150 | pnt=(++pnt2); |
151 | 151 | } |
152 | 152 | |
153 | diff_hier(nh_head, nhold); | |
153 | diff_hier(fv, nh_head, nhold); | |
154 | 154 | free_hier(); |
155 | 155 | nhold=nh_head; |
156 | 156 |
30 | 30 | |
31 | 31 | #include "wave_locale.h" |
32 | 32 | |
33 | #define VZT_VCD_WRITE_BUF_SIZ (2 * 1024 * 1024) | |
34 | ||
33 | 35 | static int flat_earth = 0; |
34 | 36 | static int vectorize = 0; |
35 | 37 | static int notruncate = 0; |
38 | static FILE *fv = NULL; | |
36 | 39 | |
37 | 40 | extern void free_hier(void); |
38 | extern char *output_hier(char *name); | |
39 | ||
41 | extern char *fv_output_hier(FILE *fv, char *name); | |
40 | 42 | |
41 | 43 | /* |
42 | 44 | * generate a vcd identifier for a given facindx |
124 | 126 | if(vcd_prevtime != *pnt_time) |
125 | 127 | { |
126 | 128 | vcd_prevtime = *pnt_time; |
127 | printf("#"VZT_RD_LLD"\n", *pnt_time); | |
129 | fprintf(fv, "#"VZT_RD_LLD"\n", *pnt_time); | |
128 | 130 | } |
129 | 131 | |
130 | 132 | if(!(*pnt_value)[0]) |
132 | 134 | if(!vcd_blackout) |
133 | 135 | { |
134 | 136 | vcd_blackout = 1; |
135 | printf("$dumpoff\n"); | |
137 | fprintf(fv, "$dumpoff\n"); | |
136 | 138 | } |
137 | 139 | |
138 | 140 | return; |
142 | 144 | if(vcd_blackout) |
143 | 145 | { |
144 | 146 | vcd_blackout = 0; |
145 | printf("$dumpon\n"); | |
147 | fprintf(fv, "$dumpon\n"); | |
146 | 148 | } |
147 | 149 | } |
148 | 150 | |
149 | 151 | if(g->flags & VZT_RD_SYM_F_DOUBLE) |
150 | 152 | { |
151 | printf("r%s %s\n", *pnt_value, vcdid(*pnt_facidx)); | |
153 | fprintf(fv, "r%s %s\n", *pnt_value, vcdid(*pnt_facidx)); | |
152 | 154 | } |
153 | 155 | else |
154 | 156 | if(g->flags & VZT_RD_SYM_F_STRING) |
155 | 157 | { |
156 | printf("s%s %s\n", *pnt_value, vcdid(*pnt_facidx)); | |
158 | fprintf(fv, "s%s %s\n", *pnt_value, vcdid(*pnt_facidx)); | |
157 | 159 | } |
158 | 160 | else |
159 | 161 | { |
160 | 162 | if(g->len==1) |
161 | 163 | { |
162 | printf("%c%s\n", (*pnt_value)[0], vcdid(*pnt_facidx)); | |
164 | fprintf(fv, "%c%s\n", (*pnt_value)[0], vcdid(*pnt_facidx)); | |
163 | 165 | } |
164 | 166 | else |
165 | 167 | { |
166 | printf("b%s %s\n", vcd_truncate_bitvec(*pnt_value), vcdid(*pnt_facidx)); | |
168 | fprintf(fv, "b%s %s\n", vcd_truncate_bitvec(*pnt_value), vcdid(*pnt_facidx)); | |
167 | 169 | } |
168 | 170 | } |
169 | 171 | } |
219 | 221 | } |
220 | 222 | |
221 | 223 | time(&walltime); |
222 | printf("$date\n"); | |
223 | printf("\t%s",asctime(localtime(&walltime))); | |
224 | printf("$end\n"); | |
225 | printf("$version\n\tvzt2vcd\n$end\n"); | |
226 | printf("$timescale %d%c%c $end\n", time_scale, time_dimension, !scale ? ' ' : 's'); | |
224 | fprintf(fv, "$date\n"); | |
225 | fprintf(fv, "\t%s",asctime(localtime(&walltime))); | |
226 | fprintf(fv, "$end\n"); | |
227 | fprintf(fv, "$version\n\tvzt2vcd\n$end\n"); | |
228 | fprintf(fv, "$timescale %d%c%c $end\n", time_scale, time_dimension, !scale ? ' ' : 's'); | |
227 | 229 | |
228 | 230 | timezero = vzt_rd_get_timezero(lt); |
229 | 231 | if(timezero) |
230 | 232 | { |
231 | printf("$timezero "VZT_RD_LLD" $end\n", timezero); | |
233 | fprintf(fv, "$timezero "VZT_RD_LLD" $end\n", timezero); | |
232 | 234 | } |
233 | 235 | |
234 | 236 | for(i=0;i<numfacs;i++) |
243 | 245 | |
244 | 246 | if(!flat_earth) |
245 | 247 | { |
246 | netname = output_hier(vzt_rd_get_facname(lt, i)); | |
248 | netname = fv_output_hier(fv, vzt_rd_get_facname(lt, i)); | |
247 | 249 | } |
248 | 250 | else |
249 | 251 | { |
252 | 254 | |
253 | 255 | if(g->flags & VZT_RD_SYM_F_DOUBLE) |
254 | 256 | { |
255 | printf("$var real 1 %s %s $end\n", vcdid(newindx), netname); | |
257 | fprintf(fv, "$var real 1 %s %s $end\n", vcdid(newindx), netname); | |
256 | 258 | } |
257 | 259 | else |
258 | 260 | if(g->flags & VZT_RD_SYM_F_STRING) |
259 | 261 | { |
260 | printf("$var real 1 %s %s $end\n", vcdid(newindx), netname); | |
262 | fprintf(fv, "$var real 1 %s %s $end\n", vcdid(newindx), netname); | |
261 | 263 | } |
262 | 264 | else |
263 | 265 | |
266 | 268 | { |
267 | 269 | if(g->msb!=-1) |
268 | 270 | { |
269 | printf("$var wire 1 %s %s ["VZT_RD_LD"] $end\n", vcdid(newindx), netname, g->msb); | |
271 | fprintf(fv, "$var wire 1 %s %s ["VZT_RD_LD"] $end\n", vcdid(newindx), netname, g->msb); | |
270 | 272 | } |
271 | 273 | else |
272 | 274 | { |
273 | printf("$var wire 1 %s %s $end\n", vcdid(newindx), netname); | |
275 | fprintf(fv, "$var wire 1 %s %s $end\n", vcdid(newindx), netname); | |
274 | 276 | } |
275 | 277 | } |
276 | 278 | else |
277 | 279 | { |
278 | 280 | if(!(g->flags & VZT_RD_SYM_F_INTEGER)) |
279 | 281 | { |
280 | if(g->len) printf("$var wire "VZT_RD_LD" %s %s ["VZT_RD_LD":"VZT_RD_LD"] $end\n", g->len, vcdid(newindx), netname, g->msb, g->lsb); | |
282 | if(g->len) fprintf(fv, "$var wire "VZT_RD_LD" %s %s ["VZT_RD_LD":"VZT_RD_LD"] $end\n", g->len, vcdid(newindx), netname, g->msb, g->lsb); | |
281 | 283 | } |
282 | 284 | else |
283 | 285 | { |
284 | printf("$var integer "VZT_RD_LD" %s %s $end\n", g->len, vcdid(newindx), netname); | |
286 | fprintf(fv, "$var integer "VZT_RD_LD" %s %s $end\n", g->len, vcdid(newindx), netname); | |
285 | 287 | } |
286 | 288 | } |
287 | 289 | } |
289 | 291 | |
290 | 292 | if(!flat_earth) |
291 | 293 | { |
292 | output_hier(""); /* flush any remaining hierarchy if not back to toplevel */ | |
294 | fv_output_hier(fv, ""); /* flush any remaining hierarchy if not back to toplevel */ | |
293 | 295 | free_hier(); |
294 | 296 | } |
295 | 297 | |
296 | printf("$enddefinitions $end\n"); | |
297 | printf("$dumpvars\n"); | |
298 | fprintf(fv, "$enddefinitions $end\n"); | |
299 | fprintf(fv, "$dumpvars\n"); | |
298 | 300 | |
299 | 301 | vcd_prevtime = vzt_rd_get_start_time(lt)-1; |
300 | 302 | |
302 | 304 | |
303 | 305 | if(vcd_prevtime!=vzt_rd_get_end_time(lt)) |
304 | 306 | { |
305 | printf("#"VZT_RD_LLD"\n", vzt_rd_get_end_time(lt)); | |
307 | fprintf(fv, "#"VZT_RD_LLD"\n", vzt_rd_get_end_time(lt)); | |
306 | 308 | } |
307 | 309 | |
308 | 310 | vzt_rd_close(lt); |
324 | 326 | printf( |
325 | 327 | "Usage: %s [OPTION]... [VZTFILE]\n\n" |
326 | 328 | " -v, --vztname=FILE specify VZT input filename\n" |
329 | " -o, --output=FILE specify output filename\n" | |
327 | 330 | " -f, --flatearth emit flattened hierarchies\n" |
328 | 331 | " -c, --coalesce coalesce bitblasted vectors\n" |
329 | 332 | " -n, --notruncate do not shorten bitvectors\n" |
330 | 333 | " -h, --help display this help then exit\n\n" |
331 | "VCD is emitted to stdout.\n\n" | |
334 | "VCD is emitted to stdout if output filename is unspecified.\n\n" | |
332 | 335 | "Report bugs to <"PACKAGE_BUGREPORT">.\n",nam); |
333 | 336 | #else |
334 | 337 | printf( |
335 | 338 | "Usage: %s [OPTION]... [VZTFILE]\n\n" |
336 | 339 | " -v specify VZT input filename\n" |
340 | " -o specify output filename\n" | |
337 | 341 | " -f emit flattened hierarchies\n" |
338 | 342 | " -c coalesce bitblasted vectors\n" |
339 | 343 | " -n do not shorten bitvectors\n" |
340 | 344 | " -h display this help then exit\n\n" |
341 | ||
342 | "VCD is emitted to stdout.\n\n" | |
345 | "VCD is emitted to stdout if output filename is unspecified.\n\n" | |
343 | 346 | "Report bugs to <"PACKAGE_BUGREPORT">.\n",nam); |
344 | 347 | #endif |
345 | 348 | |
351 | 354 | { |
352 | 355 | char opt_errors_encountered=0; |
353 | 356 | char *lxname=NULL; |
357 | char *outname=NULL; | |
358 | char *fvbuf=NULL; | |
354 | 359 | int c; |
355 | 360 | int rc; |
356 | 361 | |
364 | 369 | static struct option long_options[] = |
365 | 370 | { |
366 | 371 | {"vztname", 1, 0, 'v'}, |
372 | {"output", 1, 0, 'o'}, | |
367 | 373 | {"coalesce", 0, 0, 'c'}, |
368 | 374 | {"flatearth", 0, 0, 'f'}, |
369 | 375 | {"notruncate", 0, 0, 'n'}, |
371 | 377 | {0, 0, 0, 0} |
372 | 378 | }; |
373 | 379 | |
374 | c = getopt_long (argc, argv, "v:cfnh", long_options, &option_index); | |
380 | c = getopt_long (argc, argv, "v:o:cfnh", long_options, &option_index); | |
375 | 381 | #else |
376 | c = getopt (argc, argv, "v:cfnh"); | |
382 | c = getopt (argc, argv, "v:o:cfnh"); | |
377 | 383 | #endif |
378 | 384 | |
379 | 385 | if (c == -1) break; /* no more args */ |
386 | 392 | strcpy(lxname, optarg); |
387 | 393 | break; |
388 | 394 | |
395 | case 'o': | |
396 | if(outname) free(outname); | |
397 | outname = malloc(strlen(optarg)+1); | |
398 | strcpy(outname, optarg); | |
399 | break; | |
400 | ||
389 | 401 | case 'c': vectorize=1; |
390 | 402 | break; |
391 | 403 | |
431 | 443 | print_help(argv[0]); |
432 | 444 | } |
433 | 445 | |
446 | if(outname) | |
447 | { | |
448 | fv = fopen(outname, "wb"); | |
449 | if(!fv) | |
450 | { | |
451 | fprintf(stderr, "Could not open '%s', exiting.\n", outname); | |
452 | perror("Why"); | |
453 | exit(255); | |
454 | } | |
455 | fvbuf = malloc(VZT_VCD_WRITE_BUF_SIZ); | |
456 | setvbuf(fv, fvbuf, _IOFBF, VZT_VCD_WRITE_BUF_SIZ); | |
457 | } | |
458 | else | |
459 | { | |
460 | fv = stdout; | |
461 | } | |
462 | ||
434 | 463 | rc=process_vzt(lxname); |
464 | ||
465 | if(outname) | |
466 | { | |
467 | free(outname); | |
468 | fclose(fv); | |
469 | } | |
470 | ||
471 | free(fvbuf); | |
435 | 472 | free(lxname); |
436 | 473 | |
437 | 474 | return(rc); |
34 | 34 | static int names_only = 0; |
35 | 35 | static char *killed_list = NULL; |
36 | 36 | char killed_value = 1; |
37 | ||
38 | extern void free_hier(void); | |
39 | extern char *output_hier(char *name); | |
40 | 37 | |
41 | 38 | char vcd_blackout; |
42 | 39 |
1719 | 1719 | |
1720 | 1720 | #ifdef MAC_INTEGRATION |
1721 | 1721 | { |
1722 | GtkOSXApplication *theApp = theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL); | |
1722 | GtkOSXApplication *theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL); | |
1723 | 1723 | gtk_widget_hide(menubar); |
1724 | 1724 | gtk_osxapplication_set_menu_bar(theApp, GTK_MENU_SHELL(menubar)); |
1725 | 1725 | gtk_osxapplication_set_use_quartz_accelerators(theApp, TRUE); |
1964 | 1964 | |
1965 | 1965 | #ifdef MAC_INTEGRATION |
1966 | 1966 | { |
1967 | GtkOSXApplication *theApp = theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL); | |
1967 | GtkOSXApplication *theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL); | |
1968 | 1968 | gtk_widget_hide(menubar); |
1969 | 1969 | gtk_osxapplication_set_menu_bar(theApp, GTK_MENU_SHELL(menubar)); |
1970 | 1970 | gtk_osxapplication_set_use_quartz_accelerators(theApp, TRUE); |
1893 | 1893 | update_maxmarker_labels(); |
1894 | 1894 | } |
1895 | 1895 | } |
1896 | /**/ | |
1897 | #ifdef MAC_INTEGRATION | |
1898 | void menu_help_manual(gpointer null_data, guint callback_action, GtkWidget *widget) | |
1899 | { | |
1900 | if(GLOBALS->helpbox_is_active) | |
1901 | { | |
1902 | help_text_bold("\n\nWave User's Guide"); | |
1903 | help_text( | |
1904 | " opens the PDF file of the GTKWave User's Guide for viewing." | |
1905 | ); | |
1906 | return; | |
1907 | } | |
1908 | else | |
1909 | { | |
1910 | const gchar *bundle_id = quartz_application_get_bundle_id(); | |
1911 | if(bundle_id) | |
1912 | { | |
1913 | const gchar *rpath = quartz_application_get_resource_path(); | |
1914 | const char *suf = "/doc/gtkwave.pdf"; | |
1915 | char *pdfpath = NULL; | |
1916 | FILE *handle; | |
1917 | ||
1918 | if(rpath) | |
1919 | { | |
1920 | pdfpath = (char *)alloca(strlen(rpath) + strlen(suf) + 1); | |
1921 | strcpy(pdfpath, rpath); | |
1922 | strcat(pdfpath, suf); | |
1923 | } | |
1924 | ||
1925 | if(!pdfpath || !(handle=fopen(pdfpath,"rb"))) | |
1926 | { | |
1927 | } | |
1928 | else | |
1929 | { | |
1930 | fclose(handle); | |
1931 | gtk_open_external_file(pdfpath); | |
1932 | return; | |
1933 | } | |
1934 | } | |
1935 | ||
1936 | simplereqbox("Wave User's Guide",400,"Could not open PDF!","OK", NULL, NULL, 1); | |
1937 | } | |
1938 | } | |
1939 | #endif | |
1896 | 1940 | /**/ |
1897 | 1941 | void menu_help(gpointer null_data, guint callback_action, GtkWidget *widget) |
1898 | 1942 | { |
6108 | 6152 | |
6109 | 6153 | /* 130 */ |
6110 | 6154 | WAVE_GTKIFE("/Help/WAVE Help", "<Control>H", menu_help, WV_MENU_HWH, "<Item>"), |
6155 | #ifdef MAC_INTEGRATION | |
6156 | WAVE_GTKIFE("/Help/WAVE User Manual", NULL, menu_help_manual, WV_MENU_HWM, "<Item>"), | |
6157 | #endif | |
6111 | 6158 | WAVE_GTKIFE("/Help/Wave Version", NULL, menu_version, WV_MENU_HWV, "<Item>"), |
6112 | 6159 | }; |
6113 | 6160 | |
6294 | 6341 | #endif |
6295 | 6342 | case WV_MENU_FQY: |
6296 | 6343 | case WV_MENU_HWH: |
6344 | #ifdef MAC_INTEGRATION | |
6345 | case WV_MENU_HWM: | |
6346 | #endif | |
6297 | 6347 | case WV_MENU_HWV: |
6298 | 6348 | break; |
6299 | 6349 | |
6354 | 6404 | int nmenu_items = sizeof(menu_items) / sizeof(menu_items[0]); |
6355 | 6405 | int i; |
6356 | 6406 | GtkWidget *mw; |
6357 | ||
6358 | 6407 | #ifdef WAVE_USE_MENU_BLACKOUTS |
6359 | 6408 | for(i=0;i<(sizeof(menu_blackouts)/sizeof(char *));i++) |
6360 | 6409 | { |
6374 | 6423 | #endif |
6375 | 6424 | case WV_MENU_FQY: |
6376 | 6425 | case WV_MENU_HWH: |
6426 | #ifdef MAC_INTEGRATION | |
6427 | case WV_MENU_HWM: | |
6428 | #endif | |
6377 | 6429 | case WV_MENU_HWV: |
6378 | 6430 | break; |
6379 | 6431 | |
6383 | 6435 | #else |
6384 | 6436 | mw = gtk_item_factory_get_widget(GLOBALS->item_factory_menu_c_1, menu_items[i].path); |
6385 | 6437 | #endif |
6386 | if(mw) gtk_widget_set_sensitive(mw, TRUE); | |
6438 | if(mw) | |
6439 | { | |
6440 | #ifdef MAC_INTEGRATION | |
6441 | if(menu_items[i].callback) | |
6442 | #endif | |
6443 | { | |
6444 | gtk_widget_set_sensitive(mw, TRUE); | |
6445 | } | |
6446 | } | |
6387 | 6447 | break; |
6388 | 6448 | } |
6389 | 6449 | } |
6967 | 7027 | #endif |
6968 | 7028 | case WV_MENU_FQY: |
6969 | 7029 | case WV_MENU_HWH: |
7030 | #ifdef MAC_INTEGRATION | |
7031 | case WV_MENU_HWM: | |
7032 | #endif | |
6970 | 7033 | case WV_MENU_HWV: |
6971 | 7034 | break; |
6972 | 7035 | |
6973 | 7036 | default: |
6974 | 7037 | mw = menu_wlist[i]; |
6975 | if(mw) gtk_widget_set_sensitive(mw, FALSE); | |
7038 | if(mw) | |
7039 | { | |
7040 | #ifdef MAC_INTEGRATION | |
7041 | if(menu_items[i].callback) | |
7042 | #endif | |
7043 | { | |
7044 | gtk_widget_set_sensitive(mw, FALSE); | |
7045 | } | |
7046 | } | |
6976 | 7047 | break; |
6977 | 7048 | } |
6978 | 7049 | } |
6981 | 7052 | for(i=0;i<(sizeof(menu_blackouts)/sizeof(char *));i++) |
6982 | 7053 | { |
6983 | 7054 | mw = menu_wlist[i]; |
6984 | if(mw) gtk_widget_set_sensitive(mw, FALSE); | |
7055 | if(mw) | |
7056 | { | |
7057 | gtk_widget_set_sensitive(mw, FALSE); | |
7058 | } | |
6985 | 7059 | } |
6986 | 7060 | #endif |
6987 | 7061 | } |
7032 | 7106 | for(i=0;i<nmenu_items;i++) |
7033 | 7107 | { |
7034 | 7108 | mw = menu_wlist[i]; |
7035 | if(mw) gtk_widget_set_sensitive(mw, tr); | |
7109 | if(mw) | |
7110 | { | |
7111 | if(menu_items[i].callback) | |
7112 | { | |
7113 | gtk_widget_set_sensitive(mw, tr); | |
7114 | } | |
7115 | } | |
7036 | 7116 | } |
7037 | 7117 | } |
7038 | 7118 | #endif |
7075 | 7155 | #endif |
7076 | 7156 | case WV_MENU_FQY: |
7077 | 7157 | case WV_MENU_HWH: |
7158 | #ifdef MAC_INTEGRATION | |
7159 | case WV_MENU_HWM: | |
7160 | #endif | |
7078 | 7161 | case WV_MENU_HWV: |
7079 | 7162 | mw = menu_wlist[i]; |
7080 | if(mw) gtk_widget_set_sensitive(mw, TRUE); | |
7163 | if(mw) | |
7164 | { | |
7165 | #ifdef MAC_INTEGRATION | |
7166 | if(menu_items[i].callback) | |
7167 | #endif | |
7168 | { | |
7169 | gtk_widget_set_sensitive(mw, TRUE); | |
7170 | } | |
7171 | } | |
7081 | 7172 | break; |
7082 | 7173 | |
7083 | 7174 | default: |
280 | 280 | WV_MENU_TDSCALEP, |
281 | 281 | WV_MENU_TDSCALEF, |
282 | 282 | WV_MENU_HWH, |
283 | #ifdef MAC_INTEGRATION | |
284 | WV_MENU_HWM, | |
285 | #endif | |
283 | 286 | WV_MENU_HWV, |
284 | 287 | WV_MENU_NUMITEMS |
285 | 288 | }; |
0 | 0 | /* |
1 | * Copyright (c) Tony Bybell 1999-2010. | |
1 | * Copyright (c) Tony Bybell 1999-2012. | |
2 | 2 | * |
3 | 3 | * This program is free software; you can redistribute it and/or |
4 | 4 | * modify it under the terms of the GNU General Public License |
34 | 34 | #include "color.h" |
35 | 35 | #include "vlist.h" |
36 | 36 | #include "rc.h" |
37 | ||
38 | #ifdef MAC_INTEGRATION | |
39 | #include <gtkosxapplication.h> | |
40 | #endif | |
37 | 41 | |
38 | 42 | #ifndef _MSC_VER |
39 | 43 | #ifndef __MINGW32__ |
952 | 956 | |
953 | 957 | if(!(handle=fopen(rcpath,"rb"))) |
954 | 958 | { |
955 | wave_gconf_client_set_string("/current/rcfile", ""); | |
956 | errno=0; | |
957 | return; /* no .rc file */ | |
959 | #ifdef MAC_INTEGRATION | |
960 | const gchar *bundle_id = quartz_application_get_bundle_id(); | |
961 | if(bundle_id) | |
962 | { | |
963 | const gchar *rpath = quartz_application_get_resource_path(); | |
964 | const char *suf = "/examples/gtkwaverc"; | |
965 | ||
966 | rcpath = NULL; | |
967 | if(rpath) | |
968 | { | |
969 | rcpath = (char *)alloca(strlen(rpath) + strlen(suf) + 1); | |
970 | strcpy(rcpath, rpath); | |
971 | strcat(rcpath, suf); | |
972 | } | |
973 | ||
974 | if(!rcpath || !(handle=fopen(rcpath,"rb"))) | |
975 | { | |
976 | wave_gconf_client_set_string("/current/rcfile", ""); | |
977 | errno=0; | |
978 | return; /* no .rc file */ | |
979 | } | |
980 | else | |
981 | { | |
982 | wave_gconf_client_set_string("/current/rcfile", rcpath); | |
983 | } | |
984 | } | |
985 | else | |
986 | #endif | |
987 | { | |
988 | wave_gconf_client_set_string("/current/rcfile", ""); | |
989 | errno=0; | |
990 | return; /* no .rc file */ | |
991 | } | |
958 | 992 | } |
959 | 993 | else |
960 | 994 | { |
2325 | 2325 | } |
2326 | 2326 | } |
2327 | 2327 | } |
2328 | #else | |
2329 | static void find_dumpfile_scrub_slashes(char *s) | |
2330 | { | |
2331 | if(s) | |
2332 | { | |
2333 | if(s[0] && s[1] && s[2] && (s[1] == ':') && (s[2] == '\\')) | |
2334 | { | |
2335 | while(*s) | |
2336 | { | |
2337 | if(*s == '\\') *s = '/'; | |
2338 | s++; | |
2339 | } | |
2340 | } | |
2341 | } | |
2342 | } | |
2328 | 2343 | #endif |
2329 | 2344 | |
2330 | 2345 | |
2339 | 2354 | char *grf = NULL; |
2340 | 2355 | int dotdot_levels = 0; |
2341 | 2356 | |
2342 | #ifdef __MINGW32__ | |
2343 | 2357 | find_dumpfile_scrub_slashes(orig_save); |
2344 | 2358 | find_dumpfile_scrub_slashes(orig_dump); |
2345 | 2359 | find_dumpfile_scrub_slashes(this_save); |
2346 | #endif | |
2347 | 2360 | |
2348 | 2361 | dup_orig_save = strdup_2(orig_save); |
2349 | 2362 | rhs_orig_save_slash = strrchr(dup_orig_save, SLASH); |
37 | 37 | hadj=GTK_ADJUSTMENT(GLOBALS->signal_hslider); |
38 | 38 | xsrc=(gint)hadj->value; |
39 | 39 | DEBUG(printf("Signal HSlider Moved to %d\n",xsrc)); |
40 | GLOBALS->right_align_active = 0; | |
40 | 41 | |
41 | 42 | gdk_draw_rectangle(GLOBALS->signalpixmap, GLOBALS->gc.gc_mdgray, TRUE, |
42 | 43 | 0, -1, GLOBALS->signal_fill_width, GLOBALS->fontheight); |
1233 | 1234 | GLOBALS->signal_fill_width, widget->allocation.height, -1); |
1234 | 1235 | } |
1235 | 1236 | |
1237 | if (!GLOBALS->left_justify_sigs && !GLOBALS->do_resize_signals) | |
1238 | if (width < GLOBALS->max_signal_name_pixel_width+15) | |
1239 | { | |
1240 | int delta = GLOBALS->max_signal_name_pixel_width+15 - width; | |
1241 | ||
1242 | GtkAdjustment *hadj; | |
1243 | ||
1244 | if(GLOBALS->signalpixmap) | |
1245 | { | |
1246 | ||
1247 | hadj=GTK_ADJUSTMENT(GLOBALS->signal_hslider); | |
1248 | ||
1249 | /* int pos = GLOBALS->max_signal_name_pixel_width+15 - (gint)hadj->value; */ | |
1250 | ||
1251 | if ((gint) hadj->value > delta) | |
1252 | { | |
1253 | GLOBALS->right_align_active = 1; | |
1254 | delta = (gint)hadj->value; | |
1255 | } | |
1256 | if (GLOBALS->right_align_active) | |
1257 | hadj->value = (gint)delta; | |
1258 | } | |
1259 | } else { | |
1260 | GLOBALS->right_align_active = 1; | |
1261 | } | |
1262 | ||
1236 | 1263 | GLOBALS->old_signal_fill_height= widget->allocation.height; |
1237 | 1264 | gdk_draw_rectangle(GLOBALS->signalpixmap, widget->style->bg_gc[GTK_STATE_PRELIGHT], TRUE, 0, 0, |
1238 | 1265 | GLOBALS->signal_fill_width, widget->allocation.height); |
21 | 21 | #include <unistd.h> |
22 | 22 | |
23 | 23 | #include "debug.h" |
24 | ||
25 | static int use_embedded = 1; | |
24 | 26 | |
25 | 27 | #if !defined _MSC_VER && defined WAVE_USE_GTK2 |
26 | 28 | |
84 | 86 | split_point = i; |
85 | 87 | break; |
86 | 88 | } |
89 | ||
90 | if(!strcmp(argv[i], "++")) | |
91 | { | |
92 | split_point = i; | |
93 | use_embedded = 0; | |
94 | break; | |
95 | } | |
87 | 96 | } |
88 | 97 | |
89 | 98 | if(split_point < 0) |
90 | 99 | { |
91 | printf("Usage:\n------\n%s arglist1 + arglist2\n\n" | |
92 | "The '+' between argument lists splits what goes to each viewer.\n\n", argv[0]); | |
100 | printf("Usage:\n------\n%s arglist1 separator arglist2\n\n" | |
101 | "The '+' between argument lists splits and creates one window.\n" | |
102 | "The '++' between argument lists splits and creates two windows.\n" | |
103 | "\n", argv[0]); | |
93 | 104 | exit(255); |
94 | 105 | } |
95 | 106 | |
364 | 375 | sleep(2); |
365 | 376 | shmctl(shmid, IPC_RMID, &ds); /* mark for destroy */ |
366 | 377 | #endif |
367 | gtk_main(); | |
378 | if(use_embedded) | |
379 | { | |
380 | gtk_main(); | |
381 | } | |
368 | 382 | } |
369 | 383 | else |
370 | 384 | { |
372 | 386 | char **arglist = calloc(n_items, sizeof(char *)); |
373 | 387 | |
374 | 388 | sprintf(buf, "0+%08X", shmid); |
375 | sprintf(buf2, "%x", gtk_socket_get_id (GTK_SOCKET(xsocket[0]))); | |
389 | if(use_embedded) | |
390 | { | |
391 | sprintf(buf2, "%x", gtk_socket_get_id (GTK_SOCKET(xsocket[0]))); | |
392 | } | |
393 | else | |
394 | { | |
395 | sprintf(buf2, "%x", 0); | |
396 | } | |
376 | 397 | |
377 | 398 | arglist[0] = "gtkwave"; |
378 | 399 | arglist[1] = "-D"; |
399 | 420 | char **arglist = calloc(n_items, sizeof(char *)); |
400 | 421 | |
401 | 422 | sprintf(buf, "1+%08X", shmid); |
402 | sprintf(buf2, "%x", gtk_socket_get_id (GTK_SOCKET(xsocket[1]))); | |
423 | if(use_embedded) | |
424 | { | |
425 | sprintf(buf2, "%x", gtk_socket_get_id (GTK_SOCKET(xsocket[1]))); | |
426 | } | |
427 | else | |
428 | { | |
429 | sprintf(buf2, "%x", 0); | |
430 | } | |
403 | 431 | |
404 | 432 | arglist[0] = "gtkwave"; |
405 | 433 | arglist[1] = "-D"; |
444 | 472 | } |
445 | 473 | |
446 | 474 | #endif |
447 |
2422 | 2422 | |
2423 | 2423 | if(GLOBALS->signalwindow) |
2424 | 2424 | { |
2425 | gtk_widget_set_usize(GTK_WIDGET(GLOBALS->signalwindow), os+30, -1); | |
2425 | /* printf("VALUES: %d %d %d\n", GLOBALS->initial_signal_window_width, GLOBALS->signalwindow->allocation.width, GLOBALS->max_signal_name_pixel_width); */ | |
2426 | if (GLOBALS->first_unsized_signals && GLOBALS->max_signal_name_pixel_width !=0) | |
2427 | { | |
2428 | GLOBALS->first_unsized_signals = 0; | |
2429 | gtk_paned_set_position(GTK_PANED(GLOBALS->panedwindow), GLOBALS->max_signal_name_pixel_width+30); | |
2430 | } else { | |
2431 | gtk_widget_set_usize(GTK_WIDGET(GLOBALS->signalwindow), os+30, -1); | |
2432 | } | |
2426 | 2433 | } |
2427 | 2434 | } |
2428 | 2435 | else |