bank/csrgen: allow specifying existing CSR interface
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Fri, 6 Apr 2012 12:59:09 +0000 (14:59 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Fri, 6 Apr 2012 12:59:09 +0000 (14:59 +0200)
migen/bank/csrgen.py

index 5f5437f34b00384cfd74bf247b6cdabf607e0bb5..f8db136a525feb4303076e592a5015d81b21dd4c 100644 (file)
@@ -3,10 +3,12 @@ from migen.bus.csr import *
 from migen.bank.description import *
 
 class Bank:
-       def __init__(self, description, address=0):
+       def __init__(self, description, address=0, interface=None):
                self.description = description
                self.address = address
-               self.interface = Interface()
+               if interface is None:
+                       interface = Interface()
+               self.interface = interface
        
        def get_fragment(self):
                comb = []