A non-negated reduction needs to change a 1'bz into a 1'bx.

In a procedural single bit non-negated reduction (&, | or ^)
we need to translate a 1'bz to a 1'bx. The easiest way to do
that is with two %inv opcodes. This patch modifies the code
generator to do this for this very special case.
This commit is contained in:
Cary R 2008-11-17 15:59:40 -08:00 committed by Stephen Williams
parent a8a8d3ce5b
commit e191fcdd28
1 changed files with 5 additions and 0 deletions

View File

@ -2580,6 +2580,11 @@ static struct vector_info draw_unary_expr(ivl_expr_t exp, unsigned wid)
} else if (inv) {
assert(res.base >= 4);
fprintf(vvp_out, " %%inv %u, 1;\n", res.base);
} else {
/* We need to convert a 1'bz to 1'bx. */
assert(res.base >= 4);
fprintf(vvp_out, " %%inv %u, 1;\n", res.base);
fprintf(vvp_out, " %%inv %u, 1;\n", res.base);
}
/* If the result needs to be bigger then the calculated