Fix queue typedef with unbounded slice (#6236).

This commit is contained in:
Wilson Snyder 2025-07-28 19:36:52 -04:00
parent 2ff6ee9613
commit 0da9f6eb03
3 changed files with 5 additions and 3 deletions

View File

@ -56,6 +56,7 @@ Verilator 5.039 devel
* Fix `--stats` overridden by skipping identical build (#6220). [Geza Lore]
* Fix MODDUP with duplicate packages to take first package (#6222).
* Fix replicate with unsigned count but MSB set (#6231) (#6233). [Geza Lore]
* Fix queue typedef with unbounded slice (#6236).
Verilator 5.038 2025-07-08

View File

@ -1469,10 +1469,10 @@ class WidthVisitor final : public VNVisitor {
AstNode* backp = nodep->backp();
if (VN_IS(backp, Sub)) backp = backp->backp();
if (const auto* const selp = VN_CAST(backp, SelExtract)) {
if (VN_IS(selp->fromp()->dtypep(), QueueDType)) return;
if (VN_IS(selp->fromp()->dtypep()->skipRefp(), QueueDType)) return;
}
if (const auto* const selp = VN_CAST(backp, SelBit)) {
if (VN_IS(selp->fromp()->dtypep(), QueueDType)) return;
if (VN_IS(selp->fromp()->dtypep()->skipRefp(), QueueDType)) return;
}
// queue_slice[#:$] and queue_bitsel[$] etc handled in V3WidthSel
nodep->v3warn(E_UNSUPPORTED, "Unsupported/illegal unbounded ('$') in this context.");

View File

@ -11,7 +11,8 @@
module t (/*AUTOARG*/);
initial begin
string q[$];
typedef string q_t[$];
q_t q;
string v;
int i;
int qi[$:5];