link/crc: use OrderedDict to generate the same code on each iteration
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 21 Jan 2015 10:47:20 +0000 (11:47 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 21 Jan 2015 10:48:06 +0000 (11:48 +0100)
litesata/core/link/crc.py

index 1f5ac617b73ebf589137acc840b82c5e479f03f9..89e4a13b0e3e1230c81d37b9589e453f50c3949c 100644 (file)
@@ -1,3 +1,4 @@
+from collections import OrderedDict
 from litesata.common import *
 
 from migen.actorlib.crc import CRCInserter, CRCChecker
@@ -36,7 +37,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