aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-memories.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-29 18:39:34 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-29 18:56:33 +0200
commit36cf92801b25119b12b300eef517e7e85c796efb (patch)
tree6806cb5369c5b1619a9d801f907b2a9b8c242c62 /src/synth/netlists-memories.adb
parent633f76ee936e55de71262a2eba164e8abfe8fa26 (diff)
downloadghdl-36cf92801b25119b12b300eef517e7e85c796efb.tar.gz
ghdl-36cf92801b25119b12b300eef517e7e85c796efb.tar.bz2
ghdl-36cf92801b25119b12b300eef517e7e85c796efb.zip
netlists: handle UL32 in memory initial value.
Diffstat (limited to 'src/synth/netlists-memories.adb')
-rw-r--r--src/synth/netlists-memories.adb19
1 files changed, 16 insertions, 3 deletions
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 =>