Skip to content

Commit

Permalink
Support prefix increment
Browse files Browse the repository at this point in the history
  • Loading branch information
povik committed Aug 6, 2024
1 parent 4c0d646 commit 5ee7dbc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion slang_frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,8 @@ RTLIL::SigSpec SignalEvalContext::operator()(ast::Expression const &expr)
const ast::UnaryExpression &unop = expr.as<ast::UnaryExpression>();
RTLIL::SigSpec left = (*this)(unop.operand());

if (unop.op == ast::UnaryOperator::Postincrement) {
if (unop.op == ast::UnaryOperator::Postincrement
|| unop.op == ast::UnaryOperator::Preincrement) {
require(expr, procedural != nullptr);
procedural->do_simple_assign(expr.sourceRange.start(), lhs(unop.operand()),
ret = netlist.Biop(ID($add), left, {RTLIL::S0, RTLIL::S1},
Expand Down

0 comments on commit 5ee7dbc

Please sign in to comment.