mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Fix generate case with empty body statements.
This commit is contained in:
parent
15d0ec317d
commit
10d0088f73
1
Changes
1
Changes
@ -85,6 +85,7 @@ Verilator 5.006 2023-01-22
|
||||
* Fix elaboration of member selected classes (#3890). [Ilya Barkov]
|
||||
* Fix mismatched widths in DFG (#3872). [Geza Lore, Yike Zhou]
|
||||
* Fix lint for non-integral types in packed structs.
|
||||
* Fix generate case with empty body statements.
|
||||
|
||||
|
||||
Verilator 5.004 2022-12-14
|
||||
|
@ -1250,6 +1250,7 @@ class ParamVisitor final : public VNVisitor {
|
||||
}
|
||||
void visit(AstGenCase* nodep) override {
|
||||
UINFO(9, " GENCASE " << nodep << endl);
|
||||
bool hit = false;
|
||||
AstNode* keepp = nullptr;
|
||||
iterateAndNextNull(nodep->exprp());
|
||||
V3Case::caseLint(nodep);
|
||||
@ -1275,7 +1276,10 @@ class ParamVisitor final : public VNVisitor {
|
||||
if (const AstConst* const ccondp = VN_CAST(ep, Const)) {
|
||||
V3Number match{nodep, 1};
|
||||
match.opEq(ccondp->num(), exprp->num());
|
||||
if (!keepp && match.isNeqZero()) keepp = itemp->stmtsp();
|
||||
if (!hit && match.isNeqZero()) {
|
||||
hit = true;
|
||||
keepp = itemp->stmtsp();
|
||||
}
|
||||
} else {
|
||||
itemp->v3error("Generate Case item does not evaluate to constant");
|
||||
}
|
||||
@ -1286,7 +1290,10 @@ class ParamVisitor final : public VNVisitor {
|
||||
for (AstCaseItem* itemp = nodep->itemsp(); itemp;
|
||||
itemp = VN_AS(itemp->nextp(), CaseItem)) {
|
||||
if (itemp->isDefault()) {
|
||||
if (!keepp) keepp = itemp->stmtsp();
|
||||
if (!hit) {
|
||||
hit = true;
|
||||
keepp = itemp->stmtsp();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Replace
|
||||
|
Loading…
Reference in New Issue
Block a user