diff --git a/src/V3Ast.h b/src/V3Ast.h index 3563f3dbe..8fe6bb0f1 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -153,7 +153,7 @@ public: }; const char* verilogKwd() const { static const char* names[] = { - "%E-edge", "[any]", "[both]", "posedge", "negedge", "[high]","[low]", + "%E-edge", "[any]", "edge", "posedge", "negedge", "[high]","[low]", "*","[initial]","[settle]","[never]" }; return names[m_e]; diff --git a/src/V3EmitV.cpp b/src/V3EmitV.cpp index dbe42fda9..7b85bec09 100644 --- a/src/V3EmitV.cpp +++ b/src/V3EmitV.cpp @@ -127,7 +127,7 @@ class EmitVBaseVisitor : public EmitCBaseVisitor { // AstSenItem is called for dumping in isolation by V3Order putbs("@("); for (AstNode* expp=nodep->sensesp(); expp; expp = expp->nextp()) { - nodep->iterateChildren(*this); + expp->accept(*this); if (expp->nextp()) puts(" or "); } puts(")"); diff --git a/src/verilog.l b/src/verilog.l index 6c35d6a4c..dbb969c8f 100644 --- a/src/verilog.l +++ b/src/verilog.l @@ -206,7 +206,7 @@ escid \\[^ \t\f\r\n]+ "default" { FL; return yDEFAULT; } "defparam" { FL; return yDEFPARAM; } "disable" { FL; return yDISABLE; } - "edge" { FL; return yaTIMINGSPEC; } + "edge" { FL; return yEDGE; } "else" { FL; return yELSE; } "end" { FL; return yEND; } "endcase" { FL; return yENDCASE; } diff --git a/src/verilog.y b/src/verilog.y index 5988988c6..f0521f223 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -265,6 +265,7 @@ class AstSenTree; %token yDEFPARAM "defparam" %token yDISABLE "disable" %token yDO "do" +%token yEDGE "edge" %token yELSE "else" %token yEND "end" %token yENDCASE "endcase" @@ -1680,8 +1681,10 @@ senitemVar: senitemEdge: // IEEE: part of event_expression yPOSEDGE idClassSel { $$ = new AstSenItem($1,AstEdgeType::POSEDGE,$2); } | yNEGEDGE idClassSel { $$ = new AstSenItem($1,AstEdgeType::NEGEDGE,$2); } + | yEDGE idClassSel { $$ = new AstSenItem($1,AstEdgeType::BOTHEDGE,$2); } | yPOSEDGE '(' idClassSel ')' { $$ = new AstSenItem($1,AstEdgeType::POSEDGE,$3); } | yNEGEDGE '(' idClassSel ')' { $$ = new AstSenItem($1,AstEdgeType::NEGEDGE,$3); } + | yEDGE '(' idClassSel ')' { $$ = new AstSenItem($1,AstEdgeType::BOTHEDGE,$3); } //UNSUP yIFF... ;