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();
45 extern void sys_lxt_register();
47 static void sys_lxt_register() { fputs("LXT support disabled since libbzip2 not available\n",stderr
); exit(1); }
49 extern void sys_lxt2_register();
51 static void sys_lxt_register() { fputs("LXT support disabled since zlib not available\n",stderr
); exit(1); }
52 static void sys_lxt2_register() { fputs("LXT2 support disabled since zlib not available\n",stderr
); exit(1); }
55 static void sys_lxt_or_vcd_register()
58 struct t_vpi_vlog_info vlog_info
;
62 /* Get the dumper of choice from the IVERILOG_DUMPER
63 environment variable. */
64 dumper
= getenv("IVERILOG_DUMPER");
66 char*cp
= strchr(dumper
,'=');
74 /* Scan the extended arguments, looking for flags that select
75 major features. This can override the environment variable
77 vpi_get_vlog_info(&vlog_info
);
79 for (idx
= 0 ; idx
< vlog_info
.argc
; idx
+= 1) {
81 if (strcmp(vlog_info
.argv
[idx
],"-lxt") == 0) {
84 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt-space") == 0) {
87 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt-speed") == 0) {
90 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt-none") == 0) {
93 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt2") == 0) {
96 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt2-space") == 0) {
99 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt2-speed") == 0) {
102 } else if (strcmp(vlog_info
.argv
[idx
],"-lxt2-none") == 0) {
105 } else if (strcmp(vlog_info
.argv
[idx
],"-lx2") == 0) {
108 } else if (strcmp(vlog_info
.argv
[idx
],"-lx2-space") == 0) {
111 } else if (strcmp(vlog_info
.argv
[idx
],"-lx2-speed") == 0) {
114 } else if (strcmp(vlog_info
.argv
[idx
],"-lx2-none") == 0) {
117 } else if (strcmp(vlog_info
.argv
[idx
],"-vcd") == 0) {
120 } else if (strcmp(vlog_info
.argv
[idx
],"-vcd-off") == 0) {
123 } else if (strcmp(vlog_info
.argv
[idx
],"-vcd-none") == 0) {
129 if (strcmp(dumper
, "vcd") == 0)
132 else if (strcmp(dumper
, "VCD") == 0)
135 else if (strcmp(dumper
, "lxt") == 0)
138 else if (strcmp(dumper
, "LXT") == 0)
141 else if (strcmp(dumper
, "lxt2") == 0)
144 else if (strcmp(dumper
, "LXT2") == 0)
147 else if (strcmp(dumper
, "lx2") == 0)
150 else if (strcmp(dumper
, "LX2") == 0)
153 else if (strcmp(dumper
, "none") == 0)
154 sys_vcdoff_register();
156 else if (strcmp(dumper
, "NONE") == 0)
157 sys_vcdoff_register();
160 fprintf(stderr
, "system.vpi: Unknown dumper format: %s\n",
166 void (*vlog_startup_routines
[])() = {
167 sys_convert_register
,
170 sys_deposit_register
,
171 sys_display_register
,
172 sys_plusargs_register
,
174 sys_random_mti_register
,
175 sys_readmem_register
,
178 sys_lxt_or_vcd_register
,