4 from migen
.test
.support
import SimCase
7 class ConstantCase(SimCase
, unittest
.TestCase
):
8 class TestBench(Module
):
11 (Signal(3), Constant(0), 0),
12 (Signal(3), Constant(5), 5),
13 (Signal(3), Constant(1, 2), 1),
14 (Signal(3), Constant(-1, 7), 7),
15 (Signal(3), Constant(0b10101)[:3], 0b101),
16 (Signal(3), Constant(0b10101)[1:4], 0b10),
18 self
.comb
+= [a
.eq(b
) for a
, b
, c
in self
.sigs
]
20 def test_comparisons(self
):
22 for s
, l
, v
in self
.tb
.sigs
:
26 "got {}, want {} from literal {}".format(