semi-working after "hack" to reduce LHS of algorithm by fract_width
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 24 Jul 2019 10:13:19 +0000 (11:13 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 24 Jul 2019 10:13:19 +0000 (11:13 +0100)
src/ieee754/fpcommon/test/fpmux.py
src/ieee754/fpdiv/div0.py

index 4d2a3b2681facdbac4aef900bcf9d043f4827d32..ef0a2f33097e18e675b026e22b638b062708ba94 100644 (file)
@@ -170,6 +170,7 @@ def create_random(num_rows, width, single_op=False, n_vals=10):
                 #op1 = 0x4400
                 #op1 = 0x4800
                 #op1 = 0x48f0
+                #op1 = 0x429
 
                 vals.append((op1,))
             else:
index d09e80e0f470aa11f2f431921f569c231916f808..0c9ed334adc6b8a913a8e3f2de08e74d69182399 100644 (file)
@@ -118,11 +118,11 @@ class FPDivStage0Mod(Elaboratable):
             with m.Elif(self.i.ctx.op == 2):
                 am0 = Signal(len(self.i.a.m)+3, reset_less=True)
                 with m.If(self.i.a.e[0]):
-                    m.d.comb += am0.eq(Cat(self.i.a.m, 0)<<(extra-2))
-                    m.d.comb += self.o.z.e.eq(-((self.i.a.e+1) >> 1)+1)
+                    m.d.comb += am0.eq(Cat(self.i.a.m, 0)<<(extra-3))
+                    m.d.comb += self.o.z.e.eq(-((self.i.a.e+1) >> 1)+4)
                 with m.Else():
-                    m.d.comb += am0.eq(Cat(0, self.i.a.m)<<(extra-2))
-                    m.d.comb += self.o.z.e.eq((self.i.a.e >> 1)+1)
+                    m.d.comb += am0.eq(Cat(0, self.i.a.m)<<(extra-3))
+                    m.d.comb += self.o.z.e.eq((self.i.a.e >> 1)+2)
 
                 m.d.comb += [self.o.z.s.eq(self.i.a.s),
                              self.o.divisor_radicand.eq(am0),