projects
/
ieee754fpu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
468cb68
)
store roundz test in comb variable
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Wed, 20 Feb 2019 00:45:56 +0000
(
00:45
+0000)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Wed, 20 Feb 2019 00:45:56 +0000
(
00:45
+0000)
src/add/fpbase.py
patch
|
blob
|
history
diff --git
a/src/add/fpbase.py
b/src/add/fpbase.py
index 1da10b0297b74548484bcd6ac7f7018283a99039..ee8857c8cea8a164fc79c3db8704b0fc8d4a6632 100644
(file)
--- a/
src/add/fpbase.py
+++ b/
src/add/fpbase.py
@@
-308,7
+308,9
@@
class FPBase:
""" performs rounding on the output. TODO: different kinds of rounding
"""
m.next = next_state
- with m.If(of.guard & (of.round_bit | of.sticky | z.m[0])):
+ roundz = Signal(reset_less=True)
+ m.d.comb += roundz.eq(of.guard & (of.round_bit | of.sticky | z.m[0]))
+ with m.If(roundz):
m.d.sync += z.m.eq(z.m + 1) # mantissa rounds up
with m.If(z.m == z.m1s): # all 1s
m.d.sync += z.e.eq(z.e + 1) # exponent rounds up