vvp: Fix initial value propagation for 2-state non-automatic arrays
For 2-state non-automatic arrays currently real 0.0 value is propagated as the initial value. This will cause an assert at the downstream receivers which expect a vector. Make sure that the vector value 0 is propagated instead for 2-state vectors. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
778b6d937e
commit
0eb01fff1e
12
vvp/array.cc
12
vvp/array.cc
|
|
@ -1261,11 +1261,15 @@ static void array_attach_port(vvp_array_t array, vvp_fun_arrayport*fun)
|
|||
array->ports_ = fun;
|
||||
if (!array->get_scope()->is_automatic()) {
|
||||
/* propagate initial values for variable arrays */
|
||||
if (array->vals4) {
|
||||
vvp_vector4_t tmp(array->vals_width, BIT4_X);
|
||||
if (!vpi_array_is_real(array)) {
|
||||
vvp_bit4_t init;
|
||||
if (array->vals4)
|
||||
init = BIT4_X;
|
||||
else
|
||||
init = BIT4_0;
|
||||
vvp_vector4_t tmp(array->vals_width, init);
|
||||
schedule_init_propagate(fun->net_, tmp);
|
||||
}
|
||||
if (array->vals) {
|
||||
} else {
|
||||
schedule_init_propagate(fun->net_, 0.0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue