From b96e9b2d90f9c586b50c442b7fd1e4bb9972ac0d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 21 May 2020 21:43:37 +0200 Subject: netlists-memories: set location on utrunc. Fix #1332 --- src/synth/netlists-disp_vhdl.adb | 21 +++++++++++---------- src/synth/netlists-memories.adb | 2 +- src/synth/synth-expr.adb | 1 + 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'src/synth') diff --git a/src/synth/netlists-disp_vhdl.adb b/src/synth/netlists-disp_vhdl.adb index c1289935c..0ca1cdb04 100644 --- a/src/synth/netlists-disp_vhdl.adb +++ b/src/synth/netlists-disp_vhdl.adb @@ -1341,16 +1341,17 @@ package body Netlists.Disp_Vhdl is if Locations.Get_Location (Inst) = No_Location then case Get_Id (Inst) is when Id_Const_UB32 - | Id_Const_SB32 - | Id_Const_UL32 - | Id_Const_Bit - | Id_Const_Log - | Id_Const_Z - | Id_Concat2 - | Id_Concat3 - | Id_Concat4 - | Id_Concatn - | Id_Extract => + | Id_Const_SB32 + | Id_Const_UL32 + | Id_Const_Bit + | Id_Const_Log + | Id_Const_Z + | Id_Const_0 + | Id_Concat2 + | Id_Concat3 + | Id_Concat4 + | Id_Concatn + | Id_Extract => null; when others => raise Internal_Error; diff --git a/src/synth/netlists-memories.adb b/src/synth/netlists-memories.adb index c127b940f..71d733826 100644 --- a/src/synth/netlists-memories.adb +++ b/src/synth/netlists-memories.adb @@ -347,7 +347,7 @@ package body Netlists.Memories is if Addr_W > Max_W then -- Need to truncate. Sub_Addr1 := Build2_Trunc - (Ctxt, Id_Utrunc, Sub_Addr, Max_W, No_Location); + (Ctxt, Id_Utrunc, Sub_Addr, Max_W, Get_Location (Inst)); else Sub_Addr1 := Sub_Addr; end if; diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index ccdbecd97..123cbd06d 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -1520,6 +1520,7 @@ package body Synth.Expr is Inp := Build_Memidx (Ctxt, Inp, Step * El_Typ.W, Max, Inp_W + Width (Clog2 (Uns64 (Step * El_Typ.W)))); + Set_Location (Inp, Name); end if; end Synth_Slice_Suffix; -- cgit v1.2.3