test/test_bitslip: simplify BitSlipModel
This commit is contained in:
parent
cd83448f8e
commit
98d9f1ffc0
|
@ -19,8 +19,9 @@ class BitSlipModel:
|
||||||
# simulate bitslip
|
# simulate bitslip
|
||||||
r = []
|
r = []
|
||||||
for i in range(len(s)-1):
|
for i in range(len(s)-1):
|
||||||
v = (s[i+1] & (2**bitslip-1)) << (self.data_width-bitslip)
|
v = (s[i+1] << self.data_width) | s[i]
|
||||||
v |= (s[i] >> bitslip) & (2**(self.data_width-bitslip)-1)
|
v = v >> bitslip
|
||||||
|
v &= 2**self.data_width-1
|
||||||
r.append(v)
|
r.append(v)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue