--==================================================================== -- IPBus access to a TCDS2 TTC2 stream. -- -- Corresponds to version 0 of the TTC2 protocol. --==================================================================== library ieee; use ieee.std_logic_1164.all; use work.ipbus.all; use work.ipbus_reg_types.all; use work.constants_tcds2.all; use work.tcds2_streams_pkg.all; entity tcds2_ttc2_spy is port ( -- The IPBus interface. clk_ipb : in std_logic; rst_ipb : in std_logic; ipb_in : in ipb_wbus; ipb_out : out ipb_rbus; -- The incoming TTC2 stream. stream_i : in tcds2_ttc2 ); end tcds2_ttc2_spy; architecture v0 of tcds2_ttc2_spy is signal stat : ipb_reg_v(6 downto 0); begin csr : entity work.ipbus_ctrlreg_v generic map ( N_CTRL => 0, N_STAT => 7 ) port map ( clk => clk_ipb, reset => rst_ipb, ipbus_in => ipb_in, ipbus_out => ipb_out, q => open, d => stat ); -- L1A flags. stat(0)(0) <= stream_i.l1a_types.l1a_physics; stat(0)(1) <= stream_i.l1a_types.l1a_calibration; stat(0)(2) <= stream_i.l1a_types.l1a_random; stat(0)(3) <= stream_i.l1a_types.l1a_software; stat(0)(4) <= stream_i.l1a_types.l1a_reserved_4; stat(0)(5) <= stream_i.l1a_types.l1a_reserved_5; stat(0)(6) <= stream_i.l1a_types.l1a_reserved_6; stat(0)(7) <= stream_i.l1a_types.l1a_reserved_7; stat(0)(8) <= stream_i.l1a_types.l1a_reserved_8; stat(0)(9) <= stream_i.l1a_types.l1a_reserved_9; stat(0)(10) <= stream_i.l1a_types.l1a_reserved_10; stat(0)(11) <= stream_i.l1a_types.l1a_reserved_11; stat(0)(12) <= stream_i.l1a_types.l1a_reserved_12; stat(0)(13) <= stream_i.l1a_types.l1a_reserved_13; stat(0)(14) <= stream_i.l1a_types.l1a_reserved_14; stat(0)(15) <= stream_i.l1a_types.l1a_reserved_15; -- Physics L1A sub-type. stat(1)(stream_i.physics_l1a_subtypes'range) <= stream_i.physics_l1a_subtypes; -- BRIL trigger data. stat(2)(stream_i.bril_trigger_data'range) <= stream_i.bril_trigger_data; -- Timing and synchronisation flags. stat(3) <= stream_i.sync_flags_and_commands(C_IPBUS_WORD_WIDTH - 1 downto 0); stat(4)(stream_i.sync_flags_and_commands'length - C_IPBUS_WORD_WIDTH - 1 downto 0) <= stream_i.sync_flags_and_commands(stream_i.sync_flags_and_commands'high downto C_IPBUS_WORD_WIDTH); -- Status flags. stat(5)(stream_i.status'range) <= stream_i.status; -- Left-overs. stat(6)(stream_i.reserved'range) <= stream_i.reserved; end v0; --====================================================================