fix wb_get error where data was being corrupted
[soc.git] / src / soc / experiment / test / test_mmu_dcache_pi.py
index 46cc55719ec8b1074598ff9cb205502617dc5737..2f219e63ebbd91043a54f81d8f06f88e9eaf7939 100644 (file)
@@ -1,3 +1,9 @@
+"""MMU PortInterface Test
+
+quite basic, calls pi_ld to get data via PortInterface.  this test
+shouldn't really exist, it's superceded by test_ldst_pi.py
+"""
+
 from nmigen import (C, Module, Signal, Elaboratable, Mux, Cat, Repl, Signal)
 from nmigen.cli import main
 from nmigen.cli import rtlil
@@ -158,21 +164,22 @@ def wb_get(dc):
         if addr not in mem:
             print ("    WB LOOKUP NO entry @ %x, returning zero" % (addr))
 
-        data = mem.get(addr)
+        data = mem.get(addr, 0)
         yield dc.wb_in.dat.eq(data)
         print ("    DCACHE get %x data %x" % (addr, data))
         yield dc.wb_in.ack.eq(1)
         yield
         yield dc.wb_in.ack.eq(0)
+        yield
 
 
 def mmu_lookup(dut, addr):
     mmu = dut.mmu
     global stop
 
-    print("pi_st")
+    print("pi_ld")
     yield from pi_ld(dut.pi, addr, 1)
-    print("pi_st_done")
+    print("pi_ld done")
     """
     # original test code kept for reference
     while not stop: # wait for dc_valid / err