From 5801e5746b637194bce6517e9bffb9c01da761c0 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 21 Nov 2014 14:51:05 -0800 Subject: [PATCH] fhdl/tools: do not attempt to rename sync clock domain if it does not exist --- migen/fhdl/tools.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/migen/fhdl/tools.py b/migen/fhdl/tools.py index 6596b30c..ed74ab0e 100644 --- a/migen/fhdl/tools.py +++ b/migen/fhdl/tools.py @@ -233,11 +233,12 @@ def rename_clock_domain_expr(f, old, new): def rename_clock_domain(f, old, new): rename_clock_domain_expr(f, old, new) - if new in f.sync: - f.sync[new].extend(f.sync[old]) - else: - f.sync[new] = f.sync[old] - del f.sync[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