from nmigen.lib.coding import Decoder
from nmigen.cli import main #, verilog
-from CamEntry import CamEntry
-from AddressEncoder import AddressEncoder
+from .CamEntry import CamEntry
+from .AddressEncoder import AddressEncoder
+
class Cam():
""" Content Addressable Memory (CAM)
-import sys
-sys.path.append("../src")
-sys.path.append("../../TestUtil")
-
from nmigen.compat.sim import run_simulation
-from Cam import Cam
+from TLB.Cam import Cam
-from test_helper import assert_eq, assert_ne, assert_op
+from TestUtil.test_helper import assert_eq, assert_ne, assert_op
# This function allows for the easy setting of values to the Cam
# Arguments:
yield from check_single_match(dut, sm, sm_op)
yield from check_match_address(dut, ma, ma_op)
-def testbench(dut):
+def tbench(dut):
# NA
enable = 0
write_enable = 0
yield
-if __name__ == "__main__":
+def test_cam():
dut = Cam(4, 4)
- run_simulation(dut, testbench(dut), vcd_name="Waveforms/test_cam.vcd")
+ run_simulation(dut, tbench(dut), vcd_name="Waveforms/test_cam.vcd")
print("Cam Unit Test Success")
+
+if __name__ == "__main__":
+ test_cam()