From a7e139ffa709995dc16dd7eccc7ca4b9c0f2ef11 Mon Sep 17 00:00:00 2001 From: Tobias Platen Date: Wed, 24 Feb 2021 19:43:23 +0100 Subject: [PATCH] wb_get: write outputs to seperate logfile too --- src/soc/experiment/test/test_mmu_dcache.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/soc/experiment/test/test_mmu_dcache.py b/src/soc/experiment/test/test_mmu_dcache.py index d7b65cec..67ce6258 100644 --- a/src/soc/experiment/test/test_mmu_dcache.py +++ b/src/soc/experiment/test/test_mmu_dcache.py @@ -57,14 +57,17 @@ def wb_get(c, mem, name): """simulator process for getting memory load requests """ - global stop - + logfile = open("/tmp/wb_get.log","w") - mem = mem + def log(msg): + logfile.write(msg+"\n") + print(msg) + global stop while not stop: while True: # wait for dc_valid if stop: + log("stop") return cyc = yield (c.wb_out.cyc) stb = yield (c.wb_out.stb) @@ -73,14 +76,14 @@ def wb_get(c, mem, name): yield addr = (yield c.wb_out.adr) << 3 if addr not in mem: - print (" %s LOOKUP FAIL %x" % (name, addr)) + log("%s LOOKUP FAIL %x" % (name, addr)) stop = True return yield data = mem[addr] yield c.wb_in.dat.eq(data) - print (" %s get %x data %x" % (name, addr, data)) + log("%s get %x data %x" % (name, addr, data)) yield c.wb_in.ack.eq(1) yield yield c.wb_in.ack.eq(0) -- 2.30.2