diff --git a/include/verilated_funcs.h b/include/verilated_funcs.h index f7ba3f8b1..60dbcd8f1 100644 --- a/include/verilated_funcs.h +++ b/include/verilated_funcs.h @@ -3090,13 +3090,9 @@ static inline void VL_REVCOPY_Q(VlQueue& q, const VlUnpacked& fro template static inline void VL_COPY_Q(VlUnpacked& q, const VlQueue& from, int lbits, int srcElementBits, int dstElementBits) { - if (srcElementBits == dstElementBits) { - for (size_t i = 0; i < N_Depth; ++i) q[i] = from.at(static_cast(i)); - } else { - VlQueue tmpQ; - VL_COPY_Q(tmpQ, from, lbits, srcElementBits, dstElementBits); - for (size_t i = 0; i < N_Depth; ++i) q[i] = tmpQ.at(static_cast(i)); - } + VlQueue tmpQ; + VL_COPY_Q(tmpQ, from, lbits, srcElementBits, dstElementBits); + for (size_t i = 0; i < N_Depth; ++i) q[i] = tmpQ.at(static_cast(i)); } template diff --git a/test_regress/t/t_dynarray.v b/test_regress/t/t_dynarray.v index 914d207ec..bd9bbbf3a 100644 --- a/test_regress/t/t_dynarray.v +++ b/test_regress/t/t_dynarray.v @@ -27,6 +27,7 @@ module t ( byte_t a[]; byte_t b[]; byte_t fixed[256]; + byte_t fixed_desc[255:0]; byte_t fixed_rev[1:256]; byte_t q[$]; @@ -172,6 +173,12 @@ module t ( fixed = q; `checkh(fixed[0], 8'h40); `checkh(fixed[255], 8'h3f); + fixed_desc = a; + `checkh(fixed_desc[255], 8'h9f); + `checkh(fixed_desc[0], 8'ha0); + fixed_desc = q; + `checkh(fixed_desc[255], 8'h3f); + `checkh(fixed_desc[0], 8'h40); fixed_rev = a; `checkh(fixed_rev[1], 8'ha0); `checkh(fixed_rev[256], 8'h9f);