]> jspc29.x-matter.uni-frankfurt.de Git - trb3.git/commitdiff
fix handling of non-existing counters on bus
authorJan Michel <j.michel@gsi.de>
Sat, 9 May 2020 13:52:23 +0000 (15:52 +0200)
committerJan Michel <j.michel@gsi.de>
Sat, 9 May 2020 13:52:23 +0000 (15:52 +0200)
base/code/input_statistics.vhd

index 6aa0bbe438ac0209a5975b3fffb4a9f4b6e09995..4ef7be87769dece66bc68dc7aec79c4f9564c611 100644 (file)
@@ -139,7 +139,7 @@ begin
       fifo_read(to_integer(unsigned(ADDR_IN(4 downto 0)))) <= '1';
       fifo_select <= to_integer(unsigned(ADDR_IN(4 downto 0)));
       fifo_wait <= '1';
-    elsif ADDR_IN(6) = '1' and tmp < INPUTS then
+    elsif ADDR_IN(6) = '1' and to_integer(unsigned(ADDR_IN(5 downto 0))) < INPUTS then
       DATA_OUT(23 downto 0) <= std_logic_vector(cnt(to_integer(unsigned(ADDR_IN(5 downto 0)))));
       ACK_OUT               <= '1';
     else