diff --git a/vvp/array.cc b/vvp/array.cc index ee7a382bb..e77da31c0 100644 --- a/vvp/array.cc +++ b/vvp/array.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2007-2013 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -1011,6 +1011,8 @@ void array_attach_word(vvp_array_t array, unsigned long addr, vpiHandle word) sig->is_netarray = 1; sig->within.parent = &array->base; sig->id.index = vpip_make_dec_const(addr + array->first_addr.value); + // Now we know the data type, update the array signed_flag. + array->signed_flag = sig->signed_flag; return; } @@ -1023,6 +1025,8 @@ void array_attach_word(vvp_array_t array, unsigned long addr, vpiHandle word) sig->is_netarray = 1; sig->within.parent = &array->base; sig->id.index = vpip_make_dec_const(addr + array->first_addr.value); + // Now we know the data type, update the array signed_flag. + array->signed_flag = true; return; } } @@ -1080,6 +1084,9 @@ void compile_real_array(char*label, char*name, int last, int first, void compile_net_array(char*label, char*name, int last, int first) { + // At this point we don't know the array data type, so we + // initialise signed_flag to false. This will be corrected + // (if necessary) when we attach words to the array. vpiHandle obj = vpip_make_array(label, name, first, last, false); struct __vpiArray*arr = ARRAY_HANDLE(obj);