test: add test_gearbox skeleton

This commit is contained in:
Florent Kermarrec 2017-04-24 21:41:46 +02:00
parent b4ebfb4031
commit 3ca0cb0cea
1 changed files with 33 additions and 0 deletions

33
test/test_gearbox.py Normal file
View File

@ -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)