0x1000000: # PROCESS_TABLE_3
# RTS1 = 0x2 RPDB = 0x300 RTS2 = 0x5 RPDS = 13
b(0x40000000000300ad),
+
+ # data to return
+ 0x1000: 0xdeadbeef01234567,
+ 0x1008: 0xfeedf00ff001a5a5
}
while not stop:
yield wb.ack.eq(1)
yield
yield wb.ack.eq(0)
+ yield
def mmu_lookup(dut, addr):
mmu = dut.submodules.mmu
global stop
- print("pi_ld")
- yield from pi_ld(dut.submodules.ldst.pi, addr, 1, msr_pr=1)
- print("pi_ld done")
+ print("pi_ld", hex(addr))
+ data = yield from pi_ld(dut.submodules.ldst.pi, addr, 4, msr_pr=1)
+ print("pi_ld done, data", hex(data))
"""
# original test code kept for reference
while not stop: # wait for dc_valid / err
yield
yield mmu.l_in.valid.eq(0)
- return phys_addr
+ return data
def ldst_sim(dut):
yield mmu.rin.prtbl.eq(0x1000000) # set process table
yield
- addr = 0x10000
- data = 0
- print("pi_st")
+ # expecting this data to return
+ # 0x1000: 0xdeadbeef01234567,
+ # 0x1008: 0xfeedf00ff001a5a5
+
+ addr = 0x1000
+ print("pi_ld")
# TODO mmu_lookup using port interface
# set inputs
- phys_addr = yield from mmu_lookup(dut, 0x10000)
- assert phys_addr == 0x40000
+ data = yield from mmu_lookup(dut, addr)
+ assert data == 0x1234567
- phys_addr = yield from mmu_lookup(dut, 0x10000)
- assert phys_addr == 0x40000
+ data = yield from mmu_lookup(dut, addr+8)
+ assert data == 0xf001a5a5
+ #assert phys_addr == addr # happens to be the same (for this example)
+
+ data = yield from mmu_lookup(dut, addr+4)
+ assert data == 0xdeadbeef
+
+ data = yield from mmu_lookup(dut, addr+8)
+ assert data == 0xf001a5a5
+
+ yield
+ yield
stop = True
pspec = TestMemPspec(ldst_ifacetype='mmu_cache_wb',
imem_ifacetype='',
addr_wid=48,
+ #disable_cache=True, # hmmm...
mask_wid=8,
reg_wid=64)