projects
/
ieee754fpu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a91387d
)
Convert all bitwise logical ops to return PartitionedSignal
author
Cesar Strauss
<cestrauss@gmail.com>
Sat, 23 Jan 2021 20:58:41 +0000
(17:58 -0300)
committer
Cesar Strauss
<cestrauss@gmail.com>
Sat, 23 Jan 2021 21:02:36 +0000
(18:02 -0300)
src/ieee754/part/partsig.py
patch
|
blob
|
history
diff --git
a/src/ieee754/part/partsig.py
b/src/ieee754/part/partsig.py
index 24fd80d4cb7985588a134a8789a1b2add2d480dd..5d96a27a7a22201c9b525577c08b1c7752793f2d 100644
(file)
--- 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: