- data_bits = [0 if idx is None else pins[idx] for idx in data_indices]
- data_bits = data_bits[:num_item_bits]
- item = bitpack(data_bits)
- self.handle_bits(item, num_item_bits)
+ clock_edge = cond_idx_clock is not None and self.matched[cond_idx_clock]
+ data_edge = cond_idx_data_0 is not None and [idx for idx in range(cond_idx_data_0, cond_idx_data_N) if self.matched[idx]]
+ reset_edge = cond_idx_reset is not None and self.matched[cond_idx_reset]
+
+ if reset_edge:
+ in_reset = pins[Pin.RESET] == reset_active
+ if in_reset:
+ self.handle_bits(None, num_item_bits)
+ self.saved_item = None
+ self.saved_word = None
+ self.first = True
+ if in_reset:
+ continue
+
+ if clock_edge or data_edge:
+ data_bits = [0 if idx is None else pins[idx] for idx in data_indices]
+ data_bits = data_bits[:num_item_bits]
+ item = bitpack(data_bits)
+ self.handle_bits(item, num_item_bits)