aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-10-27 21:05:03 +0100
committerTristan Gingold <tgingold@free.fr>2019-10-27 21:05:03 +0100
commit21732824cfea2164654635beb5fb28ebd6b37c35 (patch)
tree3621820e68a802dc8c1e571c81e5815fcf180429 /src
parent51f90bb57b068d7ed44ad0439bb710f8857abdb5 (diff)
downloadghdl-21732824cfea2164654635beb5fb28ebd6b37c35.tar.gz
ghdl-21732824cfea2164654635beb5fb28ebd6b37c35.tar.bz2
ghdl-21732824cfea2164654635beb5fb28ebd6b37c35.zip
netlists: change Loc parameter of synth_case.
Diffstat (limited to 'src')
-rw-r--r--src/synth/netlists-butils.adb4
-rw-r--r--src/synth/netlists-butils.ads4
-rw-r--r--src/synth/netlists-locations.adb12
-rw-r--r--src/synth/netlists-locations.ads1
-rw-r--r--src/synth/synth-stmts.adb6
5 files changed, 21 insertions, 6 deletions
diff --git a/src/synth/netlists-butils.adb b/src/synth/netlists-butils.adb
index d26e1762c..7b74def6d 100644
--- a/src/synth/netlists-butils.adb
+++ b/src/synth/netlists-butils.adb
@@ -18,13 +18,15 @@
-- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-- MA 02110-1301, USA.
+with Netlists.Locations; use Netlists.Locations;
+
package body Netlists.Butils is
procedure Synth_Case (Ctxt : Context_Acc;
Sel : Net;
Els : in out Case_Element_Array;
Default : Net;
Res : out Net;
- Sel_Loc : Syn_Src)
+ Sel_Loc : Location_Type)
is
Wd : constant Width := Get_Width (Sel);
Mask : Uns64;
diff --git a/src/synth/netlists-butils.ads b/src/synth/netlists-butils.ads
index c0d79734a..ebf03863e 100644
--- a/src/synth/netlists-butils.ads
+++ b/src/synth/netlists-butils.ads
@@ -22,8 +22,6 @@ with Ada.Unchecked_Deallocation;
with Netlists.Builders; use Netlists.Builders;
-with Synth.Source; use Synth.Source;
-
package Netlists.Butils is
type Case_Element is record
Sel : Uns64;
@@ -51,5 +49,5 @@ package Netlists.Butils is
Els : in out Case_Element_Array;
Default : Net;
Res : out Net;
- Sel_Loc : Syn_Src);
+ Sel_Loc : Location_Type);
end Netlists.Butils;
diff --git a/src/synth/netlists-locations.adb b/src/synth/netlists-locations.adb
index c651fc752..4db65c85a 100644
--- a/src/synth/netlists-locations.adb
+++ b/src/synth/netlists-locations.adb
@@ -40,6 +40,11 @@ package body Netlists.Locations is
Loc_Table.Table (Inst) := Loc;
end Set_Location1;
+ procedure Set_Location2 (N : Net; Loc : Location_Type) is
+ begin
+ Set_Location (Get_Net_Parent (N), Loc);
+ end Set_Location2;
+
procedure Set_Location (Inst : Instance; Loc : Location_Type) is
begin
if Flag_Locations then
@@ -47,6 +52,13 @@ package body Netlists.Locations is
end if;
end Set_Location;
+ procedure Set_Location (Dest : Net; Loc : Location_Type) is
+ begin
+ if Flag_Locations then
+ Set_Location2 (Dest, Loc);
+ end if;
+ end Set_Location;
+
function Get_Location1 (Inst : Instance) return Location_Type is
begin
if Inst > Loc_Table.Last then
diff --git a/src/synth/netlists-locations.ads b/src/synth/netlists-locations.ads
index 1990a8b67..3aa66b2df 100644
--- a/src/synth/netlists-locations.ads
+++ b/src/synth/netlists-locations.ads
@@ -30,6 +30,7 @@ package Netlists.Locations is
function Get_Location (Inst : Instance) return Location_Type;
-- Utilities.
+ procedure Set_Location (Dest : Net; Loc : Location_Type);
procedure Copy_Location (Dest : Net; Src : Net);
procedure Copy_Location (Dest : Net; Src : Instance);
pragma Inline (Copy_Location);
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index 187232534..2fb059ea7 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -957,7 +957,8 @@ package body Synth.Stmts is
-- Generate the muxes tree.
Synth_Case (Get_Build (C.Inst),
- Sel_Net, Case_El.all, Default, Res, Expr);
+ Sel_Net, Case_El.all, Default, Res,
+ Get_Location (Expr));
Partial_Assign_Append (List, New_Partial_Assign (Res, Off));
Min_Off := Off + Wd;
@@ -1101,7 +1102,8 @@ package body Synth.Stmts is
-- Generate the muxes tree.
Synth_Case (Get_Build (Syn_Inst),
- Sel_Net, Case_El.all, Default, Res, Expr);
+ Sel_Net, Case_El.all, Default, Res,
+ Get_Location (Expr));
Synth_Assignment (Syn_Inst, Get_Target (Stmt),
Create_Value_Net (Res, Targ_Type),
Stmt);