From f6f6c207b8c10815c440a65dacf5d3772a3fee2a Mon Sep 17 00:00:00 2001 From: Tobias Platen Date: Sat, 27 Nov 2021 13:54:22 +0100 Subject: [PATCH] loadstore testcase: read at random addresses --- src/soc/experiment/test/test_loadstore1.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/soc/experiment/test/test_loadstore1.py b/src/soc/experiment/test/test_loadstore1.py index 9b121d45..0a92620a 100644 --- a/src/soc/experiment/test/test_loadstore1.py +++ b/src/soc/experiment/test/test_loadstore1.py @@ -17,6 +17,7 @@ from soc.experiment.mmu import MMU from soc.experiment.test import pagetables from nmigen.compat.sim import run_simulation +from random import random stop = False @@ -190,6 +191,16 @@ def _test_loadstore1(dut, mem): print("ld_data",ld_data,exc) print("=== no error done ===") + # test read at random addresses + for i in range(0,40): + n = int(random()*0x100000) + addr = 0x10000 + n*16 + print("== random addr ==") + print("ld[RANDOM]",addr) + ld_data, exc = yield from pi_ld(pi, addr, 8, msr_pr=1) + print("ld_data[RANDOM]",ld_data,exc,addr) + assert(exc==None) + stop = True def test_loadstore1(): -- 2.30.2