Skip to content

Commit

Permalink
Merge pull request #307 from antmicro/post-ops-warnings
Browse files Browse the repository at this point in the history
systemverilog: Add warnings to post inc/dec operations
  • Loading branch information
tgorochowik authored Apr 25, 2022
2 parents 0434b84 + 94f8157 commit f002d12
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions systemverilog-plugin/UhdmAst.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2575,7 +2575,11 @@ void UhdmAst::process_operation(const UHDM::BaseClass *object)
case vpiPowerOp:
current_node->type = AST::AST_POW;
break;
case vpiPostIncOp: // TODO: Make this an actual post-increment op (currently it's a pre-increment)
case vpiPostIncOp: {
// TODO: Make this an actual post-increment op (currently it's a pre-increment)
log_warning("%s:%d: Post-incrementation operations are handled as pre-incrementation.\n", object->VpiFile().c_str(), object->VpiLineNo());
}
// fallthrough
case vpiPreIncOp: {
current_node->type = AST::AST_ASSIGN_EQ;
auto id = current_node->children[0]->clone();
Expand All @@ -2585,7 +2589,11 @@ void UhdmAst::process_operation(const UHDM::BaseClass *object)
current_node->children.push_back(add_node);
break;
}
case vpiPostDecOp: // TODO: Make this an actual post-decrement op (currently it's a pre-decrement)
case vpiPostDecOp: {
// TODO: Make this an actual post-decrement op (currently it's a pre-decrement)
log_warning("%s:%d: Post-decrementation operations are handled as pre-decrementation.\n", object->VpiFile().c_str(), object->VpiLineNo());
}
// fallthrough
case vpiPreDecOp: {
current_node->type = AST::AST_ASSIGN_EQ;
auto id = current_node->children[0]->clone();
Expand Down

0 comments on commit f002d12

Please sign in to comment.