From 639f1a439cae4020c90ce693b889b50e3d0d5aac Mon Sep 17 00:00:00 2001 From: Manuel Penschuck Date: Tue, 2 Dec 2014 22:37:21 +0100 Subject: [PATCH] CTS: ITC on input mux --- cts/source/cts_trigger.vhd | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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; -- 2.43.0