Allow CSRElement objects to be autocompleted.
authorTim 'mithro' Ansell <mithro@mithis.com>
Fri, 16 Dec 2016 14:59:26 +0000 (15:59 +0100)
committerTim 'mithro' Ansell <mithro@mithis.com>
Sat, 17 Dec 2016 13:14:53 +0000 (14:14 +0100)
litex/soc/tools/remote/csr_builder.py

index fa170ea595c62079a44c7b829fe710733e9a867b..07edc61e2a83e589d8eb7d8a6dc9b14d5974f426 100644 (file)
@@ -3,11 +3,15 @@ import csv
 
 class CSRElements:
     def __init__(self, d):
-        self.d = d
+        self.__dict__.update(d)
+
+    @property
+    def d(self):
+        return self.__dict__
 
     def __getattr__(self, attr):
         try:
-            return self.__dict__['d'][attr]
+            return self.__dict__[attr]
         except KeyError:
             pass
         raise KeyError("No such element " + attr)