diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-08-13 06:51:29 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-08-13 06:51:29 +0200 |
commit | b45157d46cc6b7f927e367d6e0e831ed7da0ea4e (patch) | |
tree | b9770b8abf30e4505bdf2acfff7ce07fa9ef1a3f /src | |
parent | 6a9076373da48d2bac2fd9bb1eae22f0ac05d075 (diff) | |
download | ghdl-b45157d46cc6b7f927e367d6e0e831ed7da0ea4e.tar.gz ghdl-b45157d46cc6b7f927e367d6e0e831ed7da0ea4e.tar.bz2 ghdl-b45157d46cc6b7f927e367d6e0e831ed7da0ea4e.zip |
netlists-memories: fix a crash on multi-dim memories. For #2077
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/netlists-memories.adb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/synth/netlists-memories.adb b/src/synth/netlists-memories.adb index f0af40455..a29ec0d33 100644 --- a/src/synth/netlists-memories.adb +++ b/src/synth/netlists-memories.adb @@ -877,6 +877,9 @@ package body Netlists.Memories is return Get_Param_Uns32 (Val, 0) = Get_Param_Uns32 (Midx, 1); end Is_Reverse_Range; + -- Direction TO in address port generates a sub (as vectors are normalized + -- on the DOWNTO direction). Simply remap the memory by removing all the + -- subs. procedure Maybe_Remap_Address (Ctxt : Context_Acc; Sig : Instance; Nbr_Ports : Nat32) is @@ -926,7 +929,7 @@ package body Netlists.Memories is when Id_Memidx => null; when Id_Addidx => - M := Get_Net_Parent (Get_Output (M, 0)); + M := Get_Input_Instance (M, 0); pragma Assert (Get_Id (M) = Id_Memidx); when others => raise Internal_Error; @@ -961,9 +964,9 @@ package body Netlists.Memories is Ports (I) := No_Instance; Done := True; when Id_Addidx => - M := Get_Net_Parent (Get_Output (M, 0)); + Ports (I) := Get_Input_Instance (M, 1); + M := Get_Input_Instance (M, 0); pragma Assert (Get_Id (M) = Id_Memidx); - Ports (I) := Get_Net_Parent (Get_Output (M, 1)); when others => raise Internal_Error; end case; |