Skip to content

Commit

Permalink
Fix Nic30#160 by adding hierarchical_identifier as alternative in del…
Browse files Browse the repository at this point in the history
…ay_value

rule
  • Loading branch information
Thomasb81 committed Jul 14, 2024
1 parent a2c943d commit cc4ec3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions grammars/sv2017Parser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ delay_value:
| KW_1STEP
| real_number
| ps_identifier
| hierarchical_identifier
;
delay_control:
HASH ( LPAREN mintypmax_expression RPAREN
Expand Down
12 changes: 9 additions & 3 deletions src/svConvertor/delayParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ unique_ptr<iHdlExprItem> VerDelayParser::visitDelay_value(
// | TIME_LITERAL
// | KW_1STEP
// | real_number
// | ps_identifier;
// | ps_identifier
// | hierarchical_identifier
// ;
auto un = ctx->UNSIGNED_NUMBER();
if (un) {
return VerLiteralParser::visitUNSIGNED_NUMBER(un);
Expand All @@ -111,8 +113,12 @@ unique_ptr<iHdlExprItem> VerDelayParser::visitDelay_value(
return VerLiteralParser::visitReal_number(r);
}
auto pi = ctx->ps_identifier();
assert(pi);
return VerExprParser(this).visitPs_identifier(pi);
if (pi) {
return VerExprParser(this).visitPs_identifier(pi);
}
auto hi = ctx->hierarchical_identifier();
assert(hi);
return VerExprParser(this).visitHierarchical_identifier(hi);
}

pair<unique_ptr<iHdlExprItem>, VerDelayParser::HdlEventList> VerDelayParser::visitDelay_or_event_control(
Expand Down

0 comments on commit cc4ec3f

Please sign in to comment.