From 79919e33a2147bd3e91c6f011fcbcd5a32b7eec0 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 4 Feb 2023 21:15:53 -0800 Subject: [PATCH] Handle continuous assignment of assignment patterns to array elements Currently when creating the NetNet for a continuous assignment to an array element the type of the element is flattened into a canonical 1 dimensional form. This works for most cases because packed types are compatible if their total packed with is the same. But there are some contexts such as if the right-hand-side is an assignment pattern where the actual type matters and flattening the type will result in incorrect behavior. Retain the original type of the array element when creating the NetNet for the array element assignment. Signed-off-by: Lars-Peter Clausen --- elab_net.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/elab_net.cc b/elab_net.cc index 84bbcaa39..b8d561749 100644 --- a/elab_net.cc +++ b/elab_net.cc @@ -890,11 +890,8 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope, if (sig->pin_count() > 1 && widx_flag) { if (widx < 0 || widx >= (long) sig->pin_count()) return 0; - - netvector_t*tmp2_vec = new netvector_t(sig->data_type(), - sig->vector_width()-1,0); NetNet*tmp = new NetNet(scope, scope->local_symbol(), - sig->type(), tmp2_vec); + sig->type(), sig->net_type()); tmp->set_line(*this); tmp->local_flag(true); connect(sig->pin(widx), tmp->pin(0));