from nmigen import Module, Signal
from nmigen.cli import main
-from PteEntry import PteEntry
+from .PteEntry import PteEntry
class PermissionValidator():
""" The purpose of this Module is to check the Permissions of a given PTE
m.d.comb += self.valid.eq(0)
with m.Else():
m.d.comb += self.valid.eq(0)
- return m
\ No newline at end of file
+ return m
-import sys
-sys.path.append("../src")
-sys.path.append("../../TestUtil")
-
from nmigen.compat.sim import run_simulation
-from PermissionValidator import PermissionValidator
+from TLB.PermissionValidator import PermissionValidator
+
+from TestUtil.test_helper import assert_op
-from test_helper import assert_op
def set_validator(dut, d, xwr, sm, sa, asid):
yield dut.data.eq(d)
out_v = yield dut.valid
assert_op("Valid", out_v, v, op)
-def testbench(dut):
+def tbench(dut):
# 80 bits represented. Ignore the MSB as it will be truncated
# ASID is bits first 4 hex values (bits 64 - 78)
yield from set_validator(dut, data, xwr, super_mode, super_access, asid)
yield from check_valid(dut, valid, 0)
-if __name__ == "__main__":
+
+def test_permv():
dut = PermissionValidator(15, 64);
- run_simulation(dut, testbench(dut), vcd_name="Waveforms/test_permission_validator.vcd")
+ run_simulation(dut, tbench(dut), vcd_name="Waveforms/test_permission_validator.vcd")
print("PermissionValidator Unit Test Success")
+
+if __name__ == "__main__":
+ test_permv()