aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-folds.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-06 08:20:33 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-06 08:20:33 +0200
commit91a8e2335d1f1b3bf3232c60d84aec94fc8f85b9 (patch)
tree3ab8493102bca154745594468b3458a948b2e460 /src/synth/netlists-folds.adb
parentcb5690c37d52124316603f868fb165d15a5e0c8c (diff)
downloadghdl-91a8e2335d1f1b3bf3232c60d84aec94fc8f85b9.tar.gz
ghdl-91a8e2335d1f1b3bf3232c60d84aec94fc8f85b9.tar.bz2
ghdl-91a8e2335d1f1b3bf3232c60d84aec94fc8f85b9.zip
netlists-folds: add Build2_And, remove default location.
Diffstat (limited to 'src/synth/netlists-folds.adb')
-rw-r--r--src/synth/netlists-folds.adb24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/synth/netlists-folds.adb b/src/synth/netlists-folds.adb
index a46aef583..9aa070238 100644
--- a/src/synth/netlists-folds.adb
+++ b/src/synth/netlists-folds.adb
@@ -175,7 +175,7 @@ package body Netlists.Folds is
function Build2_Uresize (Ctxt : Context_Acc;
I : Net;
W : Width;
- Loc : Location_Type := No_Location)
+ Loc : Location_Type)
return Net
is
Wn : constant Width := Get_Width (I);
@@ -216,7 +216,7 @@ package body Netlists.Folds is
function Build2_Sresize (Ctxt : Context_Acc;
I : Net;
W : Width;
- Loc : Location_Type := No_Location)
+ Loc : Location_Type)
return Net
is
Wn : constant Width := Get_Width (I);
@@ -251,7 +251,7 @@ package body Netlists.Folds is
I : Net;
W : Width;
Is_Signed : Boolean;
- Loc : Location_Type := No_Location)
+ Loc : Location_Type)
return Net is
begin
if Is_Signed then
@@ -271,9 +271,7 @@ package body Netlists.Folds is
end if;
end Build2_Extract;
- function Build2_Imp (Ctxt : Context_Acc;
- A, B : Net;
- Loc : Location_Type := No_Location)
+ function Build2_Imp (Ctxt : Context_Acc; A, B : Net; Loc : Location_Type)
return Net
is
N : Net;
@@ -284,4 +282,18 @@ package body Netlists.Folds is
Set_Location (N, Loc);
return N;
end Build2_Imp;
+
+ function Build2_And (Ctxt : Context_Acc; A, B : Net; Loc : Location_Type)
+ return Net
+ is
+ pragma Assert (B /= No_Net);
+ N : Net;
+ begin
+ if A = No_Net then
+ return B;
+ end if;
+ N := Build_Dyadic (Ctxt, Id_And, A, B);
+ Set_Location (N, Loc);
+ return N;
+ end Build2_And;
end Netlists.Folds;