From 0fc5d37901c303f3840717f01a018fc05fe346e4 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 14 Mar 2023 20:29:47 -0400 Subject: [PATCH] Fix bounded queues with parameter bounds --- src/V3Width.cpp | 1 + test_regress/t/t_queue_bounded.v | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/V3Width.cpp b/src/V3Width.cpp index fc46c977d..70ced22a4 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -1682,6 +1682,7 @@ private: // Iterate into subDTypep() to resolve that type and update pointer. nodep->refDTypep(iterateEditMoveDTypep(nodep, nodep->subDTypep())); nodep->dtypep(nodep); // The array itself, not subDtype + userIterateAndNext(nodep->boundp(), WidthVP{SELF, BOTH}.p()); if (VN_IS(nodep->boundp(), Unbounded)) { nodep->boundp()->unlinkFrBack()->deleteTree(); // nullptr will represent unbounded } diff --git a/test_regress/t/t_queue_bounded.v b/test_regress/t/t_queue_bounded.v index e6020465b..05653887c 100644 --- a/test_regress/t/t_queue_bounded.v +++ b/test_regress/t/t_queue_bounded.v @@ -6,7 +6,9 @@ module t (/*AUTOARG*/); - int q[$ : 2]; // Shall not go higher than [2], i.e. size 3 + localparam TWO = 2; + + int q[$ : TWO]; // Shall not go higher than [2], i.e. size 3 initial begin q.push_front(3);