sim._pyrtl: mask Mux selection operand.
Otherwise it behaves funny when it's eg. the result of operator ~.
This commit is contained in:
parent
adef3b2e7b
commit
44318149e0
2 changed files with 6 additions and 1 deletions
|
|
@ -186,6 +186,11 @@ class SimulatorUnitTestCase(FHDLTestCase):
|
|||
self.assertStatement(stmt, [C(2, 4), C(3, 4), C(0)], C(3, 4))
|
||||
self.assertStatement(stmt, [C(2, 4), C(3, 4), C(1)], C(2, 4))
|
||||
|
||||
def test_mux_invert(self):
|
||||
stmt = lambda y, a, b, c: y.eq(Mux(~c, a, b))
|
||||
self.assertStatement(stmt, [C(2, 4), C(3, 4), C(0)], C(2, 4))
|
||||
self.assertStatement(stmt, [C(2, 4), C(3, 4), C(1)], C(3, 4))
|
||||
|
||||
def test_abs(self):
|
||||
stmt = lambda y, a: y.eq(abs(a))
|
||||
self.assertStatement(stmt, [C(3, unsigned(8))], C(3, unsigned(8)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue