test/common: fix expected data for test_bist.py

Expected data needs to be replicated to fill given data_width.

Signed-off-by: Michal Sieron <msieron@antmicro.com>
This commit is contained in:
Michal Sieron 2023-01-11 17:13:52 +01:00
parent 73c3ec6b68
commit dad2c972f7
1 changed files with 15 additions and 0 deletions

View File

@ -354,6 +354,21 @@ class MemoryTestDataMixin:
) )
expected = data["32bit_long_sequential"]["expected"] expected = data["32bit_long_sequential"]["expected"]
expected[16//4:(16 + 64)//4] = list(range(64//4)) expected[16//4:(16 + 64)//4] = list(range(64//4))
lfsr_out_width = 31
# replicate LFSR output to fill the data_width
for test_case, config in data.items():
expected = config["expected"]
# extract data width from test case name
data_width = int(test_case.split("bit")[0])
for i, value in enumerate(expected):
for _ in range(data_width, lfsr_out_width - 1, -lfsr_out_width):
value |= value << lfsr_out_width
value &= (1 << data_width) - 1
expected[i] = value
return data return data
@property @property