hdl.rec: thread src_loc_at to all inner Signals and Records.
authorwhitequark <whitequark@whitequark.org>
Wed, 3 Jul 2019 14:49:20 +0000 (14:49 +0000)
committerwhitequark <whitequark@whitequark.org>
Wed, 3 Jul 2019 14:49:20 +0000 (14:49 +0000)
nmigen/hdl/rec.py

index be70af2792ce6153c4aa46602068a7938a6fa181..7828f76fdb98c878caae79e5ba5fa421ec1cd243 100644 (file)
@@ -110,9 +110,11 @@ class Record(Value):
                 self.fields[field_name] = field
             else:
                 if isinstance(field_shape, Layout):
-                    self.fields[field_name] = Record(field_shape, name=concat(name, field_name))
+                    self.fields[field_name] = Record(field_shape, name=concat(name, field_name),
+                                                     src_loc_at=src_loc_at + 1)
                 else:
-                    self.fields[field_name] = Signal(field_shape, name=concat(name, field_name))
+                    self.fields[field_name] = Signal(field_shape, name=concat(name, field_name),
+                                                     src_loc_at=src_loc_at + 1)
 
     def __getattr__(self, name):
         return self[name]