aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/synth/netlists-disp_vhdl.adb16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/synth/netlists-disp_vhdl.adb b/src/synth/netlists-disp_vhdl.adb
index 763a08f29..c063c7425 100644
--- a/src/synth/netlists-disp_vhdl.adb
+++ b/src/synth/netlists-disp_vhdl.adb
@@ -902,11 +902,19 @@ package body Netlists.Disp_Vhdl is
Disp_X_Lit (Get_Width (Get_Output (Inst, 0)));
Put_Line (" when others;");
when Id_Add =>
- Disp_Template (" \o0 <= std_logic_vector (\ui0 + \ui1);" & NL,
- Inst);
+ if Get_Width (Get_Output (Inst, 0)) = 1 then
+ Disp_Template (" \o0 <= \i0 xor \i1; -- add" & NL, Inst);
+ else
+ Disp_Template (" \o0 <= std_logic_vector (\ui0 + \ui1);" & NL,
+ Inst);
+ end if;
when Id_Sub =>
- Disp_Template (" \o0 <= std_logic_vector (\ui0 - \ui1);" & NL,
- Inst);
+ if Get_Width (Get_Output (Inst, 0)) = 1 then
+ Disp_Template (" \o0 <= \i0 xor \i1; -- sub" & NL, Inst);
+ else
+ Disp_Template (" \o0 <= std_logic_vector (\ui0 - \ui1);" & NL,
+ Inst);
+ end if;
when Id_Umul =>
Disp_Template
(" \o0 <= std_logic_vector (resize (\ui0 * \ui1, \n0));" & NL,