def __init__(self, pspec):
ZMAX = pspec.ZMAX
self.z0 = Signal(range(-ZMAX, ZMAX), name="z") # denormed result
+ self.ctx = FPPipeContext(pspec)
+ self.muxid = self.ctx.muxid
def __iter__(self):
yield self.z0
+ yield from self.ctx
def eq(self, i):
- return [self.z0.eq(i.z0)]
+ return [self.z0.eq(i.z0), self.ctx.eq(i.ctx)]
class CordicOutputData:
self.x = Signal(range(-M, M+1), name="x") # operand a
self.y = Signal(range(-M, M+1), name="y") # operand b
self.z = Signal(range(-ZMAX, ZMAX), name="z") # denormed result
+ self.ctx = FPPipeContext(pspec)
+ self.muxid = self.ctx.muxid
def __iter__(self):
yield self.x
yield self.y
yield self.z
+ yield from self.ctx
def eq(self, i):
- ret = [self.z.eq(i.z), self.x.eq(i.x), self.y.eq(i.y)]
+ ret = [self.z.eq(i.z), self.x.eq(i.x), self.y.eq(i.y),
+ self.ctx.eq(i.ctx)]
return ret
comb += numrec.m.eq(normalized[-(numrec.m_width+1):-1])
comb += numrec.s.eq(sign)
comb += numrec.e.eq(-count+1)
-
+
comb += self.sig_out.eq(numrec.create2(numrec.s, numrec.e, numrec.m))
return m
comb += self.o.x.eq(normx.sig_out)
comb += self.o.y.eq(normy.sig_out)
+ comb += self.o.ctx.eq(self.i.ctx)
return m
comb += self.o.x.eq(X0)
comb += self.o.y.eq(0)
comb += self.o.z.eq(self.i.z0)
+
+ comb += self.o.ctx.eq(self.i.ctx)
return m
comb += self.o.y.eq(self.i.y - dy)
comb += self.o.z.eq(self.i.z + dz)
+
+ comb += self.o.ctx.eq(self.i.ctx)
return m