From 5a652768dcac0aedf49e2400754caae8f536ebaa Mon Sep 17 00:00:00 2001 From: Hadaq Date: Mon, 2 Oct 2017 16:41:13 +0200 Subject: [PATCH] Update CTS on TRB3sc design --- cts/config.vhd | 12 ++-- cts/par.p2t | 2 +- cts/trb3sc_cts.vhd | 140 +++++++++++++++++++++++---------------------- 3 files changed, 80 insertions(+), 74 deletions(-) diff --git a/cts/config.vhd b/cts/config.vhd index 774e3de..f97c9a7 100644 --- a/cts/config.vhd +++ b/cts/config.vhd @@ -99,23 +99,27 @@ package config is type hub_cfg_t is array(0 to 3) of hub_ct; type hw_info_t is array(0 to 3) of std_logic_vector(31 downto 0); type intlist_t is array(0 to 7) of integer; +-- 0 opt. link opt. link +-- 1-8 SFP 1-4 +-- 1(9) CTS read-out internal 0 1 - X X O --downlink only +-- 2(10) CTS TRG Sctrl GbE 2 3 4 X X X --uplink only --Order: -- no backplane, 4x AddOn, 1x SFP, 1x GBE -- no backplane, 8x AddOn, 1x SFP, 1x GBE -- backplane, 9x backplane, 1x GBE - constant INTERFACE_NUM_ARR : hub_mii_t := (1,9,10,0); + constant INTERFACE_NUM_ARR : hub_mii_t := (5,9,10,0); -- 0 1 2 3 4 5 6 7 8 9 a b c d e f - constant IS_UPLINK_ARR : hub_cfg_t := ((0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + constant IS_UPLINK_ARR : hub_cfg_t := ((0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0), (0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0), (0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0), (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)); - constant IS_DOWNLINK_ARR : hub_cfg_t := ((1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + constant IS_DOWNLINK_ARR : hub_cfg_t := ((1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0), (1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0), (1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0), (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)); - constant IS_UPLINK_ONLY_ARR : hub_cfg_t := ((0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + constant IS_UPLINK_ONLY_ARR : hub_cfg_t := ((0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0), (0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0), (0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0), (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)); diff --git a/cts/par.p2t b/cts/par.p2t index f72683d..e13de7d 100644 --- a/cts/par.p2t +++ b/cts/par.p2t @@ -4,7 +4,7 @@ -n 1 -y -s 12 --t 24 +-t 25 -c 1 -e 2 #-g guidefile.ncd diff --git a/cts/trb3sc_cts.vhd b/cts/trb3sc_cts.vhd index 47fe9b8..46b5888 100644 --- a/cts/trb3sc_cts.vhd +++ b/cts/trb3sc_cts.vhd @@ -95,7 +95,8 @@ entity trb3sc_cts is attribute syn_useioff of FLASH_IN : signal is true; attribute syn_useioff of FLASH_OUT : signal is true; - + attribute syn_useioff of SPARE_IN : signal is false; + attribute syn_useioff of INP : signal is false; end entity; @@ -140,16 +141,16 @@ architecture trb3sc_arch of trb3sc_cts is signal mc_unique_id : std_logic_vector(63 downto 0); signal reset_via_gbe : std_logic := '0'; - signal med_dataready_out : std_logic_vector (1-1 downto 0); - signal med_data_out : std_logic_vector (1*c_DATA_WIDTH-1 downto 0); - signal med_packet_num_out : std_logic_vector (1*c_NUM_WIDTH-1 downto 0); - signal med_read_in : std_logic_vector (1-1 downto 0); - signal med_dataready_in : std_logic_vector (1-1 downto 0); - signal med_data_in : std_logic_vector (1*c_DATA_WIDTH-1 downto 0); - signal med_packet_num_in : std_logic_vector (1*c_NUM_WIDTH-1 downto 0); - signal med_read_out : std_logic_vector (1-1 downto 0); - signal med_stat_op : std_logic_vector (1*16-1 downto 0); - signal med_ctrl_op : std_logic_vector (1*16-1 downto 0); + signal med_dataready_out : std_logic_vector (5-1 downto 0); + signal med_data_out : std_logic_vector (5*c_DATA_WIDTH-1 downto 0); + signal med_packet_num_out : std_logic_vector (5*c_NUM_WIDTH-1 downto 0); + signal med_read_in : std_logic_vector (5-1 downto 0); + signal med_dataready_in : std_logic_vector (5-1 downto 0); + signal med_data_in : std_logic_vector (5*c_DATA_WIDTH-1 downto 0); + signal med_packet_num_in : std_logic_vector (5*c_NUM_WIDTH-1 downto 0); + signal med_read_out : std_logic_vector (5-1 downto 0); + signal med_stat_op : std_logic_vector (5*16-1 downto 0); + signal med_ctrl_op : std_logic_vector (5*16-1 downto 0); signal rdack, wrack : std_logic; signal monitor_inputs_i : std_logic_vector(MONITOR_INPUT_NUM-1 downto 0); @@ -322,62 +323,62 @@ end generate; --------------------------------------------------------------------------- -- PCSC 4 downlinks --------------------------------------------------------------------------- -bussci3_tx.data <= (others => '0'); -bussci3_tx.ack <= '0'; -bussci3_tx.nack <= '0'; -bussci3_tx.unknown <= '1'; --- THE_MEDIA_4_PCSC : entity work.med_ecp3_sfp_sync_4 --- generic map( --- IS_SYNC_SLAVE => (c_NO, c_NO, c_NO, c_NO), --- IS_USED => (c_YES,c_YES ,c_YES ,c_YES) --- ) --- port map( --- CLK_REF_FULL => clk_full_osc, --- CLK_INTERNAL_FULL => clk_full_osc, --- SYSCLK => clk_sys, --- RESET => reset_i, --- CLEAR => clear_i, --- --- --Internal Connection --- MEDIA_MED2INT(0) => med2int(3), --- MEDIA_MED2INT(1) => med2int(4), --- MEDIA_MED2INT(2) => med2int(1), --- MEDIA_MED2INT(3) => med2int(2), --- MEDIA_INT2MED(0) => int2med(3), --- MEDIA_INT2MED(1) => int2med(4), --- MEDIA_INT2MED(2) => int2med(1), --- MEDIA_INT2MED(3) => int2med(2), --- --- --Sync operation --- RX_DLM => open, --- RX_DLM_WORD => open, --- TX_DLM => open, --- TX_DLM_WORD => open, --- --- --SFP Connection --- SD_PRSNT_N_IN(0) => HUB_MOD0(3), --- SD_PRSNT_N_IN(1) => HUB_MOD0(4), --- SD_PRSNT_N_IN(2) => HUB_MOD0(1), --- SD_PRSNT_N_IN(3) => HUB_MOD0(2), --- --- SD_LOS_IN(0) => HUB_LOS(3), --- SD_LOS_IN(1) => HUB_LOS(4), --- SD_LOS_IN(2) => HUB_LOS(1), --- SD_LOS_IN(3) => HUB_LOS(2), --- --- SD_TXDIS_OUT(0) => HUB_TXDIS(3), --- SD_TXDIS_OUT(1) => HUB_TXDIS(4), --- SD_TXDIS_OUT(2) => HUB_TXDIS(1), --- SD_TXDIS_OUT(3) => HUB_TXDIS(2), --- --- --Control Interface --- BUS_RX => bussci3_rx, --- BUS_TX => bussci3_tx, --- --- -- Status and control port --- STAT_DEBUG => open, --med_stat_debug(63 downto 0), --- CTRL_DEBUG => open --- ); +-- bussci3_tx.data <= (others => '0'); +-- bussci3_tx.ack <= '0'; +-- bussci3_tx.nack <= '0'; +-- bussci3_tx.unknown <= '1'; + THE_MEDIA_4_PCSC : entity work.med_ecp3_sfp_sync_4 + generic map( + IS_SYNC_SLAVE => (c_NO, c_NO, c_NO, c_NO), + IS_USED => (c_YES,c_YES ,c_YES ,c_YES) + ) + port map( + CLK_REF_FULL => clk_full_osc, + CLK_INTERNAL_FULL => clk_full_osc, + SYSCLK => clk_sys, + RESET => reset_i, + CLEAR => clear_i, + + --Internal Connection + MEDIA_MED2INT(0) => med2int(3), + MEDIA_MED2INT(1) => med2int(4), + MEDIA_MED2INT(2) => med2int(1), + MEDIA_MED2INT(3) => med2int(2), + MEDIA_INT2MED(0) => int2med(3), + MEDIA_INT2MED(1) => int2med(4), + MEDIA_INT2MED(2) => int2med(1), + MEDIA_INT2MED(3) => int2med(2), + + --Sync operation + RX_DLM => open, + RX_DLM_WORD => open, + TX_DLM => open, + TX_DLM_WORD => open, + + --SFP Connection + SD_PRSNT_N_IN(0) => HUB_MOD0(3), + SD_PRSNT_N_IN(1) => HUB_MOD0(4), + SD_PRSNT_N_IN(2) => HUB_MOD0(1), + SD_PRSNT_N_IN(3) => HUB_MOD0(2), + + SD_LOS_IN(0) => HUB_LOS(3), + SD_LOS_IN(1) => HUB_LOS(4), + SD_LOS_IN(2) => HUB_LOS(1), + SD_LOS_IN(3) => HUB_LOS(2), + + SD_TXDIS_OUT(0) => HUB_TXDIS(3), + SD_TXDIS_OUT(1) => HUB_TXDIS(4), + SD_TXDIS_OUT(2) => HUB_TXDIS(1), + SD_TXDIS_OUT(3) => HUB_TXDIS(2), + + --Control Interface + BUS_RX => bussci3_rx, + BUS_TX => bussci3_tx, + + -- Status and control port + STAT_DEBUG => open, --med_stat_debug(63 downto 0), + CTRL_DEBUG => open + ); @@ -479,7 +480,7 @@ bussci3_tx.unknown <= '1'; MII_IS_DOWNLINK => IS_DOWNLINK, MII_IS_UPLINK_ONLY => IS_UPLINK_ONLY, HARDWARE_VERSION => HARDWARE_INFO, - INIT_ENDPOINT_ID => x"0005", + INIT_ENDPOINT_ID => x"0001", BROADCAST_BITMASK => x"7E", CLOCK_FREQUENCY => 100, USE_ONEWIRE => c_YES, @@ -721,7 +722,8 @@ bussci3_tx.unknown <= '1'; cts_addon_triggers_in(1 downto 0) <= SPARE_IN(1 downto 0); cts_addon_triggers_in(17 downto 2) <= INP(79 downto 64); - + buscts_tx.nack <= '0'; + buscts_tx.ack <= '0'; --------------------------------------------------------------------------- -- TDC --------------------------------------------------------------------------- -- 2.43.0