From: Florent Kermarrec Date: Mon, 24 Apr 2017 19:41:46 +0000 (+0200) Subject: test: add test_gearbox skeleton X-Git-Tag: 24jan2021_ls180~1861 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ca0cb0ceaa5be0d8886d6f1d95fcbcedd13ba3e;p=litex.git test: add test_gearbox skeleton --- diff --git a/test/test_gearbox.py b/test/test_gearbox.py new file mode 100644 index 00000000..5e4c7863 --- /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)