aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-utils.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-01-01 18:05:00 +0100
committerTristan Gingold <tgingold@free.fr>2021-01-01 18:05:00 +0100
commite84f35edb1c36d07a15f8f15873b4990b55d9aaf (patch)
tree6476b548c6bf2311fa2b0a704196341e3ab90c54 /src/synth/netlists-utils.adb
parent28a81b3a60952607c03191b8f71e11588047c721 (diff)
downloadghdl-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.adb13
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;