Add multiple match test
authorDaniel Benusovich <flyingmonkeys1996@gmail.com>
Sun, 10 Mar 2019 22:29:23 +0000 (15:29 -0700)
committerDaniel Benusovich <flyingmonkeys1996@gmail.com>
Sun, 10 Mar 2019 22:29:23 +0000 (15:29 -0700)
TLB/test/test_cam.py

index f7da12b1fe7364bafc40a0897114de25678be9ae..cbb06c108ec21c2b74db00e1e750341cd2fcb4b8 100644 (file)
@@ -140,6 +140,41 @@ def testbench(dut):
     yield from set_cam(dut, enable, write_enable, address, data)
     yield
     yield from check_single_match(dut, single_match, 0)
+    
+    # Multiple Match test
+    # Write Entry 1
+    enable = 1
+    write_enable = 1
+    address = 1
+    data = 5
+    multiple_match = 0
+    single_match = 0
+    yield from set_cam(dut, enable, write_enable, address, data)
+    yield
+    yield from check_single_match(dut, single_match, 0)    
+    
+    # Write Entry 2 
+    # Same data as Entry 1
+    enable = 1
+    write_enable = 1
+    address = 2
+    data = 5
+    multiple_match = 0
+    single_match = 0
+    yield from set_cam(dut, enable, write_enable, address, data)
+    yield
+    yield from check_single_match(dut, single_match, 0)      
+    
+    # Read Data 5
+    enable = 1
+    write_enable = 0
+    address = 1
+    data = 5
+    multiple_match = 1
+    single_match = 0
+    yield from set_cam(dut, enable, write_enable, address, data)
+    yield
+    yield from check_all(dut, multiple_match, single_match, address,0,0,0)      
 
     yield