diff --git a/src/V3LinkResolve.cpp b/src/V3LinkResolve.cpp index d12da2db1..bba0369ef 100644 --- a/src/V3LinkResolve.cpp +++ b/src/V3LinkResolve.cpp @@ -100,11 +100,23 @@ private: virtual void visit(AstSenItem* nodep, AstNUser*) { // Remove bit selects, and bark if it's not a simple variable nodep->iterateChildren(*this); - while (AstNodeSel* selp = nodep->sensp()->castNodeSel()) { - AstNode* fromp = selp->fromp()->unlinkFrBack(); - selp->replaceWith(fromp); selp->deleteTree(); selp=NULL; + bool did=1; + while (did) { + did=0; + if (AstNodeSel* selp = nodep->sensp()->castNodeSel()) { + AstNode* fromp = selp->fromp()->unlinkFrBack(); + selp->replaceWith(fromp); selp->deleteTree(); selp=NULL; + did=1; + } + // NodeSel doesn't include AstSel.... + if (AstSel* selp = nodep->sensp()->castSel()) { + AstNode* fromp = selp->fromp()->unlinkFrBack(); + selp->replaceWith(fromp); selp->deleteTree(); selp=NULL; + did=1; + } } if (!nodep->sensp()->castNodeVarRef()) { + if (debug()) nodep->dumpTree(cout,"-tree: "); nodep->v3error("Unsupported: Complex statement in sensitivity list"); } } diff --git a/test_regress/t/t_mem.v b/test_regress/t/t_mem.v index 3b73e234c..7639244b2 100644 --- a/test_regress/t/t_mem.v +++ b/test_regress/t/t_mem.v @@ -29,7 +29,8 @@ module t (/*AUTOARG*/ reg [7:0] memory8_16_4; reg [7:0] memory8_16_5; - always @ (memory8_16[4] or memory8_16[5]) begin + // Test complicated sensitivity lists + always @ (memory8_16[4][7:1] or memory8_16[5]) begin memory8_16_4 = memory8_16[4]; memory8_16_5 = memory8_16[5]; end