Portably handle time format of VCD prints.
This commit is contained in:
parent
89fca07dc8
commit
4236b8a95e
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: _pli_types.h.in,v 1.3 2003/10/02 21:30:06 steve Exp $"
|
||||
#ident "$Id: _pli_types.h.in,v 1.4 2003/10/29 03:23:12 steve Exp $"
|
||||
#endif
|
||||
|
||||
# undef HAVE_INTTYPES_H
|
||||
|
|
@ -45,6 +45,8 @@ typedef unsigned short PLI_UINT16;
|
|||
typedef signed char PLI_BYTE8;
|
||||
typedef unsigned char PLI_UBYTE8;
|
||||
|
||||
# define TIME_FMT PRIu64
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
|
|
@ -88,6 +90,9 @@ typedef unsigned char PLI_UBYTE8;
|
|||
|
||||
/*
|
||||
* $Log: _pli_types.h.in,v $
|
||||
* Revision 1.4 2003/10/29 03:23:12 steve
|
||||
* Portably handle time format of VCD prints.
|
||||
*
|
||||
* Revision 1.3 2003/10/02 21:30:06 steve
|
||||
* Use configured TIME_FMT in vcd dump printf.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: sys_vcd.c,v 1.49 2003/10/08 23:14:29 steve Exp $"
|
||||
#ident "$Id: sys_vcd.c,v 1.50 2003/10/29 03:23:12 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -39,10 +39,6 @@
|
|||
#endif
|
||||
# include "vcd_priv.h"
|
||||
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# define TIME_FMT PRIu64
|
||||
#endif
|
||||
|
||||
static FILE*dump_file = 0;
|
||||
|
||||
static const char*units_names[] = {
|
||||
|
|
@ -184,7 +180,7 @@ static int variable_cb_2(p_cb_data cause)
|
|||
PLI_UINT64 now = timerec_to_time64(cause->time);
|
||||
|
||||
if (now != vcd_cur_time) {
|
||||
fprintf(dump_file, "#%lu\n", now);
|
||||
fprintf(dump_file, "#%" TIME_FMT "\n", now);
|
||||
vcd_cur_time = now;
|
||||
}
|
||||
|
||||
|
|
@ -234,7 +230,7 @@ static int dumpvars_cb(p_cb_data cause)
|
|||
fprintf(dump_file, "$enddefinitions $end\n");
|
||||
|
||||
if (!dump_is_off) {
|
||||
fprintf(dump_file, "#%lu\n", dumpvars_time);
|
||||
fprintf(dump_file, "#%" TIME_FMT "\n", dumpvars_time);
|
||||
fprintf(dump_file, "$dumpvars\n");
|
||||
vcd_checkpoint();
|
||||
fprintf(dump_file, "$end\n");
|
||||
|
|
@ -254,7 +250,7 @@ inline static int install_dumpvars_callback(void)
|
|||
if (dumpvars_status == 2) {
|
||||
vpi_mcd_printf(1, "VCD Error:"
|
||||
" $dumpvars ignored,"
|
||||
" previously called at simtime %lu\n",
|
||||
" previously called at simtime %" TIME_FMT "\n",
|
||||
dumpvars_time);
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -324,7 +320,7 @@ static int sys_dumpon_calltf(char*name)
|
|||
now64 = timerec_to_time64(&now);
|
||||
|
||||
if (now64 > vcd_cur_time)
|
||||
fprintf(dump_file, "#" TIME_FMT "\n", now64);
|
||||
fprintf(dump_file, "#%" TIME_FMT "\n", now64);
|
||||
vcd_cur_time = now64;
|
||||
|
||||
fprintf(dump_file, "$dumpon\n");
|
||||
|
|
@ -350,7 +346,7 @@ static int sys_dumpall_calltf(char*name)
|
|||
now64 = timerec_to_time64(&now);
|
||||
|
||||
if (now64 > vcd_cur_time)
|
||||
fprintf(dump_file, "#" TIME_FMT "\n", now64);
|
||||
fprintf(dump_file, "#%" TIME_FMT "\n", now64);
|
||||
vcd_cur_time = now.low;
|
||||
|
||||
fprintf(dump_file, "$dumpall\n");
|
||||
|
|
@ -815,6 +811,9 @@ void sys_vcd_register()
|
|||
|
||||
/*
|
||||
* $Log: sys_vcd.c,v $
|
||||
* Revision 1.50 2003/10/29 03:23:12 steve
|
||||
* Portably handle time format of VCD prints.
|
||||
*
|
||||
* Revision 1.49 2003/10/08 23:14:29 steve
|
||||
* TIME_FMT does not include the % character.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue