--====================================================================== -- An IPBus spy interface on the full TCDS2 serial frame. --====================================================================== library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use work.ipbus.all; use work.ipbus_reg_types.all; use work.constants_tcds2.all; use work.tcds2_link_pkg.all; --================================================== entity tcds2_frame_spy is port ( clk_ipb : in std_logic; rst_ipb : in std_logic; ipb_in : in ipb_wbus; ipb_out : out ipb_rbus; frame_i : in tcds2_frame_t ); end tcds2_frame_spy; --================================================== architecture arch of tcds2_frame_spy is signal stat_spy : ipb_reg_v(7 downto 0); begin csr_spy : entity work.ipbus_ctrlreg_v generic map ( N_CTRL => 0, N_STAT => 8 ) port map ( clk => clk_ipb, reset => rst_ipb, ipbus_in => ipb_in, ipbus_out => ipb_out, q => open, d => stat_spy ); stat_spy_assign_0 : for i in 0 to ((C_TCDS2_FRAME_WIDTH / C_IPBUS_WORD_WIDTH) - 1) generate stat_spy(i) <= frame_i(((i + 1) * C_IPBUS_WORD_WIDTH - 1) downto (i * C_IPBUS_WORD_WIDTH)); end generate; stat_spy_assign_1 : if ((C_TCDS2_FRAME_WIDTH rem C_IPBUS_WORD_WIDTH) /= 0) generate stat_spy(C_TCDS2_FRAME_WIDTH / C_IPBUS_WORD_WIDTH) <= std_logic_vector(resize(unsigned(frame_i(C_TCDS2_FRAME_WIDTH - 1 downto (C_TCDS2_FRAME_WIDTH / C_IPBUS_WORD_WIDTH) * C_IPBUS_WORD_WIDTH)), C_IPBUS_WORD_WIDTH)); end generate; end arch; --======================================================================