Skip to content

Commit

Permalink
Fix the vlog95 -> and <-> expression code for wide results
Browse files Browse the repository at this point in the history
  • Loading branch information
caryr committed Dec 1, 2020
1 parent c37f1c9 commit 11f4e71
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tgt-vlog95/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,15 +501,18 @@ static void emit_expr_binary(ivl_scope_t scope, ivl_expr_t expr, unsigned wid,
emit_expr(scope, oper2, ivl_expr_width(oper2), 0, 1, 0);
break;
case 'q': // The arguments have already been reduced
fprintf(vlog_out, "~");
fprintf(vlog_out, "{~");
emit_expr(scope, oper1, ivl_expr_width(oper1), 0, 1, 0);
fprintf(vlog_out, " | ");
emit_expr(scope, oper2, ivl_expr_width(oper2), 0, 1, 0);
fprintf(vlog_out, "}");
break;
case 'Q': // The arguments have already been reduced
fprintf(vlog_out, "{");
emit_expr(scope, oper1, ivl_expr_width(oper1), 0, 1, 0);
fprintf(vlog_out, " ~^ ");
emit_expr(scope, oper2, ivl_expr_width(oper2), 0, 1, 0);
fprintf(vlog_out, "}");
break;
case 'R':
if (! allow_signed) {
Expand Down

0 comments on commit 11f4e71

Please sign in to comment.