From 931ec257f0e1e56451de8446d67fa3190dcb78ba Mon Sep 17 00:00:00 2001 From: steve Date: Mon, 31 Jul 2000 03:34:31 +0000 Subject: [PATCH] Report error when dumpfile is missing. --- vpi/sys_vcd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/vpi/sys_vcd.c b/vpi/sys_vcd.c index 75bdfba76..47766b820 100644 --- a/vpi/sys_vcd.c +++ b/vpi/sys_vcd.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: sys_vcd.c,v 1.11 2000/07/26 04:07:59 steve Exp $" +#ident "$Id: sys_vcd.c,v 1.12 2000/07/31 03:34:31 steve Exp $" #endif /* @@ -204,6 +204,10 @@ static int variable_cb(p_cb_data cause) static int sys_dumpall_calltf(char*name) { s_vpi_time now; + + if (dump_file == 0) + return 0; + vpi_get_time(0, &now); fprintf(dump_file, "#%u\n", now.low); vcd_cur_time = now.low; @@ -358,6 +362,11 @@ static int sys_dumpvars_calltf(char*name) return 0; } + if (dump_file == 0) { + vpi_printf("ERROR: %s called but no dumpfile is opened.\n", name); + return 0; + } + item = vpi_scan(argv); switch (vpi_get(vpiType, item)) { case vpiConstant: @@ -419,6 +428,9 @@ void sys_vcd_register() /* * $Log: sys_vcd.c,v $ + * Revision 1.12 2000/07/31 03:34:31 steve + * Report error when dumpfile is missing. + * * Revision 1.11 2000/07/26 04:07:59 steve * Get VCD timescale from design precision. *