From 1dcd2ac1c06ed97a09a4d4da498c7f1cf55201f8 Mon Sep 17 00:00:00 2001 From: Yves Delley Date: Wed, 9 Sep 2015 15:32:09 +0200 Subject: [PATCH] fixed bug in value_bits_sign of mul operatiors --- migen/fhdl/bitcontainer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migen/fhdl/bitcontainer.py b/migen/fhdl/bitcontainer.py index 381afc35..9763845f 100644 --- a/migen/fhdl/bitcontainer.py +++ b/migen/fhdl/bitcontainer.py @@ -50,13 +50,13 @@ def value_bits_sign(v): elif v.op == "*": if not obs[0][1] and not obs[1][1]: # both operands unsigned - return obs[0][0] + obs[1][0] + return obs[0][0] + obs[1][0], False elif obs[0][1] and obs[1][1]: # both operands signed - return obs[0][0] + obs[1][0] - 1 + return obs[0][0] + obs[1][0] - 1, True else: # one operand signed, the other unsigned (add sign bit) - return obs[0][0] + obs[1][0] + 1 - 1 + return obs[0][0] + obs[1][0] + 1 - 1, True elif v.op == "<<<": if obs[1][1]: extra = 2**(obs[1][0] - 1) - 1 -- 2.30.2