From dad2c972f775d6c3c227a0a2cc88301ebcc66ebf Mon Sep 17 00:00:00 2001 From: Michal Sieron Date: Wed, 11 Jan 2023 17:13:52 +0100 Subject: [PATCH] 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 --- test/common.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/common.py b/test/common.py index 58f81d1..9e52aa3 100644 --- a/test/common.py +++ b/test/common.py @@ -354,6 +354,21 @@ class MemoryTestDataMixin: ) expected = data["32bit_long_sequential"]["expected"] 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 @property