Support edge, 1800-2009

This commit is contained in:
Wilson Snyder 2009-12-28 19:49:40 -05:00
parent dbce06500d
commit f3347be629
4 changed files with 6 additions and 3 deletions

View File

@ -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];

View File

@ -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(")");

View File

@ -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; }

View File

@ -265,6 +265,7 @@ class AstSenTree;
%token<fl> yDEFPARAM "defparam"
%token<fl> yDISABLE "disable"
%token<fl> yDO "do"
%token<fl> yEDGE "edge"
%token<fl> yELSE "else"
%token<fl> yEND "end"
%token<fl> yENDCASE "endcase"
@ -1680,8 +1681,10 @@ senitemVar<senitemp>:
senitemEdge<senitemp>: // 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...
;