From: Tobias Platen Date: Wed, 24 Feb 2021 18:43:23 +0000 (+0100) Subject: wb_get: write outputs to seperate logfile too X-Git-Tag: convert-csv-opcode-to-binary~158 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a7e139ffa709995dc16dd7eccc7ca4b9c0f2ef11;p=soc.git wb_get: write outputs to seperate logfile too --- 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)