---------------------------------------------------------------------------- -- Lawrence Berkeley National Laboratory (c) 1997 -- BaBar Trigger Electronics ---------------------------------------------------------------------------- -- Description: -- Driver for front panel LEDs. ---------------------------------------------------------------------------- -- Structure: -- LEDs are tristated to disable, low to enable. This prevents dim "glowing" -- of LEDs. ---------------------------------------------------------------------------- -- Author: Armin Karcher -- History: -- Karcher 03/97 - First Version -- Karcher 5-4-98 changed "lock; g_sync" polarity to reflect active low mode -- LeClerc 7-21-98 updated LEDs for DAQ format ---------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; ---------------------------------------------------------------------------- --PORT DECLARATION ---------------------------------------------------------------------------- entity gen_led is port( led : in std_logic_vector(3 downto 0); -- software LEDs op_mode : in std_logic; -- operation mode (run/non-run) daq_format : in std_logic_vector(1 downto 0); -- daq data format in_play_rec : in std_logic; -- input memory direction en_in_mem : in std_logic; -- input memory enable out_play_rec : in std_logic; -- output memory direction en_out_mem : in std_logic; -- output memory enable p_r_mode : in std_logic; -- play/record mode -- (single/continuous) lock : in std_logic; -- glink locked g_sync : in std_logic; -- glink synced o_mem_act : in std_logic; -- output memory active i_mem_act : in std_logic; -- input memory active soft_led : out std_logic_vector(3 downto 0); -- software LED out run_mode_led : out std_logic; -- run mode led non_run_mode_led : out std_logic; -- non run mode led raw_data_led : out std_logic; -- raw data format led one_word_data_led : out std_logic; -- one word data format two_word_data_led : out std_logic; -- two word data format in_play_rec_led : out std_logic; -- input mem. direction en_in_mem_led : out std_logic; -- input memory enable out_play_rec_led : out std_logic; -- output mem. direction en_out_mem_led : out std_logic; -- output memory enable single_mode_led : out std_logic; -- single mode led continuous_mode_led : out std_logic; -- continuous mode led glink_not_ready_led : out std_logic; -- glink not ready led glink_not_sync_led : out std_logic; -- glink not synced led i_mem_act_led : out std_logic; -- input memory active o_mem_act_led : out std_logic -- output memory active ); end gen_led; architecture rtl of gen_led is begin tri: process (led,op_mode,daq_format,in_play_rec,en_in_mem, out_play_rec,en_out_mem,p_r_mode,lock, g_sync,o_mem_act,i_mem_act) begin if (op_mode ='1') then run_mode_led <= '0'; else run_mode_led <= 'Z'; end if; if (op_mode ='0') then non_run_mode_led <= '0'; else non_run_mode_led <= 'Z'; end if; if ((daq_format ="00" ) or (daq_format ="01" )) then raw_data_led <= '0'; else raw_data_led <= 'Z'; end if; if (daq_format ="10") then one_word_data_led <= '0'; else one_word_data_led <= 'Z'; end if; if (daq_format ="11") then two_word_data_led <= '0'; else two_word_data_led <= 'Z'; end if; if (in_play_rec ='1') then in_play_rec_led <= '0'; else in_play_rec_led <= 'Z'; end if; if (en_in_mem ='1') then en_in_mem_led <= '0'; else en_in_mem_led <= 'Z'; end if; if (out_play_rec ='1') then out_play_rec_led <= '0'; else out_play_rec_led <= 'Z'; end if; if (en_out_mem ='1') then en_out_mem_led <= '0'; else en_out_mem_led <= 'Z'; end if; if (p_r_mode ='0') then single_mode_led <= '0'; else single_mode_led <= 'Z'; end if; if (p_r_mode ='1') then continuous_mode_led <= '0'; else continuous_mode_led <= 'Z'; end if; if (lock ='1') then -- lock is actually active low. glink_not_ready_led <= '0'; else glink_not_ready_led <= 'Z'; end if; if (g_sync ='1') then glink_not_sync_led <= '0'; else glink_not_sync_led <= 'Z'; end if; if (i_mem_act ='1') then i_mem_act_led <= '0'; else i_mem_act_led <= 'Z'; end if; if (o_mem_act ='1') then o_mem_act_led <= '0'; else o_mem_act_led <= 'Z'; end if; if (led(0) ='1') then soft_led(0) <= '0'; else soft_led(0) <= 'Z'; end if; if (led(1) ='1') then soft_led(1) <= '0'; else soft_led(1) <= 'Z'; end if; if (led(2) ='1') then soft_led(2) <= '0'; else soft_led(2) <= 'Z'; end if; if (led(3) ='1') then soft_led(3) <= '0'; else soft_led(3) <= 'Z'; end if; end process; end rtl;