# Latches
a = FPNum(self.width)
b = FPNum(self.width)
- z = FPNum(self.width, 24)
+ z = FPNum(self.width, False)
tot = Signal(28) # sticky/round/guard bits, 23 result, 1 overflow
with m.FSM() as fsm:
- """
- always @(posedge clk)
+ with m.State("get_a"):
+ m.next += "get_b"
+ m.d.sync += s.in_a.ack.eq(1)
+ with m.If(s.in_a.ack & in_a.stb):
+ m.d.sync += [
+ a.eq(in_a),
+ s.in_a.ack(0)
+ ]
+
+ with m.State("get_b"):
+ m.next += "unpack"
+ m.d.sync += s.in_b.ack.eq(1)
+ with m.If(s.in_b.ack & in_b.stb):
+ m.d.sync += [
+ b.eq(in_b),
+ s.in_b.ack(0)
+ ]
+
+"""
+always @(posedge clk)
begin
case(state)
s_output_z_stb <= 0;
end
end
- """
\ No newline at end of file
+ """