diff options
| author | Tristan Gingold <tgingold@free.fr> | 2019-09-26 07:44:53 +0200 | 
|---|---|---|
| committer | Tristan Gingold <tgingold@free.fr> | 2019-09-26 07:44:53 +0200 | 
| commit | d07137710b5a1ff9a0d50341c2fa0432f9c7d4b0 (patch) | |
| tree | 1b8288f49830cf6a71922f5dcac0ac526568252c /src | |
| parent | decc588e1858cca6f6447a11c7669ac697964805 (diff) | |
| download | ghdl-d07137710b5a1ff9a0d50341c2fa0432f9c7d4b0.tar.gz ghdl-d07137710b5a1ff9a0d50341c2fa0432f9c7d4b0.tar.bz2 ghdl-d07137710b5a1ff9a0d50341c2fa0432f9c7d4b0.zip | |
synth: fix handling of single-bit memories.
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); | 
