From 90880e86ada32f87fb82675046bf24ed39deb7a2 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 20 Oct 2023 08:04:42 -0700 Subject: [PATCH] vvp: Don't schedule initial value propagation for net array ports An initial value propagation should only be scheduled for variable array ports, but not for net array port since those do not contain any values. This got accidentally broken when fixing support for 2-state variable array ports. Add a check that only does the initial value propagation if the port is for a variable array. Fixes: 0eb01fff1e73 ("vvp: Fix initial value propagation for 2-state non-automatic arrays") Signed-off-by: Lars-Peter Clausen --- vvp/array.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vvp/array.cc b/vvp/array.cc index 1cbbda240..7b3d6699c 100644 --- a/vvp/array.cc +++ b/vvp/array.cc @@ -1259,7 +1259,8 @@ static void array_attach_port(vvp_array_t array, vvp_fun_arrayport*fun) assert(fun->next_ == 0); fun->next_ = array->ports_; array->ports_ = fun; - if (!array->get_scope()->is_automatic()) { + if (!array->get_scope()->is_automatic() && + (array->vals4 || array->vals)) { /* propagate initial values for variable arrays */ if (!vpi_array_is_real(array)) { vvp_bit4_t init;