link/crc: use OrderedDict to generate the same code on each iteration

This commit is contained in:
Florent Kermarrec 2015-01-21 11:47:20 +01:00
parent 62bb5b47ca
commit f0f6183c9a
1 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,4 @@
from collections import OrderedDict
from litesata.common import * from litesata.common import *
from migen.actorlib.crc import CRCInserter, CRCChecker from migen.actorlib.crc import CRCInserter, CRCChecker
@ -36,7 +37,7 @@ class CRCEngine(Module):
Replace even numbers of XORs in the equation Replace even numbers of XORs in the equation
with an equivalent XOR with an equivalent XOR
""" """
d = {} d = OrderedDict()
for e in l: for e in l:
if e in d: if e in d:
d[e] += 1 d[e] += 1