def insert_reset(rst, sl):
return [If(rst, *generate_reset(rst, sl)).Else(*sl)]
+def insert_resets(f):
+ newsync = dict()
+ for k, v in f.sync.items():
+ if f.clock_domains[k].rst is not None:
+ newsync[k] = insert_reset(ResetSignal(k), v)
+ else:
+ newsync[k] = v
+ f.sync = newsync
+
class _Lowerer(NodeTransformer):
def __init__(self):
self.target_context = False
r += "\n"
return r
-def _insert_resets(f):
- newsync = dict()
- for k, v in f.sync.items():
- if f.clock_domains[k].rst is not None:
- newsync[k] = insert_reset(ResetSignal(k), v)
- else:
- newsync[k] = v
- f.sync = newsync
-
def _printsync(f, ns):
r = ""
for k, v in sorted(f.sync.items(), key=itemgetter(0)):
raise KeyError("Unresolved clock domain: '"+cd_name+"'")
f = lower_complex_slices(f)
- _insert_resets(f)
+ insert_resets(f)
f = lower_basics(f)
fs, lowered_specials = _lower_specials(special_overrides, f.specials)
f += lower_basics(fs)