From d213a628f831fa3fabc2e295251da034a9a16805 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 17 Jan 2017 14:35:34 +0100 Subject: [PATCH] test/test_bist: use generator to corrupt memory (allow testing base address on checker/generator) --- test/test_bist.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/test_bist.py b/test/test_bist.py index 1cec277..a9574d9 100755 --- a/test/test_bist.py +++ b/test/test_bist.py @@ -56,22 +56,18 @@ def main_generator(dut, mem): yield from checker.run(16, 64) assert checker.errors == 0 - # corrupt memory (4 errors) - for i in range(4): - mem.mem[i+16] = ~mem.mem[i+16] + # corrupt memory (using generator) + yield from generator.reset() + yield from generator.run(16 + 60, 64) # read (4 errors) yield from checker.reset() yield from checker.run(16, 64) assert checker.errors == 4 - # revert memory - for i in range(4): - mem.mem[i+16] = ~mem.mem[i+16] - # read (no errors) yield from checker.reset() - yield from checker.run(16, 64) + yield from checker.run(16 + 60, 64) assert checker.errors == 0