diff options
| author | Tristan Gingold <tgingold@free.fr> | 2020-05-01 08:53:11 +0200 | 
|---|---|---|
| committer | Tristan Gingold <tgingold@free.fr> | 2020-05-01 09:00:14 +0200 | 
| commit | e33a1cd17bd2bff4d3832988cff9e78d7bd6be41 (patch) | |
| tree | 8e25e85b9ff97a29380f3540ba5c6214a5863ff0 | |
| parent | e3eb603c236e68e8438c212656a73fb58a3632f8 (diff) | |
| download | ghdl-e33a1cd17bd2bff4d3832988cff9e78d7bd6be41.tar.gz ghdl-e33a1cd17bd2bff4d3832988cff9e78d7bd6be41.tar.bz2 ghdl-e33a1cd17bd2bff4d3832988cff9e78d7bd6be41.zip  | |
netlists-folds: add Buil2_Imp
| -rw-r--r-- | src/synth/netlists-folds.adb | 14 | ||||
| -rw-r--r-- | src/synth/netlists-folds.ads | 14 | 
2 files changed, 24 insertions, 4 deletions
diff --git a/src/synth/netlists-folds.adb b/src/synth/netlists-folds.adb index e591c35cf..a46aef583 100644 --- a/src/synth/netlists-folds.adb +++ b/src/synth/netlists-folds.adb @@ -270,4 +270,18 @@ package body Netlists.Folds is           return Build_Extract (Ctxt, I, Off, W);        end if;     end Build2_Extract; + +   function Build2_Imp (Ctxt : Context_Acc; +                        A, B : Net; +                        Loc : Location_Type := No_Location) +                       return Net +   is +      N : Net; +   begin +      N := Build_Monadic (Ctxt, Id_Not, A); +      Set_Location (N, Loc); +      N := Build_Dyadic (Ctxt, Id_Or, N, B); +      Set_Location (N, Loc); +      return N; +   end Build2_Imp;  end Netlists.Folds; diff --git a/src/synth/netlists-folds.ads b/src/synth/netlists-folds.ads index 68c6ba5a4..f00ded470 100644 --- a/src/synth/netlists-folds.ads +++ b/src/synth/netlists-folds.ads @@ -60,13 +60,19 @@ package Netlists.Folds is     --  If IS_SIGNED is true, this is Build2_Sresize, otherwise Build2_Uresize.     function Build2_Resize (Ctxt : Context_Acc; -                            I : Net; -                            W : Width; -                            Is_Signed : Boolean; -                            Loc : Location_Type := No_Location) +                           I : Net; +                           W : Width; +                           Is_Signed : Boolean; +                           Loc : Location_Type := No_Location)                            return Net;     --  Same as Build_Extract, but return I iff extract all the bits.     function Build2_Extract       (Ctxt : Context_Acc; I : Net; Off, W : Width) return Net; + +   --  Return A -> B  ==  !A || B +   function Build2_Imp (Ctxt : Context_Acc; +                        A, B : Net; +                        Loc : Location_Type := No_Location) +                       return Net;  end Netlists.Folds;  | 
