From: Manuel Penschuck Date: Tue, 2 Dec 2014 21:37:21 +0000 (+0100) Subject: CTS: ITC on input mux X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=639f1a439cae4020c90ce693b889b50e3d0d5aac;p=trb3.git CTS: ITC on input mux --- diff --git a/cts/source/cts_trigger.vhd b/cts/source/cts_trigger.vhd index 755457e..8409e5d 100755 --- a/cts/source/cts_trigger.vhd +++ b/cts/source/cts_trigger.vhd @@ -171,11 +171,18 @@ begin end process; proc_addon_mux: process(CLK_IN) is + variable sel : integer range 0 to 255; begin if rising_edge(CLK_IN) then - for i in 0 to TRIGGER_ADDON_COUNT - 1 loop - triggers_i(TRIGGER_INPUT_COUNT + i) - <= ADDON_TRIGGERS_IN( to_integer( UNSIGNED(trigger_addon_configs_i(i)) ) ); + for i in 0 to TRIGGER_ADDON_COUNT - 1 loop + sel := to_integer( UNSIGNED(trigger_addon_configs_i(i)) ); + + triggers_i(TRIGGER_INPUT_COUNT + i) <= '0'; + if sel <= ADDON_TRIGGERS_IN'HIGH then + triggers_i(TRIGGER_INPUT_COUNT + i) <= ADDON_TRIGGERS_IN( sel ); + elsif sel <= ADDON_TRIGGERS_IN'HIGH + 16 then + triggers_i(TRIGGER_INPUT_COUNT + i) <= channels_i(sel - ADDON_TRIGGERS_IN'HIGH - 1); + end if; end loop; end if; end process;