back.pysim: better naming. NFC.
authorwhitequark <cz@m-labs.hk>
Fri, 14 Dec 2018 15:21:13 +0000 (15:21 +0000)
committerwhitequark <cz@m-labs.hk>
Fri, 14 Dec 2018 15:21:13 +0000 (15:21 +0000)
nmigen/back/pysim.py

index 984de7ce425e94fd1f0e06b5e1872441f2592593..3b72d778d7f4313c92ff3f4c190c165aee3d22e7 100644 (file)
@@ -279,14 +279,14 @@ class Simulator:
                 self._domain_triggers[cd.rst] = domain
             self._domain_signals[domain] = ValueSet()
 
-        fragment_names = {}
-        def add_fragment(fragment, hierarchy=("top",)):
-            fragment_names[fragment] = hierarchy
+        hierarchy = {}
+        def add_fragment(fragment, scope=("top",)):
+            hierarchy[fragment] = scope
             for subfragment, name in fragment.subfragments:
-                add_fragment(subfragment, (*hierarchy, name))
+                add_fragment(subfragment, (*scope, name))
         add_fragment(root_fragment)
 
-        for fragment, fragment_name in fragment_names.items():
+        for fragment, fragment_name in hierarchy.items():
             for signal in fragment.iter_signals():
                 self._signals.add(signal)