On Wed, Nov 30, 2005 at 06:50:31PM -0800, Stephen Williams wrote: > I think changing 10 to 10.0 in that case would do the trick. I was > going to say that everything is integer there, but when dealing with > pico-'s and femto-'s, the range may be such that you really do want > a real value instead of an integer, for its range.
I didn't try going back and changing to a 10.0, however my thought about using 10.0 is that it might cause the compiler to choose the pow(float, int) function, which would reduce the precision over a double. Is float precision enough? If not, I think switching to a 10.0l would cause it to see the constant as a double, if I'm reading the C guide pulled up by Google correctly. > Well it is good that it works that far. I'm doing an FPGA design with > the CVS version, so it should be working pretty well. Solaris shouldn't > be a problem (even though it sometimes seems to be). > > These all sound reasonable to me, so by all means send patches and I'll > merge them in. And by all means file bug reports for things that do not > work but you think should. I've attached the patch below. There was a header inclusion that I commented out in one file. I wasn't sure if that header would be needed on other platforms, but it at least doesn't seem to be needed for OS X, which uses GCC (I tested my patched version of the source code on OS X to make sure I wasn't breaking GCC compilation of the code). Further more, including stdint.h is a probablem when compiling on Solaris with GCC anyway. -- Joshua D. Boyd [EMAIL PROTECTED] http://www.jdboyd.net/ http://www.joshuaboyd.org/ ===File ~/icarus.jdb.patch================================== Index: Statement.h =================================================================== RCS file: /home/demon/anoncvs/verilog/Statement.h,v retrieving revision 1.41 diff -u -r1.41 Statement.h --- Statement.h 11 Dec 2004 02:31:25 -0000 1.41 +++ Statement.h 5 Dec 2005 18:22:20 -0000 @@ -394,6 +394,7 @@ public: PNoop() { } + ~PNoop() { } }; class PRepeat : public Statement { Index: parse.y =================================================================== RCS file: /home/demon/anoncvs/verilog/parse.y,v retrieving revision 1.207 diff -u -r1.207 parse.y --- parse.y 10 Nov 2005 13:28:12 -0000 1.207 +++ parse.y 5 Dec 2005 18:22:22 -0000 @@ -27,6 +27,7 @@ # include "parse_misc.h" # include "compiler.h" # include "pform.h" +# include "Statement.h" # include <sstream> extern void lex_start_table(); Index: pform.h =================================================================== RCS file: /home/demon/anoncvs/verilog/pform.h,v retrieving revision 1.83 diff -u -r1.83 pform.h --- pform.h 7 Jul 2005 16:22:49 -0000 1.83 +++ pform.h 5 Dec 2005 18:22:23 -0000 @@ -77,7 +77,8 @@ /* This is information about port name information for named port connections. */ -typedef struct named<PExpr*> named_pexpr_t; +//typedef struct named<PExpr*> named_pexpr_t; +typedef named<PExpr*> named_pexpr_t; struct parmvalue_t { svector<PExpr*>*by_order; Index: tgt-vvp/eval_bool.c =================================================================== RCS file: /home/demon/anoncvs/verilog/tgt-vvp/eval_bool.c,v retrieving revision 1.2 diff -u -r1.2 eval_bool.c --- tgt-vvp/eval_bool.c 19 Sep 2005 20:17:59 -0000 1.2 +++ tgt-vvp/eval_bool.c 5 Dec 2005 18:22:23 -0000 @@ -28,7 +28,7 @@ # include <malloc.h> #endif # include <stdlib.h> -# include <stdint.h> +//# include <stdint.h> # include <math.h> # include <assert.h> Index: vvp/vpi_callback.cc =================================================================== RCS file: /home/demon/anoncvs/verilog/vvp/vpi_callback.cc,v retrieving revision 1.40 diff -u -r1.40 vpi_callback.cc --- vvp/vpi_callback.cc 25 Nov 2005 17:55:26 -0000 1.40 +++ vvp/vpi_callback.cc 5 Dec 2005 18:22:24 -0000 @@ -82,6 +82,8 @@ struct __vpiCallback*handle; bool sync_flag; + ~sync_cb () { } + virtual void run_run(); }; Index: vvp/vpi_priv.cc =================================================================== RCS file: /home/demon/anoncvs/verilog/vvp/vpi_priv.cc,v retrieving revision 1.48 diff -u -r1.48 vpi_priv.cc --- vvp/vpi_priv.cc 9 Jun 2005 05:04:45 -0000 1.48 +++ vvp/vpi_priv.cc 5 Dec 2005 18:22:24 -0000 @@ -309,7 +309,7 @@ case vpiScaledRealTime: units = vpip_time_units_from_handle(obj); - vp->real = pow(10, vpip_get_time_precision() - units); + vp->real = pow((double)10, vpip_get_time_precision() - units); vp->real *= time; break; @@ -395,6 +395,7 @@ vpiHandle handle; s_vpi_value value; virtual void run_run(); + ~vpip_put_value_event() { } }; void vpip_put_value_event::run_run() @@ -416,7 +417,7 @@ switch (when->type) { case vpiScaledRealTime: dly = (vvp_time64_t)(when->real * - (pow(10, + (pow((double)10, vpip_time_units_from_handle(obj) - vpip_get_time_precision()))); break; Index: vvp/vpi_time.cc =================================================================== RCS file: /home/demon/anoncvs/verilog/vvp/vpi_time.cc,v retrieving revision 1.16 diff -u -r1.16 vpi_time.cc --- vvp/vpi_time.cc 4 Oct 2004 01:11:00 -0000 1.16 +++ vvp/vpi_time.cc 5 Dec 2005 18:22:24 -0000 @@ -178,7 +178,7 @@ the scaling, instead of the integer scaling done everywhere else. */ units = rfp->scope? rfp->scope->time_units : vpi_time_precision; - vp->value.real = pow(10, vpi_time_precision - units); + vp->value.real = pow((double)10, vpi_time_precision - units); vp->value.real *= schedule_simtime(); break; ============================================================
