From: Jean THOMAS Date: Wed, 5 Aug 2020 12:54:30 +0000 (+0200) Subject: Add unit test for tXXDController X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e5f4e784e01bc1033cb06a7e7c6ee4c665396822;p=gram.git Add unit test for tXXDController --- diff --git a/gram/test/test_common.py b/gram/test/test_common.py index 7205478..f775ea1 100644 --- a/gram/test/test_common.py +++ b/gram/test/test_common.py @@ -17,6 +17,28 @@ class tXXDControllerTestCase(FHDLTestCase): generic_test(5) generic_test(10) + def test_delay(self): + def generic_test(txxd): + dut = tXXDController(txxd) + + yield dut.valid.eq(1) + yield; yield Delay(1e-8) + self.assertFalse((yield dut.ready)) + + yield dut.valid.eq(0) + + for i in range(txxd): + self.assertFalse((yield dut.ready)) + yield + + self.assertTrue((yield dut.ready)) + + runSimulation(dut, process, "test_common_txxdcontroller.vcd") + + generic_test(1) + generic_test(5) + generic_test(10) + class tFAWControllerTestCase(FHDLTestCase): def test_strobe_3(self): dut = tFAWController(10)