switch to exact version of cython
[ieee754fpu.git] / src / ieee754 / fpcommon / postcalc.py
1 # IEEE Floating Point Adder (Single Precision)
2 # Copyright (C) Jonathan P Dawson 2013
3 # 2013-12-12
4
5 from nmigen import Signal
6 from ieee754.fpcommon.fpbase import Overflow, FPNumBaseRecord
7 from ieee754.fpcommon.getop import FPPipeContext
8
9
10 class FPPostCalcData:
11
12 def __init__(self, pspec, e_extra=False):
13 width = pspec.width
14 self.z = FPNumBaseRecord(width, False, e_extra, name="z")
15 self.out_do_z = Signal(reset_less=True)
16 self.oz = Signal(width, reset_less=True)
17 self.of = Overflow()
18 self.ctx = FPPipeContext(pspec)
19 self.muxid = self.ctx.muxid
20
21 def __iter__(self):
22 yield from self.z
23 yield self.out_do_z
24 yield self.oz
25 yield from self.of
26 yield from self.ctx
27
28 def eq(self, i):
29 return [self.z.eq(i.z), self.out_do_z.eq(i.out_do_z), self.oz.eq(i.oz),
30 self.of.eq(i.of), self.ctx.eq(i.ctx)]