projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f4dd10
)
hdl.ast: implement shape for modulo operator.
author
whitequark
<cz@m-labs.hk>
Sat, 19 Jan 2019 09:26:26 +0000
(09:26 +0000)
committer
whitequark
<cz@m-labs.hk>
Sat, 19 Jan 2019 09:27:56 +0000
(09:27 +0000)
nmigen/hdl/ast.py
patch
|
blob
|
history
diff --git
a/nmigen/hdl/ast.py
b/nmigen/hdl/ast.py
index b330cb332a070f68c18f6113c9ae518d5e4d4e47..6e2155e7d178fb7a73249fce35625792519e9047 100644
(file)
--- a/
nmigen/hdl/ast.py
+++ b/
nmigen/hdl/ast.py
@@
-341,6
+341,8
@@
class Operator(Value):
return a_bits + b_bits - 1, True
# one operand signed, the other unsigned (add sign bit)
return a_bits + b_bits + 1 - 1, True
+ if self.op == "%":
+ return a_bits, a_sign
if self.op in ("<", "<=", "==", "!=", ">", ">=", "b"):
return 1, False
if self.op in ("&", "^", "|"):