From 3189efacbca4ce65ba672bab7abe8a7b2bf8a7e1 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Mon, 19 May 2008 18:05:27 -0700 Subject: [PATCH] Fix memory word offset errors Fix handling writing to a word part select, Fix readmemb calculations for the word size. --- vpi/sys_readmem.c | 2 +- vvp/array.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vpi/sys_readmem.c b/vpi/sys_readmem.c index 7c120772d..a1a252f38 100644 --- a/vpi/sys_readmem.c +++ b/vpi/sys_readmem.c @@ -282,7 +282,7 @@ static PLI_INT32 sys_readmem_calltf(PLI_BYTE8*name) } } - item = vpi_handle_by_index(mitem,0); + item = vpi_handle_by_index(mitem,min_addr); wwid = vpi_get(vpiSize, item); /* variable that will be uses by the lexer to pass values diff --git a/vvp/array.cc b/vvp/array.cc index c76e2db41..683b0c7c3 100644 --- a/vvp/array.cc +++ b/vvp/array.cc @@ -401,7 +401,7 @@ void array_set_word(vvp_array_t arr, if (arr->vals) { assert(arr->nets == 0); - if (part_off != 0) { + if (part_off != 0 || val.size() != arr->vals_width) { if (arr->vals[address].size() == 0) arr->vals[address] = vvp_vector4_t(arr->vals_width, BIT4_X); if ((part_off + val.size()) > arr->vals[address].size()) {