csr: add assert to ensure CSR size < busword (thanks tweakoz)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 3 Jul 2019 11:43:34 +0000 (13:43 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 3 Jul 2019 11:44:15 +0000 (13:44 +0200)
litex/soc/interconnect/csr.py

index 4ee7a41c75d457f2868c9d27510e5f95a84d3829..4165dbd24e63b1d975a1e5b4b8b26e27e2272b26 100644 (file)
@@ -340,6 +340,7 @@ class GenericBank(Module):
         self.simple_csrs = []
         for c in description:
             if isinstance(c, CSR):
+                assert c.size <= busword
                 self.simple_csrs.append(c)
             else:
                 c.finalize(busword)