From 21b0f4955e47046ceffe757fcb41883b231fd643 Mon Sep 17 00:00:00 2001 From: steve Date: Fri, 28 Feb 2003 21:20:34 +0000 Subject: [PATCH] Allow read of realvar as int. --- vvp/vpi_real.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vvp/vpi_real.cc b/vvp/vpi_real.cc index 22d6467bb..7fe4f1737 100644 --- a/vvp/vpi_real.cc +++ b/vvp/vpi_real.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: vpi_real.cc,v 1.5 2003/02/10 05:20:10 steve Exp $" +#ident "$Id: vpi_real.cc,v 1.6 2003/02/28 21:20:34 steve Exp $" #endif # include "vpi_priv.h" @@ -66,10 +66,15 @@ static void real_var_get_value(vpiHandle ref, s_vpi_value*vp) switch (vp->format) { case vpiObjTypeVal: vp->format = vpiRealVal; + case vpiRealVal: vp->value.real = rfp->value; break; + case vpiIntVal: + vp->value.integer = (int)(rfp->value + 0.5); + break; + case vpiDecStrVal: sprintf(buf, "%0.0f", rfp->value); vp->value.str = buf; @@ -173,6 +178,9 @@ vpiHandle vpip_make_real_var(const char*name) /* * $Log: vpi_real.cc,v $ + * Revision 1.6 2003/02/28 21:20:34 steve + * Allow read of realvar as int. + * * Revision 1.5 2003/02/10 05:20:10 steve * Add value change callbacks to real variables. *