- # else stay in idle condition (output ready, but input wasn't valid)
-
- # output valid but not ready, and input is ready
- with self.m.Elif(o_n_valid_i_n_ready):
- # output transaction just took place
- self.m.d.sync += [r_busy.eq(0),
- self.n.o_valid.eq(0), # set output invalid
- ]
- #
- with self.m.Elif(o_n_validn):
- # can check here for data valid
- self.m.d.sync += [self.n.o_valid.eq(1),
- #eq(self.n.o_data, result), # update output
- ]
-
- #self.m.d.comb += self.p._o_ready.eq(~r_busy)
- self.m.d.comb += self.p._o_ready.eq(~(((~n_i_ready)&(self.n.o_valid))| \
- (r_busy)))
+ # previous invalid or not ready, however next is accepting
+ with self.m.Elif(n_i_ready):
+ # TODO: could still send data here (if there was any)
+ self.m.d.sync += self.n.o_valid.eq(0), # ...so set output invalid
+
+ # if next is ready, so is previous
+ self.m.d.comb += self.p._o_ready.eq(n_i_ready)
+