projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe0b762
)
back.pysim: fix miscompilation of Signal(unsigned) - Signal(signed).
author
whitequark
<cz@m-labs.hk>
Mon, 2 Dec 2019 18:52:55 +0000
(18:52 +0000)
committer
whitequark
<cz@m-labs.hk>
Mon, 2 Dec 2019 18:52:55 +0000
(18:52 +0000)
nmigen/back/pysim.py
patch
|
blob
|
history
diff --git
a/nmigen/back/pysim.py
b/nmigen/back/pysim.py
index 6f905ffa71ba09357b2b24b84b7557c08ebc911a..b0449fe6f372a7e1556f5dd1e8a039ad9c22cd44 100644
(file)
--- a/
nmigen/back/pysim.py
+++ b/
nmigen/back/pysim.py
@@
-424,9
+424,9
@@
class _RHSValueCompiler(_ValueCompiler):
lhs_mask = (1 << len(lhs)) - 1
rhs_mask = (1 << len(rhs)) - 1
if value.operator == "+":
- return f"({
mask(lhs)} + {mask
(rhs)})"
+ return f"({
sign(lhs)} + {sign
(rhs)})"
if value.operator == "-":
- return f"({
mask(lhs)} - {mask
(rhs)})"
+ return f"({
sign(lhs)} - {sign
(rhs)})"
if value.operator == "*":
return f"({sign(lhs)} * {sign(rhs)})"
if value.operator == "//":