diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-01-01 18:05:00 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-01-01 18:05:00 +0100 |
commit | e84f35edb1c36d07a15f8f15873b4990b55d9aaf (patch) | |
tree | 6476b548c6bf2311fa2b0a704196341e3ab90c54 /src/synth/netlists-utils.adb | |
parent | 28a81b3a60952607c03191b8f71e11588047c721 (diff) | |
download | ghdl-e84f35edb1c36d07a15f8f15873b4990b55d9aaf.tar.gz ghdl-e84f35edb1c36d07a15f8f15873b4990b55d9aaf.tar.bz2 ghdl-e84f35edb1c36d07a15f8f15873b4990b55d9aaf.zip |
netlists-inference: handle multiple dff with the same clock. Fix #1563
Diffstat (limited to 'src/synth/netlists-utils.adb')
-rw-r--r-- | src/synth/netlists-utils.adb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/synth/netlists-utils.adb b/src/synth/netlists-utils.adb index 74df5908c..8463da355 100644 --- a/src/synth/netlists-utils.adb +++ b/src/synth/netlists-utils.adb @@ -289,6 +289,19 @@ package body Netlists.Utils is end; end Same_Net; + function Same_Clock (L, R : Net) return Boolean + is + Linst : constant Instance := Get_Net_Parent (L); + Rinst : constant Instance := Get_Net_Parent (R); + begin + if Get_Id (Linst) /= Get_Id (Rinst) then + return False; + end if; + pragma Assert (Get_Id (Linst) in Edge_Module_Id); + return Same_Net (Get_Input_Net (Linst, 0), + Get_Input_Net (Rinst, 0)); + end Same_Clock; + procedure Copy_Attributes (Dest : Instance; Src : Instance) is Attr : Attribute; |