test/test_bitslip: simplify BitSlipModel

This commit is contained in:
Florent Kermarrec 2017-02-10 13:18:04 +01:00
parent cd83448f8e
commit 98d9f1ffc0
1 changed files with 4 additions and 3 deletions

View File

@ -19,8 +19,9 @@ class BitSlipModel:
# simulate bitslip
r = []
for i in range(len(s)-1):
v = (s[i+1] & (2**bitslip-1)) << (self.data_width-bitslip)
v |= (s[i] >> bitslip) & (2**(self.data_width-bitslip)-1)
v = (s[i+1] << self.data_width) | s[i]
v = v >> bitslip
v &= 2**self.data_width-1
r.append(v)
return r