26 use IEEE.STD_LOGIC_1164.
all;
27 use ieee.numeric_std.
all;
30 use ipbus_lib.ipbus.
all;
43 MGT_RX_POWER : std_logic_vector(79 downto 0) := (others => '0')
101 mux_sel : out std_logic_vector (319 downto 0);
135 ram_data_mgt1 : out std_logic_vector (4559 downto 0);
139 ram_data_mgt3 : out std_logic_vector (4559 downto 0);
153 signal ipbw : ipb_wbus_array(N_SLAVES-1 downto 0);
154 signal ipbr, ipbr_d : ipb_rbus_array(N_SLAVES-1 downto 0);
155 signal clock : std_logic_vector(79 downto 0);
161 type MGT_IPBUS_NUMBER is array(19 downto 0) of integer;
162 constant mgt_n : MGT_IPBUS_NUMBER := (N_SLV_MGT_219, N_SLV_MGT_218, N_SLV_MGT_217, N_SLV_MGT_216, N_SLV_MGT_215,
163 N_SLV_MGT_214, N_SLV_MGT_213, N_SLV_MGT_212, N_SLV_MGT_211, N_SLV_MGT_210,
164 N_SLV_MGT_119, N_SLV_MGT_118, N_SLV_MGT_117, N_SLV_MGT_116, N_SLV_MGT_115,
165 N_SLV_MGT_114, N_SLV_MGT_113, N_SLV_MGT_112, N_SLV_MGT_111, N_SLV_MGT_110);
169 mgt_fabric :
entity ipbus_lib.ipbus_fabric_sel
170 generic map(NSLV => N_SLAVES,
171 SEL_WIDTH => ipbus_sel_width
)
175 sel => ipbus_sel_efex_mgt_top
(ipb_in.ipb_addr
),
176 ipb_to_slaves => ipbw,
177 ipb_from_slaves => ipbr
180 QUAD_FOR : for i in 0 to 19 generate
184 clock(i*4+3 downto i*4) <= Clk280_rx(i*4+3 downto i*4) when MGT_USE_OTHER_CLK(i) = '0' else
185 Clk280_tx(i*4+3 downto i*4);
191 rxclk280 => clock
(i*4+3
downto i*4
),
203 bc_reg_sel => bc_reg_sel
(i*16+15
downto i*16
),
220 phase_mux =>
phase_mux(i*16+15
downto i*16
),
in delay_cntr_2 std_logic_vector( 3 downto 0)
first stage delay count of gt2
in qpll_lock std_logic
qpll lock of the MGT if high
out mgt_enable std_logic_vector( 3 downto 0)
mgt enable of the quad
out softreset_rx std_logic
rx soft reset of the quad
in clk40 std_logic
fabric clock of 40MHz
in bc_cntr_1 std_logic_vector( 6 downto 0)
bc value of gt1
in ipb_rst std_logic
ipbus reset
out ram_data_gt0 std_logic_vector( 227 downto 0)
ram_data from the plyback ram gt0
in BCR_in std_logic
BCR from TTC information.
in delay_cntr_1 std_logic_vector( 3 downto 0)
first stage delay count of gt1
in rx_pd std_logic_vector( 3 downto 0)
power control for rx side of the mgt
in tx_resetdone std_logic_vector( 3 downto 0)
tx reset done of the quad if high is done
in rx_realign std_logic_vector( 3 downto 0)
rx realign status
out bc_reg_sel std_logic_vector( 15 downto 0)
BC level mux setting value.
in crc_error std_logic_vector( 3 downto 0)
crc error of the quad
in tx_pd std_logic_vector( 3 downto 0)
power control for tx side of the mgt
in bc_mux_cntr_3 std_logic_vector( 6 downto 0)
bc value after the mux gt3
out loopback std_logic_vector( 2 downto 0)
Loopback Ports.
out ram_data_gt2 std_logic_vector( 227 downto 0)
ram_data from the plyback ram gt2
in rxclk280 std_logic_vector( 3 downto 0)
rxclk
in bc_cntr_0 std_logic_vector( 6 downto 0)
bc value of gt0
in bc_mux_cntr_1 std_logic_vector( 6 downto 0)
bc value after the mux gt1
out mux_sel std_logic_vector( 15 downto 0)
first stage sync mux setting value
in tx_bufstatus std_logic_vector( 7 downto 0)
tx buffer status
in delay_cntr_3 std_logic_vector( 3 downto 0)
first stage delay count of gt3
out ram_data_gt3 std_logic_vector( 227 downto 0)
ram_data from the plyback ram gt3
in rx_resetdone std_logic_vector( 3 downto 0)
rx reset done of the quad if high is done
in tx_fsm_resetdone std_logic_vector( 3 downto 0)
tx fsm reset done of the quad if high is done
in rx_byteisaligned std_logic_vector( 3 downto 0)
RX Byte and Word Alignment.
in delay_cntr_0 std_logic_vector( 3 downto 0)
first stage delay count of gt0
out notable_error std_logic_vector( 3 downto 0)
notable_error
in clk280 std_logic
fabric clock 280MHz
in rx_disperr std_logic_vector( 15 downto 0)
rx disperr error
in ipb_clk std_logic
ipbus clock
in bc_cntr_2 std_logic_vector( 6 downto 0)
bc value of gt2
in rxdata_gt3 std_logic_vector( 31 downto 0)
rx_data from gt3
out ipb_out ipb_rbus
IPBus output bus going from slaves to master.
in rx_fsm_resetdone std_logic_vector( 3 downto 0)
rx fsm reset done of the quad if high is done
in bc_cntr_3 std_logic_vector( 6 downto 0)
bc value of gt3
out disperr_error std_logic_vector( 3 downto 0)
disperr_error
in bc_mux_cntr_0 std_logic_vector( 6 downto 0)
bc value after the mux gt0
in ipb_in ipb_wbus
IPBus input bus going from master to slaves.
in rxdata_gt0 std_logic_vector( 31 downto 0)
rx_data from gt0
in encode_error std_logic_vector( 15 downto 0)
B/10B Decoder error.
in bc_mux_cntr_2 std_logic_vector( 6 downto 0)
bc value after the mux gt2
in qpll_refclklost std_logic
qpll refrence clcok lost if high
in rxdata_gt2 std_logic_vector( 31 downto 0)
rx_data from gt2
out softreset_tx std_logic
tx soft reset of the quad
out ram_data_gt1 std_logic_vector( 227 downto 0)
ram_data from the plyback ram gt1
in rxdata_gt1 std_logic_vector( 31 downto 0)
rx_data from gt1
out ram_data_mgt0 std_logic_vector( 4559 downto 0)
ram data from all channel 0 in the all channels
in delay_cntr std_logic_vector( 319 downto 0)
first stage delay counters
out kchar_mgt std_logic_vector( 79 downto 0)
kchar_mgt all MGTs
in rx_fsm_resetdone std_logic_vector( 79 downto 0)
rx_fsm_resetdone for all MGTs
in bc_mux_cntr_2 std_logic_vector( 139 downto 0)
bc_mux_cntr_2 for gt2 of the MGTs
in clk40 std_logic
fabric clock of 40MHz
in ipb_rst std_logic
ipbus reset
in rxdata_mgt1 std_logic_vector( 639 downto 0)
rx data from all gt1 in the all QAUDs
in BCR_in std_logic
BCR from TTC information.
in tx_fsm_resetdone std_logic_vector( 79 downto 0)
tx_fsm_resetdone for all MGTs
in qpll_refclklost std_logic_vector( 19 downto 0)
qpll_refclklost for the quads
in crc_error_chan std_logic_vector( 79 downto 0)
crc errors for all MGTs
in rxdata_mgt0 std_logic_vector( 639 downto 0)
rx data from all gt0 in the all QAUDs
in qpll_lock std_logic_vector( 19 downto 0)
qpllock for the quads
in rxdata_mgt3 std_logic_vector( 639 downto 0)
rx data from all gt3 in the all QAUDs
in clk280_rx std_logic_vector( 79 downto 0)
rx clock of the all the mgts
in rx_realign std_logic_vector( 79 downto 0)
rx_realign for all MGTs
in bc_cntr_3 std_logic_vector( 139 downto 0)
bc cntr for all the gt3 of the MGTs
out softreset_tx std_logic_vector( 19 downto 0)
softreset_tx for all the Quads
in bc_cntr_0 std_logic_vector( 139 downto 0)
bc cntr for all the gt0 of the MGTs
out ram_data_mgt2 std_logic_vector( 4559 downto 0)
ram data from all channel 2 in the all channels
MGT_RX_POWER std_logic_vector( 79 downto 0) :=( others => '0')
power down to rx
in rxdata_mgt2 std_logic_vector( 639 downto 0)
rx data from all gt2 in the all QAUDs
in bc_cntr_1 std_logic_vector( 139 downto 0)
bc cntr for all the gt1 of the MGTs
in bc_mux_cntr_1 std_logic_vector( 139 downto 0)
bc_mux_cntr_1 for gt1 of the MGTs
out loopback std_logic_vector( 59 downto 0)
loopback setting for all the MGTs
in rx_byteisaligned std_logic_vector( 79 downto 0)
rx_byteisaligned for all MGTs
in rx_resetdone std_logic_vector( 79 downto 0)
rx resetdone for all MGTs
in bc_cntr_2 std_logic_vector( 139 downto 0)
bc cntr for all the gt2 of the MGTs
out disperr_error std_logic_vector( 79 downto 0)
disperr_error in all the MGTs
out mgt_enable std_logic_vector( 79 downto 0)
mgt enable for the MGTs
out phase_mux std_logic_vector( 319 downto 0)
phase_mux
in tx_resetdone std_logic_vector( 79 downto 0)
tx resetdone for all MGTs
in tx_bufstatus std_logic_vector( 159 downto 0)
tx_bufstatus for all MGTs
in clk280_tx std_logic_vector( 79 downto 0)
tx clock of the all the mgts
out BC_Reg_sel std_logic_vector( 319 downto 0)
mux setting for BC mux
in clk280 std_logic
fabric clock of clk280MHz
MGT_QUAD_ENABLE std_logic_vector( 19 downto 0) := x"00000"
enable the quad in the design
in ipb_clk std_logic
ipbus clock
in bc_mux_cntr_0 std_logic_vector( 139 downto 0)
bc_mux_cntr_0 for gt0 of the MGTs
out ipb_out ipb_rbus
IPBus output bus going from slaves to master.
out mux_sel std_logic_vector( 319 downto 0)
mux setting for the first stage mux
MGT_USE_OTHER_CLK std_logic_vector( 19 downto 0) := x"00000"
tx or rx clock selection
out notable_error std_logic_vector( 79 downto 0)
d notable_error in all the MGTs
in encode_error std_logic_vector( 319 downto 0)
encode_error for all MGTs
in rx_disperr std_logic_vector( 319 downto 0)
rx_disperr for all MGTs
in bc_mux_cntr_3 std_logic_vector( 139 downto 0)
bc_mux_cntr_3 for gt3 of the MGTs
in ipb_in ipb_wbus
IPBus input bus going from master to slaves.
out softreset_rx std_logic_vector( 19 downto 0)
softreset_rx for all the Quads
MGT_TX_POWER std_logic_vector( 79 downto 0) :=( others => '0')
power down to tx