From: Sebastien Bourdeauducq Date: Thu, 17 Sep 2015 09:22:59 +0000 (+0800) Subject: test/coding: use new API X-Git-Tag: 24jan2021_ls180~2099^2~3^2~78 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4a3a1bc5b0c0476ad62223e5e41f06e2167e67c7;p=litex.git test/coding: use new API --- diff --git a/migen/test/test_coding.py b/migen/test/test_coding.py index 4cbca178..965a7e97 100644 --- a/migen/test/test_coding.py +++ b/migen/test/test_coding.py @@ -3,11 +3,11 @@ import unittest from migen import * from migen.genlib.coding import * -from migen.test.support import SimCase, SimBench +from migen.test.support import SimCase class EncCase(SimCase, unittest.TestCase): - class TestBench(SimBench): + class TestBench(Module): def __init__(self): self.submodules.dut = Encoder(8) @@ -18,18 +18,20 @@ class EncCase(SimCase, unittest.TestCase): def test_run_sequence(self): seq = list(range(1<<8)) - def cb(tb, tbp): - if seq: - tbp.dut.i = seq.pop(0) - if tbp.dut.n: - self.assertNotIn(tbp.dut.i, [1< 0: - self.assertEqual(i & 1<<(o - 1), 0) - self.assertGreaterEqual(i, 1< 0: + self.assertEqual(i & 1<<(o - 1), 0) + self.assertGreaterEqual(i, 1< 0: - self.assertEqual(i & 1<<(o - 1), 0) - self.assertGreaterEqual(i, 1< 0: + self.assertEqual(i & 1<<(o - 1), 0) + self.assertGreaterEqual(i, 1<