mirror of
https://github.com/verilator/verilator.git
synced 2026-09-03 08:24:31 +02:00
Support [*N:$] consecutive repetition (#7940)
Signed-off-by: Artur Bieniek <[email protected]>
This commit is contained in:
+4
-1
@@ -1556,7 +1556,7 @@ class WidthVisitor final : public VNVisitor {
|
||||
}
|
||||
}
|
||||
void visit(AstSConsRep* nodep) override {
|
||||
// IEEE 1800-2023 16.9.2 -- consecutive repetition [*N], [*N:M], [+], [*]
|
||||
// IEEE 1800-2023 16.9.2 -- consecutive repetition [*N], [*N:M], [*N:$], [+], [*]
|
||||
assertAtExpr(nodep);
|
||||
if (m_vup->prelim()) {
|
||||
userIterateAndNext(nodep->exprp(), WidthVP{SELF, BOTH}.p());
|
||||
@@ -1566,6 +1566,9 @@ class WidthVisitor final : public VNVisitor {
|
||||
if (!minConstp) {
|
||||
nodep->v3error("Consecutive repetition count must be constant expression"
|
||||
" (IEEE 1800-2023 16.9.2)");
|
||||
} else if (minConstp->toSInt() < 0) {
|
||||
nodep->v3error("Consecutive repetition count must be non-negative"
|
||||
" (IEEE 1800-2023 16.9.2)");
|
||||
} else if (!nodep->unbounded() && !nodep->maxCountp() && minConstp->toSInt() < 1) {
|
||||
nodep->v3warn(E_UNSUPPORTED, "Unsupported: [*0] consecutive repetition");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user