From 1f6dc446d298979ac156c3261f95c8aec6d8c200 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Fri, 16 Dec 2016 15:59:26 +0100 Subject: [PATCH] Allow CSRElement objects to be autocompleted. --- litex/soc/tools/remote/csr_builder.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/litex/soc/tools/remote/csr_builder.py b/litex/soc/tools/remote/csr_builder.py index fa170ea5..07edc61e 100644 --- a/litex/soc/tools/remote/csr_builder.py +++ b/litex/soc/tools/remote/csr_builder.py @@ -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) -- 2.30.2