bank/csrgen/BankArray: create banks in sorted order
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Wed, 13 Mar 2013 22:07:44 +0000 (23:07 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Wed, 13 Mar 2013 22:07:44 +0000 (23:07 +0100)
migen/bank/csrgen.py

index e345de3c6a8a165a9dfd56e37670831bf0378dd5..d3f158f8ee052d40ee2ce76258ca095ce238c008 100644 (file)
@@ -1,3 +1,5 @@
+from operator import itemgetter
+
 from migen.fhdl.structure import *
 from migen.bus import csr
 from migen.bank.description import *
@@ -100,7 +102,7 @@ class BankArray:
        def scan(self):
                self.banks = []
                self.srams = []
-               for name, obj in self.source.__dict__.items():
+               for name, obj in sorted(self.source.__dict__.items(), key=itemgetter(0)):
                        if hasattr(obj, "get_registers"):
                                registers = obj.get_registers()
                        else: