From 47db309d30f9bb76fa17ba3eb10faed6f6b27cde Mon Sep 17 00:00:00 2001 From: steve Date: Sun, 26 Jan 2003 18:18:36 +0000 Subject: [PATCH] Support display of real values and constants. --- vpi/sys_display.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/vpi/sys_display.c b/vpi/sys_display.c index 7f65092f3..c7229e7b0 100644 --- a/vpi/sys_display.c +++ b/vpi/sys_display.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_display.c,v 1.48 2003/01/09 04:10:58 steve Exp $" +#ident "$Id: sys_display.c,v 1.49 2003/01/26 18:18:36 steve Exp $" #endif # include "config.h" @@ -425,6 +425,14 @@ static int format_str(vpiHandle scope, unsigned int mcd, cp += 1; break; + case 'f': + case 'F': + format_char = 'f'; + do_arg = 1; + value.format = vpiRealVal; + cp += 1; + break; + case 'h': case 'H': case 'x': @@ -522,7 +530,6 @@ static int format_str(vpiHandle scope, unsigned int mcd, break; case 'e': - case 'f': case 'g': // new Verilog 2001 format specifiers... case 'l': @@ -559,8 +566,13 @@ static int format_str(vpiHandle scope, unsigned int mcd, switch(format_char){ case 'c': - vpi_mcd_printf(mcd, "%c", value.value.str[strlen(value.value.str)-1]); - break; + vpi_mcd_printf(mcd, "%c", value.value.str[strlen(value.value.str)-1]); + break; + + case 'f': + vpi_mcd_printf(mcd, "%f", + value.value.real); + break; case 't': format_time(mcd, fsize, @@ -762,6 +774,12 @@ static void do_display(unsigned int mcd, struct strobe_cb_info*info) vpi_mcd_printf(mcd, "%20u", value.value.time->low); break; + case vpiRealVar: + value.format = vpiRealVal; + vpi_get_value(item, &value); + vpi_mcd_printf(mcd, "%f", value.value.real); + break; + default: vpi_mcd_printf(mcd, "?"); break; @@ -1556,6 +1574,9 @@ void sys_display_register() /* * $Log: sys_display.c,v $ + * Revision 1.49 2003/01/26 18:18:36 steve + * Support display of real values and constants. + * * Revision 1.48 2003/01/09 04:10:58 steve * use userdata to save $display argument handles. *