diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/synth/synth-source.adb | 27 | ||||
| -rw-r--r-- | src/synth/synth-source.ads | 5 | ||||
| -rw-r--r-- | src/synth/synth-stmts.adb | 5 | 
3 files changed, 35 insertions, 2 deletions
| diff --git a/src/synth/synth-source.adb b/src/synth/synth-source.adb index 4f6230723..e5d38e85c 100644 --- a/src/synth/synth-source.adb +++ b/src/synth/synth-source.adb @@ -47,4 +47,31 @@ package body Synth.Source is           Set_Location2 (Inst, Src);        end if;     end Set_Location; + +   procedure Set_Location_Maybe2 (Inst : Netlists.Instance; Src : Syn_Src) is +   begin +      if Get_Location (Inst) /= No_Location then +         return; +      end if; +      Set_Location2 (Inst, Src); +   end Set_Location_Maybe2; + +   procedure Set_Location_Maybe (Inst : Netlists.Instance; Src : Syn_Src) is +   begin +      if Flag_Locations then +         Set_Location_Maybe2 (Inst, Src); +      end if; +   end Set_Location_Maybe; + +   procedure Set_Location_Maybe2 (N : Netlists.Net; Src : Syn_Src) is +   begin +      Set_Location_Maybe2 (Get_Net_Parent (N), Src); +   end Set_Location_Maybe2; + +   procedure Set_Location_Maybe (N : Netlists.Net; Src : Syn_Src) is +   begin +      if Flag_Locations then +         Set_Location_Maybe2 (N, Src); +      end if; +   end Set_Location_Maybe;  end Synth.Source; diff --git a/src/synth/synth-source.ads b/src/synth/synth-source.ads index 8962d86b1..c7f1d3d83 100644 --- a/src/synth/synth-source.ads +++ b/src/synth/synth-source.ads @@ -38,4 +38,9 @@ package Synth.Source is     procedure Set_Location (Inst : Netlists.Instance; Src : Syn_Src);     pragma Inline (Set_Location); + +   --  Set only if not yet set. +   procedure Set_Location_Maybe (Inst : Netlists.Instance; Src : Syn_Src); +   procedure Set_Location_Maybe (N : Netlists.Net; Src : Syn_Src); +   pragma Inline (Set_Location);  end Synth.Source; diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb index e73bc59f0..116289c8f 100644 --- a/src/synth/synth-stmts.adb +++ b/src/synth/synth-stmts.adb @@ -520,8 +520,9 @@ package body Synth.Stmts is        N : Net;     begin        if Voff /= No_Net then -         N := Build_Dyn_Extract -           (Get_Build (Syn_Inst), Get_Net (Obj), Voff, Off, Typ.W); +         N := Get_Net (Obj); +         Synth.Source.Set_Location_Maybe (N, Loc); +         N := Build_Dyn_Extract (Get_Build (Syn_Inst), N, Voff, Off, Typ.W);        else           pragma Assert (not Is_Static (Obj));           if Off = 0 | 
