Fix bounded queues with parameter bounds

This commit is contained in:
Wilson Snyder 2023-03-14 20:29:47 -04:00
parent ea4cc4e076
commit 0fc5d37901
2 changed files with 4 additions and 1 deletions

View File

@ -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
}

View File

@ -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);