From 8a4080ee463735f59ae2891ab9b488ac86ec8cef Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Fri, 24 Jul 2020 16:34:58 +0200 Subject: [PATCH] Add test for tFAWController --- gram/test/test_common.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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") -- 2.30.2