mirror of
https://github.com/verilator/verilator.git
synced 2025-01-22 14:24:18 +00:00
Fix enums in sensitivity lists
This commit is contained in:
parent
b4a8be07f3
commit
ffb187ae15
@ -1273,6 +1273,7 @@ private:
|
||||
nodep->iterateChildren(*this);
|
||||
if (m_doNConst
|
||||
&& (nodep->sensp()->castConst()
|
||||
|| nodep->sensp()->castEnumItemRef()
|
||||
|| (nodep->varrefp() && nodep->varrefp()->varp()->isParam()))) {
|
||||
// Constants in sensitivity lists may be removed (we'll simplify later)
|
||||
if (nodep->isClocked()) { // A constant can never get a pos/negexge
|
||||
@ -1301,6 +1302,9 @@ private:
|
||||
if (!senvarp) sensp->v3fatalSrc("Non-varref sensitivity variable");
|
||||
sensp->replaceWith(senvarp);
|
||||
sensp->deleteTree(); sensp=NULL;
|
||||
} else if (!m_doNConst // Deal with later when doNConst missing
|
||||
&& (nodep->sensp()->castEnumItemRef()
|
||||
|| nodep->sensp()->castConst())) {
|
||||
} else {
|
||||
if (nodep->hasVar() && !nodep->varrefp()) nodep->v3fatalSrc("Null sensitivity variable");
|
||||
}
|
||||
|
@ -183,7 +183,8 @@ private:
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!nodep->sensp()->castNodeVarRef()) {
|
||||
if (!nodep->sensp()->castNodeVarRef()
|
||||
&& !nodep->sensp()->castEnumItemRef()) { // V3Const will cleanup
|
||||
if (debug()) nodep->dumpTree(cout,"-tree: ");
|
||||
nodep->v3error("Unsupported: Complex statement in sensitivity list");
|
||||
}
|
||||
|
@ -15,6 +15,12 @@ module t;
|
||||
reg [1:0] ttype;
|
||||
reg m;
|
||||
|
||||
enum bit [1:0] { LOCAL } l;
|
||||
|
||||
always @ (m or 1'b0 or LOCAL) begin
|
||||
// Don't complain about constants in sensitivity lists
|
||||
end
|
||||
|
||||
initial begin
|
||||
ttype = pkg::E__NOT;
|
||||
m = (ttype == pkg::E__VAL);
|
||||
|
Loading…
Reference in New Issue
Block a user