def _is_denormalised(self):
return (self.exp_n126) & (self.m_msbzero)
- def copy(self, inp):
+ def eq(self, inp):
return [self.s.eq(inp.s), self.e.eq(inp.e), self.m.eq(inp.m)]
m.d.comb += self.trigger.eq(self.stb & self.ack)
return m
- def copy(self, inp):
+ def eq(self, inp):
return [self.stb.eq(inp.stb),
self.ack.eq(inp.ack)
]
in_op.ack.eq(self.ack), # send ACK
]
- def copy(self, inp):
+ def eq(self, inp):
return [self.v.eq(inp.v),
self.stb.eq(inp.stb),
self.ack.eq(inp.ack)
self.roundz = Signal(reset_less=True)
- def copy(self, inp):
+ def eq(self, inp):
return [self.guard.eq(inp.guard),
self.round_bit.eq(inp.round_bit),
self.sticky.eq(inp.sticky),
with m.Else():
m.next = next_state
- def roundz(self, m, z, of):
+ def roundz(self, m, z, roundz):
""" performs rounding on the output. TODO: different kinds of rounding
"""
- with m.If(of.guard & (of.round_bit | of.sticky | z.m[0])):
+ with m.If(roundz):
m.d.sync += z.m.eq(z.m + 1) # mantissa rounds up
with m.If(z.m == z.m1s): # all 1s
m.d.sync += z.e.eq(z.e + 1) # exponent rounds up