genlib/crc: use OrderedDict
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 22 Jan 2015 15:37:18 +0000 (16:37 +0100)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Thu, 22 Jan 2015 16:23:41 +0000 (00:23 +0800)
migen/genlib/crc.py

index 51a9ab1088bebcc4dd861e2f9d9a1a873a23e158..0c5714785945bddb4e6a509aaedd36e404b07ea4 100644 (file)
@@ -1,3 +1,4 @@
+from collections import OrderedDict
 from migen.fhdl.std import *
 from migen.genlib.misc import optree
 
@@ -37,7 +38,7 @@ class CRCEngine(Module):
                        Replace even numbers of XORs in the equation
                        with an equivalent XOR
                        """
-                       d = {}
+                       d = OrderedDict()
                        for e in l:
                                if e in d:
                                        d[e] += 1