projects
/
ieee754fpu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use ispec and ospec in FPNormaliseModSingle
[ieee754fpu.git]
/
src
/
add
/
nmigen_add_experiment.py
diff --git
a/src/add/nmigen_add_experiment.py
b/src/add/nmigen_add_experiment.py
index bc5f6415c966f5cbbe1d84ad5c93e32b15596bd8..5d5a9933250434778592112bfa7bed17c5ed96f1 100644
(file)
--- a/
src/add/nmigen_add_experiment.py
+++ b/
src/add/nmigen_add_experiment.py
@@
-928,8
+928,14
@@
class FPNormaliseModSingle:
def __init__(self, width):
self.width = width
def __init__(self, width):
self.width = width
- self.in_z = FPNumBase(width, False)
- self.out_z = FPNumBase(width, False)
+ self.in_z = self.ispec()
+ self.out_z = self.ospec()
+
+ def ispec(self):
+ return FPNumBase(self.width, False)
+
+ def ospec(self):
+ return FPNumBase(self.width, False)
def setup(self, m, in_z, out_z, modname):
""" links module to inputs and outputs
def setup(self, m, in_z, out_z, modname):
""" links module to inputs and outputs
@@
-963,7
+969,7
@@
class FPNormaliseModSingle:
# initialise out from in (overridden below)
m.d.comb += self.out_z.eq(in_z)
m.d.comb += self.out_of.eq(in_of)
# initialise out from in (overridden below)
m.d.comb += self.out_z.eq(in_z)
m.d.comb += self.out_of.eq(in_of)
- # normalisation
increase/decrease conditions
+ # normalisation
decrease condition
decrease = Signal(reset_less=True)
m.d.comb += decrease.eq(in_z.m_msbzero)
# decrease exponent
decrease = Signal(reset_less=True)
m.d.comb += decrease.eq(in_z.m_msbzero)
# decrease exponent