);
end component;
- component dcs is
--- synthesis translate_off
- generic ( DCSMODE : string := "POS" );
--- synthesis translate_on
- port( CLK0 : in std_logic;
- CLK1 : in std_logic;
- SEL : in std_logic;
- DCSOUT : out std_logic
- );
- end component;
-
- -- taken from HB1003.pdf, DCS section page 10-34
- attribute DCSMODE : string;
- attribute DCSMODE of THE_DCS : label is "POS";
-
component signal_sync is
generic(
WIDTH : integer := 1; --
);
end component;
- signal dcs_clk : std_logic; -- DCS output
- signal dcs_clk_0 : std_logic;
- signal dcs_clk_1 : std_logic;
- signal dcs_select : std_logic;
- signal flip_flop : std_logic;
-
signal refck2core : std_logic;
--reset signals
signal ffc_quad_rst : std_logic;
signal led_counter : std_logic_vector(17 downto 0);
signal rx_led, tx_led : std_logic;
- signal comb_rx_k : std_logic_vector(1 downto 0);
- signal comb_rx_data : std_logic_vector(15 downto 0);
-
begin
--------------------------------------------------------------------------
D_OUT => rx_k_q
);
-THE_RX_SYNC: signal_sync
- generic map(
- DEPTH => 2,
- WIDTH => 18
- )
- port map(
- RESET => RESET,
- D_IN(15 downto 0) => comb_rx_data,
- D_IN(17 downto 16) => comb_rx_k,
- CLK0 => ff_rxhalfclk,
- CLK1 => ff_rxhalfclk,
- D_OUT(17 downto 16)=> rx_k,
- D_OUT(15 downto 0) => rx_data
- );
+
-- "Swap Bytes" indicator
-- Instantiation of serdes module
THE_SERDES: serdes
-port map( core_txrefclk => clock,
- core_rxrefclk => dcs_clk, --clk_in,
- hdinp2 => sd_rxd_p_in,
- hdinn2 => sd_rxd_n_in,
- ff_rxiclk_ch2 => ff_rxhalfclk,
- ff_txiclk_ch2 => ff_txhalfclk,
- ff_ebrd_clk_2 => ff_rxhalfclk, -- not used, just for completeness
- ff_txdata_ch2 => tx_data,
- ff_tx_k_cntrl_ch2 => tx_k,
- ff_force_disp_ch2 => "00",
- ff_disp_sel_ch2 => "00",
- ff_correct_disp_ch2 => "00",
- ffc_rrst_ch2 => '0',
- ffc_signal_detect_ch2 => '1',
- ffc_enable_cgalign_ch2 => resync, --'1',
- ffc_lane_tx_rst_ch2 => ffc_lane_tx_rst_ch2,
- ffc_lane_rx_rst_ch2 => ffc_lane_rx_rst_ch2,
- ffc_txpwdnb_ch2 => '1',
- ffc_rxpwdnb_ch2 => '1',
- ffc_macro_rst => '0',
- ffc_quad_rst => ffc_quad_rst,
- ffc_trst => '0',
- hdoutp2 => sd_txd_p_out,
- hdoutn2 => sd_txd_n_out,
- ff_rxdata_ch2 => comb_rx_data,
- ff_rx_k_cntrl_ch2 => comb_rx_k,
- ff_rxfullclk_ch2 => open,
- ff_rxhalfclk_ch2 => ff_rxhalfclk,
- ff_disp_err_ch2 => open,
- ff_cv_ch2 => link_error(7 downto 6),
- ffs_rlos_lo_ch2 => link_error(8),
- ffs_ls_sync_status_ch2 => link_ok(0),
- ffs_cc_underrun_ch2 => link_error(0),
- ffs_cc_overrun_ch2 => link_error(1),
- ffs_txfbfifo_error_ch2 => link_error(2),
- ffs_rxfbfifo_error_ch2 => link_error(3),
- ffs_rlol_ch2 => link_error(4),
- oob_out_ch2 => open,
- ff_txfullclk => open,
- ff_txhalfclk => ff_txhalfclk,
- refck2core => refck2core,
- ffs_plol => link_error(5)
- );
+ port map(
+ core_txrefclk => clk,
+ core_rxrefclk => clk,
+ hdinp2 => sd_rxd_p_in,
+ hdinn2 => sd_rxd_n_in,
+ ff_rxiclk_ch2 => ff_rxhalfclk,
+ ff_txiclk_ch2 => ff_txhalfclk,
+ ff_ebrd_clk_2 => ff_rxhalfclk, -- not used, just for completeness
+ ff_txdata_ch2 => tx_data,
+ ff_tx_k_cntrl_ch2 => tx_k,
+ ff_force_disp_ch2 => "00",
+ ff_disp_sel_ch2 => "00",
+ ff_correct_disp_ch2 => "00",
+ ffc_rrst_ch2 => '0',
+ ffc_lane_tx_rst_ch2 => ffc_lane_tx_rst_ch2,
+ ffc_lane_rx_rst_ch2 => ffc_lane_rx_rst_ch2,
+ ffc_txpwdnb_ch2 => '1',
+ ffc_rxpwdnb_ch2 => '1',
+ ffc_macro_rst => '0',
+ ffc_quad_rst => ffc_quad_rst,
+ ffc_trst => '0',
+ hdoutp2 => sd_txd_p_out,
+ hdoutn2 => sd_txd_n_out,
+ ff_rxdata_ch2 => rx_data, --comb_rx_data,
+ ff_rx_k_cntrl_ch2 => rx_k, --comb_rx_k,
+ ff_rxfullclk_ch2 => open,
+ ff_rxhalfclk_ch2 => ff_rxhalfclk,
+ ff_disp_err_ch2 => open,
+ ff_cv_ch2 => link_error(7 downto 6),
+ ffs_rlos_lo_ch2 => link_error(8),
+ ffs_ls_sync_status_ch2 => link_ok(0),
+ ffs_cc_underrun_ch2 => link_error(0),
+ ffs_cc_overrun_ch2 => link_error(1),
+ ffs_txfbfifo_error_ch2 => link_error(2),
+ ffs_rxfbfifo_error_ch2 => link_error(3),
+ ffs_rlol_ch2 => link_error(4),
+ oob_out_ch2 => open,
+ ff_txfullclk => open,
+ ff_txhalfclk => ff_txhalfclk,
+ refck2core => refck2core,
+ ffs_plol => link_error(5)
+ );
link_error(9) <= '0'; -- unused
----- Implement the TN1171 bugfix
-dcs_select <= link_error(4);
-dcs_clk_0 <= flip_flop xor ff_rxhalfclk;
-dcs_clk_1 <= clock;
-
--- Flipflop for phase shifting in case of repeated loss of lock
-THE_FLIP_FLOP_PROC: process( dcs_select, ffc_quad_rst )
-begin
- if ( ffc_quad_rst = '1' ) then
- flip_flop <= '0';
- elsif( rising_edge(dcs_select) ) then
- flip_flop <= not flip_flop;
- end if;
-end process THE_FLIP_FLOP_PROC;
-
-THE_DCS: dcs
--- synthesis translate_off
-generic map ( DCSMODE => "POS" )
--- synthesis translate_on
-port map( SEL => dcs_select,
- CLK0 => dcs_clk_0,
- CLK1 => dcs_clk_1,
- DCSOUT => dcs_clk
- );
-
-------------------------------------------------------------------------
-- RX Fifo & Data output
-------------------------------------------------------------------------
THE_FIFO_SFP_TO_FPGA: trb_net_fifo_16bit_bram_dualport
-generic map(
- USE_STATUS_FLAGS => c_NO
- )
-port map( read_clock_in => clock,
- write_clock_in => ff_rxhalfclk,
- read_enable_in => fifo_rx_rd_en,
- write_enable_in => fifo_rx_wr_en,
- fifo_gsr_in => fifo_rx_reset,
- write_data_in => fifo_rx_din,
- read_data_out => fifo_rx_dout,
- full_out => fifo_rx_full,
- empty_out => fifo_rx_empty
+ generic map(
+ USE_STATUS_FLAGS => c_NO
+ )
+ port map(
+ read_clock_in => clock,
+ write_clock_in => ff_rxhalfclk,
+ read_enable_in => fifo_rx_rd_en,
+ write_enable_in => fifo_rx_wr_en,
+ fifo_gsr_in => fifo_rx_reset,
+ write_data_in => fifo_rx_din,
+ read_data_out => fifo_rx_dout,
+ full_out => fifo_rx_full,
+ empty_out => fifo_rx_empty
);
fifo_rx_reset <= RESET;