From 1f1ff5a5e968b5b6078bc846671fab5b9a137435 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 24 Jul 2015 12:48:51 +0200 Subject: [PATCH] migen/fhdl/tools: fix rename_clock_domain when new == old Clock domain renaming should support new == old to allow programmatically determined clock domain renaming. --- migen/fhdl/tools.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/migen/fhdl/tools.py b/migen/fhdl/tools.py index 9a6c3a66..685f4df3 100644 --- a/migen/fhdl/tools.py +++ b/migen/fhdl/tools.py @@ -256,12 +256,13 @@ def rename_clock_domain_expr(f, old, new): def rename_clock_domain(f, old, new): rename_clock_domain_expr(f, old, new) - if old in f.sync: - if new in f.sync: - f.sync[new].extend(f.sync[old]) - else: - f.sync[new] = f.sync[old] - del f.sync[old] + if new != old: + if old in f.sync: + if new in f.sync: + f.sync[new].extend(f.sync[old]) + else: + f.sync[new] = f.sync[old] + del f.sync[old] for special in f.specials: special.rename_clock_domain(old, new) try: -- 2.30.2