From: Luke Kenneth Casson Leighton Date: Thu, 18 Apr 2019 10:20:33 +0000 (+0100) Subject: use of plru starts to make sense, must set vpn == vaddr_i>>12 X-Git-Tag: div_pipeline~2223 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=46ce5e80ecce61130ec1822970727bd65ebe9aa9;p=soc.git use of plru starts to make sense, must set vpn == vaddr_i>>12 --- diff --git a/TLB/src/ariane/test_tlb.py b/TLB/src/ariane/test_tlb.py index 87cb3216..2ef887c1 100644 --- a/TLB/src/ariane/test_tlb.py +++ b/TLB/src/ariane/test_tlb.py @@ -2,6 +2,10 @@ from nmigen.compat.sim import run_simulation from tlb import TLB +def set_vaddr(addr): + yield dut.lu_vaddr_i.eq(addr) + yield dut.update_i.vpn.eq(addr>>12) + def testbench(dut): yield dut.lu_access_i.eq(1) @@ -18,21 +22,43 @@ def testbench(dut): yield - yield dut.lu_vaddr_i.eq(0x80000) - yield dut.update_i.vpn.eq(0x80000) + addr = 0x80000 + yield from set_vaddr(addr) + yield + + addr = 0x90001 + yield from set_vaddr(addr) + yield + + addr = 0x28000000 + yield from set_vaddr(addr) yield - yield dut.lu_vaddr_i.eq(0x280000) - yield dut.update_i.vpn.eq(0x280000) + addr = 0x28000001 + yield from set_vaddr(addr) + + addr = 0x28000001 + yield from set_vaddr(addr) yield - yield dut.lu_vaddr_i.eq(0x040000) - yield dut.update_i.vpn.eq(0x040000) + addr = 0x1000040000 + yield from set_vaddr(addr) + yield + + addr = 0x1000040001 + yield from set_vaddr(addr) yield yield dut.update_i.is_1G.eq(1) - yield dut.lu_vaddr_i.eq(0x2040000) - yield dut.update_i.vpn.eq(0x02040000) + addr = 0x2040000 + yield from set_vaddr(addr) + yield + + yield dut.update_i.is_1G.eq(1) + addr = 0x2040001 + yield from set_vaddr(addr) + yield + yield