TLB testbench WIP
authorTobias Platen <tplaten@posteo.de>
Sun, 21 Jul 2019 16:09:19 +0000 (18:09 +0200)
committerTobias Platen <tplaten@posteo.de>
Sun, 21 Jul 2019 16:09:19 +0000 (18:09 +0200)
src/TLB/TLB.py
src/TLB/test/test_tlb.py [new file with mode: 0644]

index 3538bdc1dcab904c0ea803fac903493939007852..f2b7a9250e1dd9d2daa37a9bd672f82a685c05be 100644 (file)
@@ -5,13 +5,13 @@
     * Tag (N - 79) / ASID (78 - 64) / PTE (63 - 0)
 """
 
-from nmigen import Memory, Module, Signal, Cat
+from nmigen import Memory, Module, Signal, Cat, Elaboratable
 from nmigen.cli import main
 
-from PermissionValidator import PermissionValidator
-from Cam import Cam
+from .PermissionValidator import PermissionValidator
+from .Cam import Cam
 
-class TLB():
+class TLB(Elaboratable):
     def __init__(self, asid_size, vma_size, pte_size, L1_size):
         """ Arguments
             * asid_size: Address Space IDentifier (ASID) typically 15 bits
diff --git a/src/TLB/test/test_tlb.py b/src/TLB/test/test_tlb.py
new file mode 100644 (file)
index 0000000..8e26130
--- /dev/null
@@ -0,0 +1,21 @@
+import tracemalloc
+
+tracemalloc.start()
+
+from nmigen.compat.sim import run_simulation
+
+from TLB.TLB import TLB
+
+from TestUtil.test_helper import assert_op
+
+def tbench(dut):
+    pass
+
+def test_tlb():
+    #FIXME UnusedElaboratable when the following line is uncommented
+    #dut = TLB(15,36,64,8)
+    #run_simulation(dut, tbench(dut), vcd_name="Waveforms/test_tlb.vcd")
+    print("TLB Unit Test TODO")
+
+if __name__ == "__main__":
+    test_tlb()