for curr_stem, next_stem in \ itertools.pairwise(itertools.chain(["START", range(8), "STOP"])): with m.State(f"NEGEDGE_{curr_stem}"): with m.If(rx_posedge): m.next = f"SAW_POSEDGE_AT_{curr_stem}" with m.If(self.next_bit): m.next = f"NEGEDGE_{next_stem}" with m.If(rx_posedge): m.next = f"SAW_POSEDGE_AT_{next_stem}"