diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/netlists-disp_vhdl.adb | 15 | ||||
-rw-r--r-- | src/synth/synth-expr.adb | 3 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/synth/netlists-disp_vhdl.adb b/src/synth/netlists-disp_vhdl.adb index 4681dabec..6e12f4876 100644 --- a/src/synth/netlists-disp_vhdl.adb +++ b/src/synth/netlists-disp_vhdl.adb @@ -611,12 +611,19 @@ package body Netlists.Disp_Vhdl is Disp_Template (" begin" & NL & " \o0 <= \i0;" & NL & - " \o0 (" & - "to_integer (\ui2) * \p0 + (\sp1 + \n0)" & NL & - " downto to_integer (\ui2) * \p0 + (\sp1))" & + " \o0 (", + Inst); + if Iw > 1 then + Disp_Template + ("to_integer (\ui2) * \p0 + (\sp1 + \n0)" & NL & + " downto ", + Inst, (0 => Iw - 1)); + end if; + Disp_Template + ("to_integer (\ui2) * \p0 + (\sp1))" & " <= \i1;" & NL & " end process;" & NL, - Inst, (0 => Iw - 1)); + Inst); end; when Id_Const_UB32 | Id_Const_UL32 diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index fa2ddc925..9cb1e0bcc 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -910,13 +910,14 @@ package body Synth.Expr is if Pfx_Type.Kind = Type_Vector then W := 1; - Mul := 0; if Idx_Val.Kind = Value_Discrete then Voff := No_Net; + Mul := 0; Off := Index_To_Offset (Pfx_Type.Vbound, Idx_Val.Scal, Name); else Voff := Dyn_Index_To_Offset (Pfx_Type.Vbound, Idx_Val, Name); Off := 0; + Mul := 1; end if; elsif Pfx_Type.Kind = Type_Array then W := Get_Type_Width (Pfx_Type.Arr_El); |