From: Tim 'mithro' Ansell Date: Fri, 16 Dec 2016 14:59:26 +0000 (+0100) Subject: Allow CSRElement objects to be autocompleted. X-Git-Tag: 24jan2021_ls180~1920^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1f6dc446d298979ac156c3261f95c8aec6d8c200;p=litex.git Allow CSRElement objects to be autocompleted. --- 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)