fhdl.ast.Signal: assign an internal name if tracer fails.
authorwhitequark <whitequark@whitequark.org>
Wed, 12 Dec 2018 10:08:56 +0000 (10:08 +0000)
committerwhitequark <whitequark@whitequark.org>
Wed, 12 Dec 2018 10:08:56 +0000 (10:08 +0000)
nmigen/fhdl/ast.py

index 198b5c4b522865407c34e22dcb957899ee3918b1..b78021f89d4b5d6db32200d8e41a67400cb6e6a3 100644 (file)
@@ -505,7 +505,10 @@ class Signal(Value, DUID):
         super().__init__()
 
         if name is None:
-            name = tracer.get_var_name()
+            try:
+                name = tracer.get_var_name()
+            except tracer.NameNotFound:
+                name = "$signal"
         self.name = name
 
         if isinstance(bits_sign, int):