diff --git a/vpi/Makefile.in b/vpi/Makefile.in index 0771587b3..d74bd1a93 100644 --- a/vpi/Makefile.in +++ b/vpi/Makefile.in @@ -18,7 +18,7 @@ # 59 Temple Place - Suite 330 # Boston, MA 02111-1307, USA # -#ident "$Id: Makefile.in,v 1.43 2003/09/13 01:28:47 steve Exp $" +#ident "$Id: Makefile.in,v 1.44 2003/09/30 01:33:39 steve Exp $" # # SHELL = /bin/sh @@ -59,7 +59,7 @@ dep: O = sys_table.o sys_convert.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_vcdoff.o vcd_priv.o mt19937int.o stringheap.o +sys_vcd.o sys_vcdoff.o vcd_priv.o mt19937int.o priv.o stringheap.o ifeq (@HAVE_LIBZ@,yes) O += sys_lxt.o lxt_write.o sys_lxt2.o lxt2_write.o diff --git a/vpi/sys_lxt.c b/vpi/sys_lxt.c index 0fd03d58c..baad17f17 100644 --- a/vpi/sys_lxt.c +++ b/vpi/sys_lxt.c @@ -17,13 +17,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_lxt.c,v 1.22 2003/08/22 23:14:27 steve Exp $" +#ident "$Id: sys_lxt.c,v 1.23 2003/09/30 01:33:39 steve Exp $" #endif # include "config.h" # include "sys_priv.h" # include "lxt_write.h" # include "vcd_priv.h" +# include "sys_priv.h" /* * This file contains the implementations of the VCD related @@ -153,7 +154,7 @@ struct vcd_info { static struct vcd_info*vcd_list = 0; static struct vcd_info*vcd_dmp_list = 0; -static unsigned long vcd_cur_time = 0; +static PLI_UINT64 vcd_cur_time = 0; static int dump_is_off = 0; @@ -194,7 +195,7 @@ struct vcd_names_list_s lxt_tab; static int dumpvars_status = 0; /* 0:fresh 1:cb installed, 2:callback done */ -static unsigned long dumpvars_time; +static PLI_UINT64 dumpvars_time; inline static int dump_header_pending(void) { return dumpvars_status != 2; @@ -223,10 +224,10 @@ static void vcd_checkpoint_x() static int variable_cb_2(p_cb_data cause) { struct vcd_info* info = vcd_dmp_list; - unsigned long now = cause->time->low; + PLI_UINT64 now = timerec_to_time64(cause->time); if (now != vcd_cur_time) { - lt_set_time(dump_file, now); + lt_set_time64(dump_file, now); vcd_cur_time = now; } @@ -270,11 +271,11 @@ static int dumpvars_cb(p_cb_data cause) dumpvars_status = 2; - dumpvars_time = cause->time->low; + dumpvars_time = timerec_to_time64(cause->time); vcd_cur_time = dumpvars_time; if (!dump_is_off) { - lt_set_time(dump_file, dumpvars_time); + lt_set_time64(dump_file, dumpvars_time); vcd_checkpoint(); } @@ -313,6 +314,7 @@ inline static int install_dumpvars_callback(void) static int sys_dumpoff_calltf(char*name) { s_vpi_time now; + PLI_UINT64 now64; if (dump_is_off) return 0; @@ -327,9 +329,11 @@ static int sys_dumpoff_calltf(char*name) now.type = vpiSimTime; vpi_get_time(0, &now); - if (now.low > vcd_cur_time) - lt_set_time(dump_file, now.low); - vcd_cur_time = now.low; + now64 = timerec_to_time64(&now); + + if (now64 > vcd_cur_time) + lt_set_time64(dump_file, now64); + vcd_cur_time = now64; lt_set_dumpoff(dump_file); vcd_checkpoint_x(); @@ -340,6 +344,7 @@ static int sys_dumpoff_calltf(char*name) static int sys_dumpon_calltf(char*name) { s_vpi_time now; + PLI_UINT64 now64; if (!dump_is_off) return 0; @@ -354,9 +359,11 @@ static int sys_dumpon_calltf(char*name) now.type = vpiSimTime; vpi_get_time(0, &now); - if (now.low > vcd_cur_time) - lt_set_time(dump_file, now.low); - vcd_cur_time = now.low; + now64 = timerec_to_time64(&now); + + if (now64 > vcd_cur_time) + lt_set_time64(dump_file, now64); + vcd_cur_time = now64; lt_set_dumpon(dump_file); vcd_checkpoint(); @@ -367,6 +374,7 @@ static int sys_dumpon_calltf(char*name) static int sys_dumpall_calltf(char*name) { s_vpi_time now; + PLI_UINT64 now64; if (dump_file == 0) return 0; @@ -376,9 +384,11 @@ static int sys_dumpall_calltf(char*name) now.type = vpiSimTime; vpi_get_time(0, &now); - if (now.low > vcd_cur_time) - lt_set_time(dump_file, now.low); - vcd_cur_time = now.low; + now64 = timerec_to_time64(&now); + + if (now64> vcd_cur_time) + lt_set_time64(dump_file, now64); + vcd_cur_time = now64; vcd_checkpoint(); @@ -794,6 +804,9 @@ void sys_lxt_register() /* * $Log: sys_lxt.c,v $ + * Revision 1.23 2003/09/30 01:33:39 steve + * dumpers must be aware of 64bit time. + * * Revision 1.22 2003/08/22 23:14:27 steve * Preserve variable ranges all the way to the vpi. * diff --git a/vpi/sys_lxt2.c b/vpi/sys_lxt2.c index d1c66d228..68d2dc1b2 100644 --- a/vpi/sys_lxt2.c +++ b/vpi/sys_lxt2.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 20023Stephen Williams (steve@icarus.com) + * 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 @@ -17,13 +17,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_lxt2.c,v 1.3 2003/09/26 21:23:08 steve Exp $" +#ident "$Id: sys_lxt2.c,v 1.4 2003/09/30 01:33:39 steve Exp $" #endif # include "config.h" # include "sys_priv.h" # include "lxt2_write.h" # include "vcd_priv.h" +# include "sys_priv.h" /* * This file contains the implementations of the VCD related @@ -153,7 +154,7 @@ struct vcd_info { static struct vcd_info*vcd_list = 0; static struct vcd_info*vcd_dmp_list = 0; -static unsigned long vcd_cur_time = 0; +static PLI_UINT64 vcd_cur_time = 0; static int dump_is_off = 0; @@ -195,7 +196,7 @@ struct vcd_names_list_s lxt_tab; static int dumpvars_status = 0; /* 0:fresh 1:cb installed, 2:callback done */ -static unsigned long dumpvars_time; +static PLI_UINT64 dumpvars_time; inline static int dump_header_pending(void) { return dumpvars_status != 2; @@ -224,10 +225,10 @@ static void vcd_checkpoint_x() static int variable_cb_2(p_cb_data cause) { struct vcd_info* info = vcd_dmp_list; - unsigned long now = cause->time->low; + PLI_UINT64 now = timerec_to_time64(cause->time); if (now != vcd_cur_time) { - lxt2_wr_set_time(dump_file, now); + lxt2_wr_set_time64(dump_file, now); vcd_cur_time = now; } @@ -271,11 +272,11 @@ static int dumpvars_cb(p_cb_data cause) dumpvars_status = 2; - dumpvars_time = cause->time->low; + dumpvars_time = timerec_to_time64(cause->time); vcd_cur_time = dumpvars_time; if (!dump_is_off) { - lxt2_wr_set_time(dump_file, dumpvars_time); + lxt2_wr_set_time64(dump_file, dumpvars_time); vcd_checkpoint(); } @@ -314,6 +315,7 @@ inline static int install_dumpvars_callback(void) static int sys_dumpoff_calltf(char*name) { s_vpi_time now; + PLI_UINT64 now64; if (dump_is_off) return 0; @@ -328,8 +330,9 @@ static int sys_dumpoff_calltf(char*name) now.type = vpiSimTime; vpi_get_time(0, &now); - if (now.low > vcd_cur_time) - lxt2_wr_set_time(dump_file, now.low); + now64 = timerec_to_time64(&now); + if (now64 > vcd_cur_time) + lxt2_wr_set_time(dump_file, now64); vcd_cur_time = now.low; lxt2_wr_set_dumpoff(dump_file); @@ -341,6 +344,7 @@ static int sys_dumpoff_calltf(char*name) static int sys_dumpon_calltf(char*name) { s_vpi_time now; + PLI_UINT64 now64; if (!dump_is_off) return 0; @@ -355,9 +359,11 @@ static int sys_dumpon_calltf(char*name) now.type = vpiSimTime; vpi_get_time(0, &now); - if (now.low > vcd_cur_time) - lxt2_wr_set_time(dump_file, now.low); - vcd_cur_time = now.low; + now64 = timerec_to_time64(&now); + + if (now64 > vcd_cur_time) + lxt2_wr_set_time64(dump_file, now64); + vcd_cur_time = now64; lxt2_wr_set_dumpon(dump_file); vcd_checkpoint(); @@ -368,6 +374,7 @@ static int sys_dumpon_calltf(char*name) static int sys_dumpall_calltf(char*name) { s_vpi_time now; + PLI_UINT64 now64; if (dump_file == 0) return 0; @@ -377,9 +384,12 @@ static int sys_dumpall_calltf(char*name) now.type = vpiSimTime; vpi_get_time(0, &now); - if (now.low > vcd_cur_time) - lxt2_wr_set_time(dump_file, now.low); - vcd_cur_time = now.low; + + now64 = timerec_to_time64(&now); + + if (now64 > vcd_cur_time) + lxt2_wr_set_time64(dump_file, now64); + vcd_cur_time = now64; vcd_checkpoint(); @@ -806,6 +816,9 @@ void sys_lxt2_register() /* * $Log: sys_lxt2.c,v $ + * Revision 1.4 2003/09/30 01:33:39 steve + * dumpers must be aware of 64bit time. + * * Revision 1.3 2003/09/26 21:23:08 steve * turn partial off when maximally compressing. * diff --git a/vpi/sys_priv.h b/vpi/sys_priv.h index ad3980755..4e5ac6125 100644 --- a/vpi/sys_priv.h +++ b/vpi/sys_priv.h @@ -19,9 +19,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_priv.h,v 1.2 2003/05/14 04:18:16 steve Exp $" +#ident "$Id: sys_priv.h,v 1.3 2003/09/30 01:33:39 steve Exp $" #endif +# include "vpi_user.h" + /* * This function is used by sys_vcd and sys_lxt as the dumpvars * compiletf function. @@ -39,8 +41,14 @@ struct context_s { extern void sgenrand(struct context_s *context, unsigned long seed); extern unsigned long genrand(struct context_s *context); + +extern PLI_UINT64 timerec_to_time64(const struct t_vpi_time*time); + /* * $Log: sys_priv.h,v $ + * Revision 1.3 2003/09/30 01:33:39 steve + * dumpers must be aware of 64bit time. + * * Revision 1.2 2003/05/14 04:18:16 steve * Use seed to store random number context. * diff --git a/vpi/sys_vcd.c b/vpi/sys_vcd.c index 722f91f01..2eac8aefe 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 */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_vcd.c,v 1.46 2003/08/22 23:14:27 steve Exp $" +#ident "$Id: sys_vcd.c,v 1.47 2003/09/30 01:33:39 steve Exp $" #endif # include "config.h" @@ -81,7 +81,7 @@ static void gen_new_vcd_id(void) static struct vcd_info *vcd_list = 0; static struct vcd_info *vcd_dmp_list = 0; -unsigned long vcd_cur_time = 0; +PLI_UINT64 vcd_cur_time = 0; static int dump_is_off = 0; static char *truncate_bitvec(char *s) @@ -148,7 +148,7 @@ struct vcd_names_list_s vcd_tab = { 0 }; static int dumpvars_status = 0; /* 0:fresh 1:cb installed, 2:callback done */ -static unsigned long dumpvars_time; +static PLI_UINT64 dumpvars_time; inline static int dump_header_pending(void) { return dumpvars_status != 2; @@ -177,7 +177,7 @@ static void vcd_checkpoint_x() static int variable_cb_2(p_cb_data cause) { struct vcd_info* info = vcd_dmp_list; - unsigned long now = cause->time->low; + PLI_UINT64 now = timerec_to_time64(cause->time); if (now != vcd_cur_time) { fprintf(dump_file, "#%lu\n", now); @@ -224,7 +224,7 @@ static int dumpvars_cb(p_cb_data cause) dumpvars_status = 2; - dumpvars_time = cause->time->low; + dumpvars_time = timerec_to_time64(cause->time); vcd_cur_time = dumpvars_time; fprintf(dump_file, "$enddefinitions $end\n"); @@ -271,6 +271,7 @@ inline static int install_dumpvars_callback(void) static int sys_dumpoff_calltf(char*name) { s_vpi_time now; + PLI_UINT64 now64; if (dump_is_off) return 0; @@ -285,9 +286,11 @@ static int sys_dumpoff_calltf(char*name) now.type = vpiSimTime; vpi_get_time(0, &now); - if (now.low > vcd_cur_time) - fprintf(dump_file, "#%u\n", now.low); - vcd_cur_time = now.low; + now64 = timerec_to_time64(&now); + + if (now64 > vcd_cur_time) + fprintf(dump_file, "#%" TIME_FMT "u\n", now64); + vcd_cur_time = now64; fprintf(dump_file, "$dumpoff\n"); vcd_checkpoint_x(); @@ -299,6 +302,7 @@ static int sys_dumpoff_calltf(char*name) static int sys_dumpon_calltf(char*name) { s_vpi_time now; + PLI_UINT64 now64; if (!dump_is_off) return 0; @@ -313,9 +317,11 @@ static int sys_dumpon_calltf(char*name) now.type = vpiSimTime; vpi_get_time(0, &now); - if (now.low > vcd_cur_time) - fprintf(dump_file, "#%u\n", now.low); - vcd_cur_time = now.low; + now64 = timerec_to_time64(&now); + + if (now64 > vcd_cur_time) + fprintf(dump_file, "#%" TIME_FMT "u\n", now64); + vcd_cur_time = now64; fprintf(dump_file, "$dumpon\n"); vcd_checkpoint(); @@ -327,6 +333,7 @@ static int sys_dumpon_calltf(char*name) static int sys_dumpall_calltf(char*name) { s_vpi_time now; + PLI_UINT64 now64; if (dump_file == 0) return 0; @@ -336,8 +343,10 @@ static int sys_dumpall_calltf(char*name) now.type = vpiSimTime; vpi_get_time(0, &now); - if (now.low > vcd_cur_time) - fprintf(dump_file, "#%u\n", now.low); + now64 = timerec_to_time64(&now); + + if (now64 > vcd_cur_time) + fprintf(dump_file, "#%" TIME_FMT "u\n", now64); vcd_cur_time = now.low; fprintf(dump_file, "$dumpall\n"); @@ -802,6 +811,9 @@ void sys_vcd_register() /* * $Log: sys_vcd.c,v $ + * Revision 1.47 2003/09/30 01:33:39 steve + * dumpers must be aware of 64bit time. + * * Revision 1.46 2003/08/22 23:14:27 steve * Preserve variable ranges all the way to the vpi. *