diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/netlists-memories.adb | 4 | ||||
-rw-r--r-- | src/synth/netlists-utils.adb | 12 | ||||
-rw-r--r-- | src/synth/netlists-utils.ads | 4 |
3 files changed, 18 insertions, 2 deletions
diff --git a/src/synth/netlists-memories.adb b/src/synth/netlists-memories.adb index c1b8603ec..908087f9e 100644 --- a/src/synth/netlists-memories.adb +++ b/src/synth/netlists-memories.adb @@ -410,9 +410,9 @@ package body Netlists.Memories is Dff_Out := Get_Output (Dff_Inst, 0); if Mux_Inp = Get_Input (Mux_Inst, 1) then - return Get_Input_Net (Mux_Inst, 2) = Dff_Out; + return Skip_Signal (Get_Input_Net (Mux_Inst, 2)) = Dff_Out; else - return Get_Input_Net (Mux_Inst, 1) = Dff_Out; + return Skip_Signal (Get_Input_Net (Mux_Inst, 1)) = Dff_Out; end if; end Is_Enable_Dff; diff --git a/src/synth/netlists-utils.adb b/src/synth/netlists-utils.adb index 59eb086d5..3f9a9fd46 100644 --- a/src/synth/netlists-utils.adb +++ b/src/synth/netlists-utils.adb @@ -175,6 +175,18 @@ package body Netlists.Utils is end case; end Get_Net_Element; + function Skip_Signal (N : Net) return Net + is + Inst : constant Instance := Get_Net_Parent (N); + begin + case Get_Id (Inst) is + when Id_Signal => + return Get_Input_Net (Inst, 0); + when others => + return N; + end case; + end Skip_Signal; + function Is_Connected (O : Net) return Boolean is begin return Get_First_Sink (O) /= No_Input; diff --git a/src/synth/netlists-utils.ads b/src/synth/netlists-utils.ads index 79838b614..be6f58e9e 100644 --- a/src/synth/netlists-utils.ads +++ b/src/synth/netlists-utils.ads @@ -79,6 +79,10 @@ package Netlists.Utils is -- selection of the same net. function Same_Net (L, R : Net) return Boolean; + -- If N is the output of a signal or isignal, return the driver of the + -- input. + function Skip_Signal (N : Net) return Net; + function Clog2 (W : Width) return Width; -- Used at many places. |