2 * Copyright (c) 1999 Stephen Williams (steve@icarus.com)
4 * This source code is free software; you can redistribute it
5 * and/or modify it in source code form under the terms of the GNU
6 * General Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 #ident "$Id: sys_table.c,v 1.26 2006/08/03 05:06:04 steve Exp $"
23 # include "vpi_config.h"
24 # include "vpi_user.h"
29 extern void sys_convert_register();
30 extern void sys_fileio_register();
31 extern void sys_finish_register();
32 extern void sys_deposit_register();
33 extern void sys_display_register();
34 extern void sys_plusargs_register();
35 extern void sys_random_register();
36 extern void sys_random_mti_register();
37 extern void sys_readmem_register();
38 extern void sys_scanf_register();
39 extern void sys_time_register();
40 extern void sys_vcd_register();
41 extern void sys_vcdoff_register();
44 extern void sys_lxt_register();
45 extern void sys_lxt2_register();
47 static void sys_lxt_register() { fputs("LXT support disabled since zlib not available\n",stderr
); exit(1); }
48 static void sys_lxt2_register() { fputs("LXT2 support disabled since zlib not available\n",stderr
); exit(1); }
51 static void sys_lxt_or_vcd_register()
54 struct t_vpi_vlog_info vlog_info
;
58 /* Get the dumper of choice from the IVERILOG_DUMPER
59 environment variable. */
60 dumper
= getenv("IVERILOG_DUMPER");
62 char*cp
= strchr(dumper
,'=');
70 /* Scan the extended arguments, looking for flags that select
71 major features. This can override the environment variable
73 vpi_get_vlog_info(&vlog_info
);
75 for (idx
= 0 ; idx
< vlog_info
.argc
; idx
+= 1) {
77 if (strcmp(vlog_info
.argv
[idx
],"-lxt") == 0) {
80 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt-space") == 0) {
83 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt-speed") == 0) {
86 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt-none") == 0) {
89 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt2") == 0) {
92 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt2-space") == 0) {
95 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt2-speed") == 0) {
98 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt2-none") == 0) {
101 } else if (strcmp(vlog_info
.argv
[idx
],"-vcd") == 0) {
104 } else if (strcmp(vlog_info
.argv
[idx
],"-vcd-off") == 0) {
107 } else if (strcmp(vlog_info
.argv
[idx
],"-vcd-none") == 0) {
113 if (strcmp(dumper
, "vcd") == 0)
116 else if (strcmp(dumper
, "VCD") == 0)
119 else if (strcmp(dumper
, "lxt") == 0)
122 else if (strcmp(dumper
, "LXT") == 0)
125 else if (strcmp(dumper
, "lxt2") == 0)
128 else if (strcmp(dumper
, "LXT2") == 0)
131 else if (strcmp(dumper
, "none") == 0)
132 sys_vcdoff_register();
134 else if (strcmp(dumper
, "NONE") == 0)
135 sys_vcdoff_register();
138 fprintf(stderr
, "system.vpi: Unknown dumper format: %s\n",
144 void (*vlog_startup_routines
[])() = {
145 sys_convert_register
,
148 sys_deposit_register
,
149 sys_display_register
,
150 sys_plusargs_register
,
152 sys_random_mti_register
,
153 sys_readmem_register
,
156 sys_lxt_or_vcd_register
,
162 * $Log: sys_table.c,v $
163 * Revision 1.26 2006/08/03 05:06:04 steve
164 * Add the scanf functions.
166 * Revision 1.25 2004/06/09 22:14:10 steve
167 * Move Mersenne Twister to $mti_random, and make
168 * the standard $random standard. Also, add $dist_poisson.
170 * Revision 1.24 2004/01/21 01:22:53 steve
171 * Give the vip directory its own configure and vpi_config.h
173 * Revision 1.23 2003/10/30 04:52:54 steve
174 * Call register for fileio functions.
176 * Revision 1.22 2003/09/13 01:28:47 steve
177 * Disable lxt when zlib is missing.
179 * Revision 1.21 2003/09/01 04:04:03 steve
182 * Revision 1.20 2003/03/07 02:44:34 steve
183 * Implement $realtobits.
185 * Revision 1.19 2003/03/06 20:04:42 steve
186 * Add means to suppress wveform output
188 * Revision 1.18 2003/02/20 00:50:06 steve
189 * Update lxt_write implementation, and add compression control flags.
191 * Revision 1.17 2002/08/12 01:35:05 steve
192 * conditional ident string using autoconfig.
194 * Revision 1.16 2002/04/07 04:37:53 steve
195 * Add $plusargs system functions.
197 * Revision 1.15 2002/04/06 21:33:29 steve
198 * allow runtime selection of VCD vs LXT.
200 * Revision 1.14 2002/03/09 21:54:49 steve
201 * Add LXT dumper support. (Anthony Bybell)
203 * Revision 1.13 2001/09/30 16:45:10 steve
204 * Fix some Cygwin DLL handling. (Venkat Iyer)
206 * Revision 1.12 2001/07/25 03:10:50 steve
207 * Create a config.h.in file to hold all the config
208 * junk, and support gcc 3.0. (Stephan Boettcher)