]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/lx-rocon.git/commitdiff
IRC inputs: fix problem when index is reported to MCU before value update.
authorPavel Pisa <ppisa@pikron.com>
Sat, 21 Feb 2015 22:10:58 +0000 (23:10 +0100)
committerPavel Pisa <ppisa@pikron.com>
Sat, 21 Feb 2015 22:10:58 +0000 (23:10 +0100)
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
hw/qcounter.vhd

index 6dca87c0afdf654368c6c28a979fcfeaa2c49c09..4ef4ded68c02a8dc33472084567cf1bb1f2bbf51 100644 (file)
@@ -153,23 +153,13 @@ seq:
                                index_event_v     := '1';
                        end if;
                        --
-                       if reset_index_event_i = '1' then
-                               index_event_int_s <= '0';
-                       else
-                               index_event_int_s <= index_event_int_s or index_event_v;
-                       end if;
+                       index_event_int_s <= (index_event_int_s and not reset_index_event_i) or
+                                            index_event_v;
                        --
-                       if reset_index_event2_i = '1' then
-                               index_event2_int_s <= '0';
-                       else
-                               index_event2_int_s <= index_event2_int_s or index_event_v;
-                       end if;
+                       index_event2_int_s <= (index_event2_int_s and not reset_index_event2_i) or
+                                             reset_index_event_i;
                        --
-                       if reset_ab_error_i = '1' then
-                               ab_error_int_s    <= '0';
-                       else
-                               ab_error_int_s    <= ab_error_int_s or ab_error_s;
-                       end if;
+                       ab_error_int_s    <= (ab_error_int_s and not reset_ab_error_i) or ab_error_s;
                        --
                        count_prev_s        <= count_s;
                        index_prev_s        <= index_s;