From 3ca0cb0ceaa5be0d8886d6f1d95fcbcedd13ba3e Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 24 Apr 2017 21:41:46 +0200 Subject: [PATCH] test: add test_gearbox skeleton --- test/test_gearbox.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/test_gearbox.py diff --git a/test/test_gearbox.py b/test/test_gearbox.py new file mode 100644 index 000000000..5e4c78630 --- /dev/null +++ b/test/test_gearbox.py @@ -0,0 +1,33 @@ +import unittest +import random + +from litex.gen import * +from litex.gen.genlib.cdc import Gearbox + +# TODO: +# connect two gearbox together: +# first gearbox: iwidth > owidth +# second gearbox: iwidth < owidth +# use 2 clock domains +# compare input data to output data, should be similar +# various datawidth/clock ratios + +def source_generator(dut): + yield + + +def sink_generator(duc): + yield + + +class GearboxDUT(Module): + def __init__(self): + self.submodules.gearbox_down = Gearbox(10, "slow", 8, "fast") + self.submodules.gearbox_up = Gearbox(8, "fast", 10, "slow") + self.comb += self.gearbox_up.i.eq(self.gearbox_down.o) + self.i, self.o = self.gearbox_down.i, self.gearbox_up.o + + +class TestGearbox(unittest.TestCase): + def test_gearbox(self): + self.assertEqual(0, 0)