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()) {