From: Cesar Strauss Date: Sat, 23 Jan 2021 20:58:41 +0000 (-0300) Subject: Convert all bitwise logical ops to return PartitionedSignal X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=67e9addf33eb9ffaf4383f9e7ca0e860f644e5f9;p=ieee754fpu.git Convert all bitwise logical ops to return PartitionedSignal --- diff --git a/src/ieee754/part/partsig.py b/src/ieee754/part/partsig.py index 24fd80d4..5d96a27a 100644 --- a/src/ieee754/part/partsig.py +++ b/src/ieee754/part/partsig.py @@ -34,7 +34,12 @@ def getsig(op1): def applyop(op1, op2, op): - return op(getsig(op1), getsig(op2)) + if isinstance(op1, PartitionedSignal): + result = PartitionedSignal.like(op1) + else: + result = PartitionedSignal.like(op2) + result.m.d.comb += result.sig.eq(op(getsig(op1), getsig(op2))) + return result class PartitionedSignal: