split out adder code (PartitionedAdder) into module, PartitionPoints too
[ieee754fpu.git] / src / ieee754 / fpadd / datastruct.py
1 """IEEE754 Floating Point Adder Pipeline
2
3 Copyright (C) 2019 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
4
5 """
6
7 from nmigen import Module, Signal
8
9 from ieee754.fpcommon.fpbase import FPNumBaseRecord
10 from ieee754.fpcommon.getop import FPPipeContext
11
12
13 class FPAddStage0Data:
14
15 def __init__(self, pspec):
16 width = pspec.width
17 self.z = FPNumBaseRecord(width, False)
18 self.out_do_z = Signal(reset_less=True)
19 self.oz = Signal(width, reset_less=True)
20 self.tot = Signal(self.z.m_width + 4, reset_less=True) # 4 extra bits
21 self.ctx = FPPipeContext(pspec)
22 self.muxid = self.ctx.muxid
23
24 def eq(self, i):
25 return [self.z.eq(i.z), self.out_do_z.eq(i.out_do_z), self.oz.eq(i.oz),
26 self.tot.eq(i.tot), self.ctx.eq(i.ctx)]