From fd4018cb3339bacd868d81a3c2db49eea2030e70 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sun, 5 Oct 2008 17:08:19 +0100 Subject: [PATCH] Fix IVL_LPM_MUX where inputs are different signedness to outputs --- tgt-vhdl/lpm.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tgt-vhdl/lpm.cc b/tgt-vhdl/lpm.cc index d827ff5b4..b37866fca 100644 --- a/tgt-vhdl/lpm.cc +++ b/tgt-vhdl/lpm.cc @@ -304,6 +304,10 @@ static int draw_mux_lpm(vhdl_arch *arch, ivl_lpm_t lpm) vhdl_var_ref *out = nexus_to_var_ref(scope, ivl_lpm_q(lpm, 0)); + // Make sure s0 and s1 have the same type as the output + s0 = s0->cast(out->get_type()); + s1 = s1->cast(out->get_type()); + vhdl_cassign_stmt *s = new vhdl_cassign_stmt(out, s0); s->add_condition(s1, t1);