Skip to content

Commit

Permalink
Merge pull request chipsalliance#1848 from chipsalliance/alainmarcel-…
Browse files Browse the repository at this point in the history
…patch-1

grammar opt
  • Loading branch information
alaindargelas authored Sep 13, 2021
2 parents ad7d19c + 99ec016 commit 41d7414
Show file tree
Hide file tree
Showing 7 changed files with 4,780 additions and 4,859 deletions.
6 changes: 3 additions & 3 deletions grammar/SV3_1aParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -2381,9 +2381,9 @@ clocking_skew
;

edge_identifier :
POSEDGE # Edge_Posedge
| NEGEDGE # Edge_Negedge
| EDGE # Edge_Edge
POSEDGE
| NEGEDGE
| EDGE
;

clocking_drive
Expand Down
9 changes: 9 additions & 0 deletions src/SourceCompile/SV3_1aTreeShapeListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1824,4 +1824,13 @@ void SV3_1aTreeShapeListener::exitAlways_keyword(SV3_1aParser::Always_keywordCon
}
}

void SV3_1aTreeShapeListener::exitEdge_identifier(SV3_1aParser::Edge_identifierContext * ctx) {
if (ctx->POSEDGE())
addVObject (ctx, VObjectType::slEdge_Posedge);
else if (ctx->NEGEDGE())
addVObject (ctx, VObjectType::slEdge_Negedge);
else if (ctx->EDGE())
addVObject (ctx, VObjectType::slEdge_Edge);
}

} // namespace SURELOG
4 changes: 4 additions & 0 deletions src/SourceCompile/generate_parser_listener.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ set TYPES(slAlwaysKeywd_Comb) 1
set TYPES(slAlwaysKeywd_Latch) 1
set TYPES(slAlwaysKeywd_FF) 1
set TYPES(slEdge_Posedge) 1
set TYPES(slEdge_Negedge) 1
set TYPES(slEdge_Edge) 1
set TYPES(slIntegerAtomType_Byte) 1
set TYPES(slIntegerAtomType_Shortint) 1
set TYPES(slIntegerAtomType_Int) 1
Expand Down
Loading

0 comments on commit 41d7414

Please sign in to comment.