From 36cf92801b25119b12b300eef517e7e85c796efb Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 29 May 2020 18:39:34 +0200 Subject: netlists: handle UL32 in memory initial value. --- src/synth/netlists-memories.adb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/synth/netlists-memories.adb') diff --git a/src/synth/netlists-memories.adb b/src/synth/netlists-memories.adb index e4e4115ed..8129c7968 100644 --- a/src/synth/netlists-memories.adb +++ b/src/synth/netlists-memories.adb @@ -1326,12 +1326,25 @@ package body Netlists.Memories is N := Build_Const_UB32 (Ctxt, 0, Mem_Wd); -- Optimize: no need to copy if the value is 0. if Get_Param_Uns32 (Cst, 0) /= 0 then - Copy_Const_Content - (Cst, Off, Cst_Wd, Get_Net_Parent (N), Wd, Depth, - Copy_Mode_Bit); + Res := Get_Net_Parent (N); + Copy_Const_Content (Cst, Off, Cst_Wd, Res, Wd, Depth, + Copy_Mode_Bit); end if; return N; end; + when Id_Const_UL32 => + declare + N : Net; + begin + N := Build_Const_UL32 (Ctxt, 0, 0, Mem_Wd); + -- Optimize: no need to copy if the value is 0. + Res := Get_Net_Parent (N); + Copy_Const_Content (Cst, Off, Cst_Wd, Res, Wd, Depth, + Copy_Mode_Val); + Copy_Const_Content (Cst, Off, Cst_Wd, Res, Wd, Depth, + Copy_Mode_Zx); + return N; + end; when Id_Const_X => return Build_Const_X (Ctxt, Mem_Wd); when others => -- cgit v1.2.3