From: Jean THOMAS Date: Fri, 24 Jul 2020 14:34:58 +0000 (+0200) Subject: Add test for tFAWController X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8a4080ee463735f59ae2891ab9b488ac86ec8cef;p=gram.git Add test for tFAWController --- diff --git a/gram/test/test_common.py b/gram/test/test_common.py index f8387f2..385282c 100644 --- a/gram/test/test_common.py +++ b/gram/test/test_common.py @@ -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")