---------------------------------------------------------------------------------- -- Company: -- Engineer: -- -- Create Date: 12:41:34 10/09/2006 -- Design Name: -- Module Name: chipscope_analyser - Behavioral -- Project Name: -- Target Devices: -- Tool versions: -- Description: -- -- Dependencies: -- -- Revision: -- Revision 0.01 - File Created -- Additional Comments: -- ---------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; ---- Uncomment the following library declaration if instantiating ---- any Xilinx primitives in this code. --library UNISIM; --use UNISIM.VComponents.all; entity chipscope_analyser is Port ( data_ch0 : in STD_LOGIC_VECTOR (95 downto 0); data_ch1 : in STD_LOGIC_VECTOR (47 downto 0); clk : in STD_LOGIC; reset : in std_logic; trig_ch0 : in STD_LOGIC_VECTOR (3 downto 0); trig_ch1 : in STD_LOGIC_VECTOR (3 downto 0); control_port_i : in STD_LOGIC_VECTOR (31 downto 0); async_port_i : in STD_LOGIC_VECTOR (31 downto 0); control_port_o : out STD_LOGIC_VECTOR (31 downto 0); data_alt_ch0 : in STD_LOGIC_VECTOR (95 downto 0); data_alt_ch1 : in STD_LOGIC_VECTOR (47 downto 0)); end chipscope_analyser; architecture Behavioral of chipscope_analyser is ------------------------------------------------------------------- -- -- ILA core signal declarations -- ------------------------------------------------------------------- signal control0 : std_logic_vector(35 downto 0); signal control1 : std_logic_vector(35 downto 0); signal control2 : std_logic_vector(35 downto 0); signal control3 : std_logic_vector(35 downto 0); signal data_2ch : std_logic_vector(47 downto 0); signal data_6ch : std_logic_vector(95 downto 0); signal timer : std_logic_vector(23 downto 0); signal analyser_control : std_logic_vector(31 downto 0); signal clk2, clk_en, ch_1_sel, ch_0_sel : std_logic; ------------------------------------------------------------------- -- -- ILA core component declaration -- ------------------------------------------------------------------- component ila_2CH port ( control : in std_logic_vector(35 downto 0); clk : in std_logic; data : in std_logic_vector(47 downto 0); trig0 : in std_logic_vector(3 downto 0) ); end component; ------------------------------------------------------------------- -- -- ILA core component declaration -- ------------------------------------------------------------------- component ila_6CH port ( control : in std_logic_vector(35 downto 0); clk : in std_logic; data : in std_logic_vector(95 downto 0); trig0 : in std_logic_vector(3 downto 0) ); end component; ------------------------------------------------------------------- -- -- ICON core component declaration -- ------------------------------------------------------------------- component icon port ( control0 : out std_logic_vector(35 downto 0); control1 : out std_logic_vector(35 downto 0); control2 : out std_logic_vector(35 downto 0); control3 : out std_logic_vector(35 downto 0) ); end component; ------------------------------------------------------------------- -- -- VIO core component declaration -- ------------------------------------------------------------------- component vio port ( control : in std_logic_vector(35 downto 0); async_in : in std_logic_vector(31 downto 0); async_out : out std_logic_vector(31 downto 0) ); end component; ------------------------------------------------------------------- -- -- VIO core component declaration -- ------------------------------------------------------------------- component vio_control port ( control : in std_logic_vector(35 downto 0); async_in : in std_logic_vector(31 downto 0); async_out : out std_logic_vector(31 downto 0) ); end component; begin --************************************************************************************************************** --**************************** CHIPSCOPE ********************************************** --************************************************************************************************************** ------------------------------------------------------------------- -- -- ICON core instance -- ------------------------------------------------------------------- i_icon : icon port map ( control0 => control0, control1 => control1, control2 => control2, control3 => control3 ); ------------------------------------------------------------------- -- -- VIO core instance -- ------------------------------------------------------------------- i_vio_control : vio_control port map ( control => control0, async_in => control_port_i, async_out => control_port_o ); ------------------------------------------------------------------- -- -- VIO core instance -- ------------------------------------------------------------------- i_vio : vio port map ( control => control1, async_in => async_port_i, async_out => analyser_control ); ch_1_sel <= analyser_control(24); ch_0_sel <= analyser_control(25); ------------------------------------------------------------------- -- -- ILA core instance -- ------------------------------------------------------------------- i_ila_6CH : ila_6CH port map ( control => control2, clk => clk, data => data_6ch, trig0 => trig_ch0 ); data_6ch <= data_ch0 when ch_0_sel = '0' else data_alt_ch0; ------------------------------------------------------------------- -- -- ILA core instance -- ------------------------------------------------------------------- i_ila_2CH : ila_2CH port map ( control => control3, clk => clk2, --clk2 data => data_2ch, trig0 => trig_ch1 ); data_2ch <= data_ch1 when ch_1_sel = '0' else data_alt_ch1; ------------------------------------------------------------------------------------------------------ --CLK2 generator ------------------------------------------------------------------------------------------------------ process(clk,reset,timer) begin if reset='1' then timer<=x"000100"; elsif clk'event and clk ='0' then if clk_en = '1' then timer <=analyser_control(23 downto 0); else timer <=timer-'1'; end if; end if; if timer = "000000" then clk_en<='1'; else clk_en<='0'; end if; end process; clk2<= clk_en; end Behavioral;