Make sure 1-bit constants are std_logic not (un)signed

This commit is contained in:
Nick Gasson 2008-07-16 16:52:15 +01:00
parent be67cae29f
commit 395a2248d8
1 changed files with 5 additions and 2 deletions

View File

@ -76,8 +76,11 @@ static vhdl_var_ref *translate_signal(ivl_expr_t e)
*/
static vhdl_expr *translate_number(ivl_expr_t e)
{
return new vhdl_const_bits(ivl_expr_bits(e), ivl_expr_width(e),
ivl_expr_signed(e) != 0);
if (ivl_expr_width(e) == 1)
return new vhdl_const_bit(ivl_expr_bits(e)[0]);
else
return new vhdl_const_bits(ivl_expr_bits(e), ivl_expr_width(e),
ivl_expr_signed(e) != 0);
}
static vhdl_expr *translate_unary(ivl_expr_t e)