Add test for tFAWController
authorJean THOMAS <git0@pub.jeanthomas.me>
Fri, 24 Jul 2020 14:34:58 +0000 (16:34 +0200)
committerJean THOMAS <git0@pub.jeanthomas.me>
Fri, 24 Jul 2020 14:34:58 +0000 (16:34 +0200)
gram/test/test_common.py

index f8387f26e465c127210b23e3b259f6c5ae0eb908..385282c613c50d5d4be385746677b685c4aee1a6 100644 (file)
@@ -2,7 +2,7 @@
 from nmigen import *
 from nmigen.hdl.ast import Past
 
-from gram.common import tXXDController
+from gram.common import tXXDController, tFAWController
 from utils import *
 
 class tXXDControllerTestCase(FHDLTestCase):
@@ -15,4 +15,21 @@ class tXXDControllerTestCase(FHDLTestCase):
         generic_test(0)
         generic_test(1)
         generic_test(5)
-        generic_test(10)
\ No newline at end of file
+        generic_test(10)
+
+class tFAWControllerTestCase(FHDLTestCase):
+    def test_strobe_3(self):
+        dut = tFAWController(10)
+        def process():
+            yield dut.valid.eq(1)
+            
+            for i in range(3):
+                self.assertTrue((yield dut.ready))
+                yield
+
+            yield dut.valid.eq(0)
+            yield
+
+            self.assertFalse((yield dut.valid))
+
+        runSimulation(dut, process, "test_common.vcd")