From 58118bddc516bf5fefd56742fd842c3d06606315 Mon Sep 17 00:00:00 2001 From: steve Date: Tue, 25 Apr 2006 05:00:12 +0000 Subject: [PATCH] Warning when file is inadequate for requested range. --- vpi/sys_readmem.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/vpi/sys_readmem.c b/vpi/sys_readmem.c index 15fc34aff..daa7e567b 100644 --- a/vpi/sys_readmem.c +++ b/vpi/sys_readmem.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_readmem.c,v 1.16 2004/10/04 01:10:58 steve Exp $" +#ident "$Id: sys_readmem.c,v 1.17 2006/04/25 05:00:12 steve Exp $" #endif # include "vpi_config.h" @@ -134,6 +134,9 @@ static int sys_readmem_calltf(char*name) start_addraval; + /* if there is an address in the memory file, then + turn off any possible warnings about not having + enough words to load the memory. This is standard + behavior. */ + word_count = 0; break; case MEM_WORD: @@ -311,6 +322,9 @@ static int sys_readmem_calltf(char*name) word_index = vpi_handle_by_index(mitem, addr); assert(word_index); vpi_put_value(word_index, &value, 0, vpiNoDelay); + + if (word_count > 0) + word_count -= 1; } else{ vpi_printf("%s(%s): address (0x%x) out of range (0x%x:0x%x)\n", @@ -327,6 +341,10 @@ static int sys_readmem_calltf(char*name) } } + if (word_count > 0) + vpi_printf("%s(%s): Not enough words in the read file " + "for requested range.\n", name, path); + bailout: free(value.value.vector); @@ -576,6 +594,9 @@ void sys_readmem_register() /* * $Log: sys_readmem.c,v $ + * Revision 1.17 2006/04/25 05:00:12 steve + * Warning when file is inadequate for requested range. + * * Revision 1.16 2004/10/04 01:10:58 steve * Clean up spurious trailing white space. *