]> jspc29.x-matter.uni-frankfurt.de Git - trb3.git/commitdiff
increase number of coincidences from 16 to 24 to cover all inputs
authorJan Michel <michel@physik.uni-frankfurt.de>
Thu, 15 Feb 2024 13:22:27 +0000 (14:22 +0100)
committerJan Michel <michel@physik.uni-frankfurt.de>
Thu, 15 Feb 2024 13:22:27 +0000 (14:22 +0100)
base/code/input_to_trigger_logic_record.vhd

index de8c913240c3642e4938b8ff489e71165b0ac678..4b05908a63b5c510b012ad589466606b4193166b 100644 (file)
@@ -70,9 +70,9 @@ signal set_output_mult      : stdvec7_arr;
 signal set_output_coin, set_output_simplecoin : std_logic_vector(7 downto 0);
 signal edge_enable  : std_logic_vector(7 downto 0) := (others => '0');
 
-type coincidence_arr is array(0 to 16) of integer range 0 to 63;
+type coincidence_arr is array(0 to 23) of integer range 0 to 63;
 signal coincidence_config_1, coincidence_config_2 : coincidence_arr;
-signal coincidence_enable : std_logic_vector(15 downto 0);
+signal coincidence_enable : std_logic_vector(23 downto 0);
 
 
 begin
@@ -120,10 +120,10 @@ begin
           when others => null;
         end case;          
       end if;  
-    elsif BUS_RX.addr(6 downto 4) = "100" then
-      coincidence_config_1(to_integer(unsigned(BUS_RX.addr(3 downto 0)))) <= to_integer(unsigned(BUS_RX.data(13 downto 8)));
-      coincidence_config_2(to_integer(unsigned(BUS_RX.addr(3 downto 0)))) <= to_integer(unsigned(BUS_RX.data(5 downto 0)));
-      coincidence_enable(to_integer(unsigned(BUS_RX.addr(3 downto 0))))   <= BUS_RX.data(31);
+    elsif BUS_RX.addr(6 downto 5) = "10" then
+      coincidence_config_1(to_integer(unsigned(BUS_RX.addr(4 downto 0)))) <= to_integer(unsigned(BUS_RX.data(13 downto 8)));
+      coincidence_config_2(to_integer(unsigned(BUS_RX.addr(4 downto 0)))) <= to_integer(unsigned(BUS_RX.data(5 downto 0)));
+      coincidence_enable(to_integer(unsigned(BUS_RX.addr(4 downto 0))))   <= BUS_RX.data(31);
     elsif BUS_RX.addr(6 downto 0) = "0110010" then
       set_multiplicity(0) <= unsigned(BUS_RX.data(23 downto 16));
       set_multiplicity(1) <= unsigned(BUS_RX.data(15 downto 8));
@@ -199,10 +199,10 @@ begin
         BUS_TX.ack <= '0';
         BUS_TX.unknown <= '1';
       end if;  
-    elsif BUS_RX.addr(6 downto 4) = "100" then
-      BUS_TX.data(13 downto 8) <= std_logic_vector(to_unsigned(coincidence_config_1(to_integer(unsigned(BUS_RX.addr(3 downto 0)))),6));
-      BUS_TX.data( 5 downto 0) <= std_logic_vector(to_unsigned(coincidence_config_2(to_integer(unsigned(BUS_RX.addr(3 downto 0)))),6));
-      BUS_TX.data(31)          <= coincidence_enable(to_integer(unsigned(BUS_RX.addr(3 downto 0))));
+    elsif BUS_RX.addr(6 downto 5) = "10" then
+      BUS_TX.data(13 downto 8) <= std_logic_vector(to_unsigned(coincidence_config_1(to_integer(unsigned(BUS_RX.addr(4 downto 0)))),6));
+      BUS_TX.data( 5 downto 0) <= std_logic_vector(to_unsigned(coincidence_config_2(to_integer(unsigned(BUS_RX.addr(4 downto 0)))),6));
+      BUS_TX.data(31)          <= coincidence_enable(to_integer(unsigned(BUS_RX.addr(4 downto 0))));
     elsif BUS_RX.addr(6 downto 0) = "0110000" then
       BUS_TX.data(OUTPUTS-1 downto 0) <= out_reg;
       BUS_TX.data(31 downto OUTPUTS)  <= (others => '0');
@@ -362,7 +362,7 @@ process(coincidence_config_1, coincidence_config_2, inp_verylong)
   variable t : std_logic;
 begin
   t := '0';
-  for i in 0 to 15 loop
+  for i in 0 to 23 loop
     t := t or (coincidence_enable(i) and inp_verylong(coincidence_config_1(i)) and inp_verylong(coincidence_config_2(i)));
   end loop;
   got_coincidence <= t;