Add means to suppress wveform output

This commit is contained in:
steve 2003-03-06 20:04:42 +00:00
parent 658706ad8b
commit cc1e952d0b
4 changed files with 219 additions and 14 deletions

View File

@ -18,7 +18,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.37 2003/03/04 03:13:07 steve Exp $"
#ident "$Id: Makefile.in,v 1.38 2003/03/06 20:04:42 steve Exp $"
#
#
SHELL = /bin/sh
@ -59,7 +59,7 @@ dep:
O = sys_table.o sys_deposit.o sys_display.o sys_finish.o sys_plusargs.o \
sys_random.o sys_readmem.o sys_readmem_lex.o sys_time.o sys_vcd.o \
sys_lxt.o lxt_write.o vcd_priv.o \
sys_vcdoff.o sys_lxt.o lxt_write.o vcd_priv.o \
mt19937int.o stringheap.o
LIBS = @LIBS@

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: sys_table.c,v 1.18 2003/02/20 00:50:06 steve Exp $"
#ident "$Id: sys_table.c,v 1.19 2003/03/06 20:04:42 steve Exp $"
#endif
# include "config.h"
@ -35,6 +35,7 @@ extern void sys_readmem_register();
extern void sys_time_register();
extern void sys_vcd_register();
extern void sys_lxt_register();
extern void sys_vcdoff_register();
static void sys_lxt_or_vcd_register()
{
@ -71,9 +72,18 @@ static void sys_lxt_or_vcd_register()
} else if (strcmp(vlog_info.argv[idx],"-lxt-speed") == 0) {
dumper = "lxt";
} else if (strcmp(vlog_info.argv[idx],"-lxt-none") == 0) {
dumper = "none";
} else if (strcmp(vlog_info.argv[idx],"-vcd") == 0) {
dumper = "vcd";
} else if (strcmp(vlog_info.argv[idx],"-vcd-off") == 0) {
dumper = "none";
} else if (strcmp(vlog_info.argv[idx],"-vcd-none") == 0) {
dumper = "none";
}
}
@ -89,6 +99,12 @@ static void sys_lxt_or_vcd_register()
else if (strcmp(dumper, "LXT") == 0)
sys_lxt_register();
else if (strcmp(dumper, "none") == 0)
sys_vcdoff_register();
else if (strcmp(dumper, "NONE") == 0)
sys_vcdoff_register();
else {
fprintf(stderr, "system.vpi: Unknown dumper format: %s\n",
dumper);
@ -111,6 +127,9 @@ void (*vlog_startup_routines[])() = {
/*
* $Log: sys_table.c,v $
* Revision 1.19 2003/03/06 20:04:42 steve
* Add means to suppress wveform output
*
* Revision 1.18 2003/02/20 00:50:06 steve
* Update lxt_write implementation, and add compression control flags.
*

179
vpi/sys_vcdoff.c Normal file
View File

@ -0,0 +1,179 @@
/*
* Copyright (c) 2003 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: sys_vcdoff.c,v 1.1 2003/03/06 20:04:42 steve Exp $"
#endif
# include "config.h"
# include "sys_priv.h"
/*
* This file contains the implementations of the VCD related
* functions. These are stub versions
*/
# include "vpi_user.h"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <assert.h>
# include <time.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
# include "vcd_priv.h"
static FILE*dump_file = 0;
static int sys_dumpoff_calltf(char*name)
{
return 0;
}
static int sys_dumpon_calltf(char*name)
{
return 0;
}
static int sys_dumpall_calltf(char*name)
{
return 0;
}
static void open_dumpfile(const char*path)
{
dump_file = fopen(path, "w");
if (dump_file == 0) {
vpi_mcd_printf(6,
"VCD Error: Unable to open %s for output.\n",
path);
return;
} else {
fprintf(dump_file, "VCD Dump suppressed.\n");
}
}
static int sys_dumpfile_calltf(char*name)
{
char*path;
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle item;
if (argv && (item = vpi_scan(argv))) {
s_vpi_value value;
if (vpi_get(vpiType, item) != vpiConstant
|| vpi_get(vpiConstType, item) != vpiStringConst) {
vpi_mcd_printf(6,
"VCD Error:"
" %s parameter must be a string constant\n",
name);
return 0;
}
value.format = vpiStringVal;
vpi_get_value(item, &value);
path = strdup(value.value.str);
vpi_free_object(argv);
} else {
path = strdup("dumpfile.vcd");
}
if (dump_file) {
fclose(dump_file);
dump_file = 0;
}
assert(dump_file == 0);
open_dumpfile(path);
free(path);
return 0;
}
static int sys_dumpvars_calltf(char*name)
{
if (dump_file == 0) {
open_dumpfile("dumpfile.vcd");
if (dump_file == 0)
return 0;
}
return 0;
}
void sys_vcdoff_register()
{
s_vpi_systf_data tf_data;
tf_data.type = vpiSysTask;
tf_data.tfname = "$dumpall";
tf_data.calltf = sys_dumpall_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = 0;
tf_data.user_data = "$dumpall";
vpi_register_systf(&tf_data);
tf_data.type = vpiSysTask;
tf_data.tfname = "$dumpoff";
tf_data.calltf = sys_dumpoff_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = 0;
tf_data.user_data = "$dumpoff";
vpi_register_systf(&tf_data);
tf_data.type = vpiSysTask;
tf_data.tfname = "$dumpon";
tf_data.calltf = sys_dumpon_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = 0;
tf_data.user_data = "$dumpon";
vpi_register_systf(&tf_data);
tf_data.type = vpiSysTask;
tf_data.tfname = "$dumpfile";
tf_data.calltf = sys_dumpfile_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = 0;
tf_data.user_data = "$dumpfile";
vpi_register_systf(&tf_data);
tf_data.type = vpiSysTask;
tf_data.tfname = "$dumpvars";
tf_data.calltf = sys_dumpvars_calltf;
tf_data.compiletf = sys_vcd_dumpvars_compiletf;
tf_data.sizetf = 0;
tf_data.user_data = "$dumpvars";
vpi_register_systf(&tf_data);
}
/*
* $Log: sys_vcdoff.c,v $
* Revision 1.1 2003/03/06 20:04:42 steve
* Add means to suppress wveform output
*
*/

View File

@ -1,4 +1,4 @@
.TH vvp 1 "$Date: 2003/02/21 03:40:35 $" Version "$Date: 2003/02/21 03:40:35 $"
.TH vvp 1 "$Date: 2003/03/06 20:04:42 $" Version "$Date: 2003/03/06 20:04:42 $"
.SH NAME
vvp - Icarus Verilog vvp runtime engine
@ -54,29 +54,35 @@ are instead passed on to the executed design, and are available via
the \fI$test$plusargs\fP and \fI$value$plusargs\fP system functions.
.PP
Arguments that do not start with the plus(+) character are not
available to the standard system tasks, but can still be accessed via
PLI code via the \fIvpi_get_vlog_info\fP function. This means that
vpi modules may use arguments that do not start with + and be assured
that they do not interfere with user defined plus-args.
available to the \fI$plusargs\fP system tasks, but can still be
accessed via PLI code via the \fIvpi_get_vlog_info\fP function. This
means that vpi modules may use arguments that do not start with + and
be assured that they do not interfere with user defined plus-args.
.PP
There are a few extended arguments that are interpreted by the
standard system module, which implements the standard system tasks and
so is always included. These flags arguments are described here.
standard system.vpi module, which implements the standard system tasks
and so is always included. These arguments are described here.
.TP 8
.B -vcd
.B -vcd\fR|\fP-vcd-none
This extended argument sets the wave dump format to VCD. This is the
default in the absence of any \fBIVERILOG_DUMPER\fP environment
variable. The VCD dump files are large and ponderous, but are also
maximally compatible with third party tools that read waveform dumps.
.PP
The \fB-vcd-none\fP variant actually suppresses all waveform
output. This can make long simulations run faster.
.TP 8
.B -lxt\fR|\fP-lxt-speed\fR|\fP-lxt-space
.B -lxt\fR|\fP-lxt-speed\fR|\fP-lxt-space\fR|\fP-lxt-none
These extended arguments set the wave dump format to lxt, possibly with
format optimizations. The \fB-lxt-space\fP flag sets the output
format to lxt with full compression enabled. The resulting files are
quite small. The \fB-lxt-speed\fP chooses the lxt compression mode
that leads to the best execution time and the fastest read time, at
the expense of some file size.
.PP
The \fB-lxt-none\fP variant actually suppresses all waveform
output. This can make long simulations run faster.
.SH ENVIRONMENT
.PP
@ -84,11 +90,12 @@ The vvp command also accepts some environment variables that control
its behavior. These can be used to make semi-permanent changes.
.TP 8
.B IVERILOG_DUMPER=\fIlxt|vcd\fP
.B IVERILOG_DUMPER=\fIlxt|vcd|none\fP
This selects the output format for the waveform output. Normally,
waveforms are dumped in vcd format, but this variable can be used to
select lxt format, which is far more compact, though limited to
gtkwave or compatible viewers.
gtkwave or compatible viewers. It can also be used to suppress VCD
output, a time-saver for regression tests.
.SH INTERACTIVE MODE
.PP