mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-29 01:03:29 +02:00
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 <[email protected]>
This commit is contained in:
+8
-4
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user