From: hadeshyp Date: Thu, 12 Nov 2009 13:00:43 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: oldGBE~361 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=5233712d5ca051984f9857ba8ed9f35898cb2e33;p=trbnet.git *** empty log message *** --- diff --git a/pinout/mdc_oep3.lpf b/pinout/mdc_oep3.lpf index 90266e8..54338a2 100644 --- a/pinout/mdc_oep3.lpf +++ b/pinout/mdc_oep3.lpf @@ -85,6 +85,13 @@ IOBUF PORT "COM_STOP_P" IO_TYPE=LVDS25; LOCATE COMP "WATCHDOG" SITE "E13"; # TPS_WDI IOBUF PORT "WATCHDOG" IO_TYPE=LVTTL33 PULLMODE=NONE ; +################################################################# +# Extension "Jumper" +################################################################# + + LOCATE COMP "J2_P" SITE "M1"; # LVDS J2 + IOBUF PORT "J2_P" IO_TYPE=LVDS25; + ################################################################# #Misc TTL Ports ################################################################# diff --git a/trb_net16_api_ipu_streaming.vhd b/trb_net16_api_ipu_streaming.vhd index 0add059..eefe4bb 100644 --- a/trb_net16_api_ipu_streaming.vhd +++ b/trb_net16_api_ipu_streaming.vhd @@ -309,10 +309,11 @@ begin end process; APL_FEE_SEND_IN <= cts_start_readout_rising; + APL_FEE_READ_IN <= FEE_READ_IN; APL_FEE_ERROR_PATTERN_IN(15 downto 0) <= buf_CTS_NUMBER_OUT; APL_FEE_ERROR_PATTERN_IN(23 downto 16) <= buf_CTS_CODE_OUT; - APL_FEE_ERROR_PATTERN_IN(31 downto 24) <= buf_CTS_INFORMATION_OUT; + APL_FEE_ERROR_PATTERN_IN(31 downto 24) <= buf_CTS_INFORMATION_OUT(7 downto 0); APL_FEE_DTYPE_IN <= buf_CTS_READOUT_TYPE_OUT; CTS_NUMBER_OUT <= buf_CTS_NUMBER_OUT; @@ -355,4 +356,23 @@ begin end process; + + + PROC_IPU_DATA : process(CLK) + begin + if rising_edge(CLK) then + if IPU_READ_IN = '1' then + buf_IPU_DATAREADY_OUT <= '0'; + end if; + if buf_APL_READ_IN(1) = '1' and buf_APL_DATAREADY_OUT(1) = '1' and buf_APL_TYP_OUT(5 downto 3) = TYPE_DAT then + if buf_APL_PACKET_NUM_OUT(5 downto 3) = c_F0 or buf_APL_PACKET_NUM_OUT(5 downto 3) = c_F2 then + buf_IPU_DATA_OUT(31 downto 16) <= buf_APL_DATA_OUT(31 downto 16); + elsif buf_APL_PACKET_NUM_OUT(5 downto 3) = c_F1 or buf_APL_PACKET_NUM_OUT(5 downto 3) = c_F3 then + buf_IPU_DATA_OUT(15 downto 0) <= buf_APL_DATA_OUT(31 downto 16); + buf_IPU_DATAREADY_OUT <= '1'; + end if; + end if; + end if; + end process; + end architecture; \ No newline at end of file diff --git a/trb_net16_endpoint_hades_full.vhd b/trb_net16_endpoint_hades_full.vhd index ab89d53..3f21b3c 100644 --- a/trb_net16_endpoint_hades_full.vhd +++ b/trb_net16_endpoint_hades_full.vhd @@ -32,7 +32,7 @@ entity trb_net16_endpoint_hades_full is --standard values for output registers REGIO_INIT_CTRL_REGS : std_logic_vector(2**(3)*32-1 downto 0) := (others => '0'); --set to 0 for unused ctrl registers to save resources - REGIO_USED_CTRL_REGS : std_logic_vector(2**(3)-1 downto 0) := "00000001"; + REGIO_USED_CTRL_REGS : std_logic_vector(2**(3)-1 downto 0) := (others => '1'); --set to 0 for each unused bit in a register REGIO_USED_CTRL_BITMASK : std_logic_vector(2**(3)*32-1 downto 0) := (others => '1'); REGIO_USE_DAT_PORT : integer range 0 to 1 := c_YES; --internal data port @@ -51,7 +51,7 @@ entity trb_net16_endpoint_hades_full is -- Misc CLK : in std_logic; RESET : in std_logic; - CLK_EN : in std_logic; + CLK_EN : in std_logic := '1'; -- Media direction port MED_DATAREADY_OUT : out std_logic; @@ -135,8 +135,8 @@ entity trb_net16_endpoint_hades_full is STAT_DEBUG_1 : out std_logic_vector (31 downto 0); STAT_DEBUG_2 : out std_logic_vector (31 downto 0); MED_STAT_OP : out std_logic_vector (15 downto 0); - CTRL_MPLEX : in std_logic_vector (31 downto 0); - IOBUF_CTRL_GEN : in std_logic_vector (4*32-1 downto 0); + CTRL_MPLEX : in std_logic_vector (31 downto 0) := (others => '0'); + IOBUF_CTRL_GEN : in std_logic_vector (4*32-1 downto 0) := (others => '0'); STAT_ONEWIRE : out std_logic_vector (31 downto 0); STAT_ADDR_DEBUG : out std_logic_vector (15 downto 0) ); diff --git a/trb_net16_hub_base.vhd b/trb_net16_hub_base.vhd index 8098d9b..4213d45 100644 --- a/trb_net16_hub_base.vhd +++ b/trb_net16_hub_base.vhd @@ -193,6 +193,7 @@ architecture trb_net16_hub_base_arch of trb_net16_hub_base is signal HUB_CTRL_final_activepoints : std_logic_vector (2**(c_MUX_WIDTH-1)*32-1 downto 0); signal HUB_CTRL_activepoints : std_logic_vector (2**(c_MUX_WIDTH-1)*32-1 downto 0); signal HUB_CTRL_media_interfaces_off: std_logic_vector (31 downto 0); + signal HUB_CTRL_TIMEOUT_TIME : std_logic_vector (15 downto 0); signal HUB_ADDRESS : std_logic_vector (15 downto 0); signal HUBLOGIC_IPU_STAT_DEBUG : std_logic_vector (31 downto 0); @@ -698,6 +699,7 @@ MED_DATA_OUT <= buf_MED_DATA_OUT; STAT_POINTS_locked => buf_STAT_POINTS_locked((i+1)*32-1 downto i*32), STAT_TIMEOUT => STAT_TIMEOUT((i+1)*32-1 downto i*32), STAT_ERRORBITS => open, --HUB_STAT_ERRORBITS(i+1)*32-1 downto i*32), + CTRL_TIMEOUT_TIME => HUB_CTRL_TIMEOUT_TIME(i*4+3 downto i*4), CTRL_activepoints => HUB_CTRL_final_activepoints((i+1)*32-1 downto i*32) ); end generate; @@ -734,6 +736,7 @@ MED_DATA_OUT <= buf_MED_DATA_OUT; STAT_TIMEOUT => STAT_TIMEOUT((i+1)*32-1 downto i*32), STAT_ERRORBITS => open, --HUB_STAT_ERRORBITS(i+1)*32-1 downto i*32), STAT_FSM => stat_ipu_fsm, + CTRL_TIMEOUT_TIME => HUB_CTRL_TIMEOUT_TIME(i*4+3 downto i*4), CTRL_activepoints => HUB_CTRL_final_activepoints((i+1)*32-1 downto i*32) ); buf_HUB_STAT_CHANNEL((i+1)*16-1 downto i*16) <= (others => '0'); @@ -763,10 +766,10 @@ MED_DATA_OUT <= buf_MED_DATA_OUT; generic map( NUM_STAT_REGS => 4, NUM_CTRL_REGS => 3, - INIT_CTRL_REGS => x"00000000_00000000_00000000_00000000" & + INIT_CTRL_REGS => x"00000000_00000000_00009999_00000000" & x"FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF", - USED_CTRL_REGS => "00011111", - USED_CTRL_BITMASK => x"FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF" & + USED_CTRL_REGS => "00111111", + USED_CTRL_BITMASK => x"FFFFFFFF_FFFFFFFF_0000FFFF_FFFFFFFF" & x"FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF", USE_DAT_PORT => c_YES, INIT_ADDRESS => INIT_ADDRESS, @@ -1021,6 +1024,7 @@ HUB_MED_CONNECTED(31 downto MII_NUMBER) <= (others => '1'); MY_ADDRESS_OUT <= HUB_ADDRESS; STAT_REGS <= HC_STAT_REGS; STAT_CTRL_REGS <= HC_CTRL_REGS; + HUB_CTRL_TIMEOUT_TIME <= HC_CTRL_REGS(5*32+15 downto 5*32); HUB_STAT_CHANNEL <= buf_HUB_STAT_CHANNEL; STAT_DEBUG <= buf_STAT_DEBUG; HUB_STAT_GEN <= (others => '0'); diff --git a/trb_net16_hub_func.vhd b/trb_net16_hub_func.vhd index 4db08e0..fd4e013 100644 --- a/trb_net16_hub_func.vhd +++ b/trb_net16_hub_func.vhd @@ -307,6 +307,7 @@ component trb_net16_hub_streaming_port is STAT_TIMEOUT : out std_logic_vector (31 downto 0); STAT_ERRORBITS : out std_logic_vector (31 downto 0); STAT_FSM : out std_logic_vector (15 downto 0); + CTRL_TIMEOUT_TIME : in std_logic_vector (3 downto 0); CTRL_activepoints : in std_logic_vector (31 downto 0) := (others => '1') ); end component; @@ -343,6 +344,7 @@ component trb_net16_hub_streaming_port is STAT_POINTS_locked : out std_logic_vector (31 downto 0); STAT_TIMEOUT : out std_logic_vector (31 downto 0); STAT_ERRORBITS : out std_logic_vector (31 downto 0); + CTRL_TIMEOUT_TIME : in std_logic_vector (3 downto 0); CTRL_activepoints : in std_logic_vector (31 downto 0) ); end component; diff --git a/trb_net16_hub_ipu_logic.vhd b/trb_net16_hub_ipu_logic.vhd index 49608bb..fdaf8a0 100644 --- a/trb_net16_hub_ipu_logic.vhd +++ b/trb_net16_hub_ipu_logic.vhd @@ -46,6 +46,7 @@ entity trb_net16_hub_ipu_logic is STAT_TIMEOUT : out std_logic_vector (31 downto 0); STAT_ERRORBITS : out std_logic_vector (31 downto 0); STAT_FSM : out std_logic_vector (15 downto 0); + CTRL_TIMEOUT_TIME : in std_logic_vector (3 downto 0); CTRL_activepoints : in std_logic_vector (31 downto 0) := (others => '1') ); end entity; @@ -197,7 +198,7 @@ architecture trb_net16_hub_ipu_logic_arch of trb_net16_hub_ipu_logic is signal enable_packing : std_logic; - type timeout_counter_t is array (POINT_NUMBER-1 downto 0) of unsigned(25 downto 0); + type timeout_counter_t is array (POINT_NUMBER-1 downto 0) of unsigned(31 downto 0); signal timeout_counter : timeout_counter_t; signal timeout_counter_reset : std_logic_vector(POINT_NUMBER-1 downto 0); signal connection_timed_out : std_logic_vector(POINT_NUMBER-1 downto 0); @@ -542,7 +543,7 @@ begin timeout_found <= or_all(connection_timed_out); if REPLY_DATAREADY_IN(i) = '1' or real_activepoints(i) = '0' or locked = '0' or locking_point(i) = '1' then timeout_counter(i) <= (others => '0'); - elsif timeout_counter(i)(timeout_counter(i)'left) = '1' then + elsif timeout_counter(i)(to_integer(unsigned('0'&CTRL_TIMEOUT_TIME)+to_unsigned(16,5))) = '1' then connection_timed_out(i) <= '1'; else timeout_counter(i) <= timeout_counter(i) + to_unsigned(1,1); diff --git a/trb_net16_hub_logic.vhd b/trb_net16_hub_logic.vhd index 1dd2576..4e0d85a 100644 --- a/trb_net16_hub_logic.vhd +++ b/trb_net16_hub_logic.vhd @@ -41,6 +41,7 @@ entity trb_net16_hub_logic is STAT_POINTS_locked : out std_logic_vector (31 downto 0); STAT_TIMEOUT : out std_logic_vector (31 downto 0); STAT_ERRORBITS : out std_logic_vector (31 downto 0); + CTRL_TIMEOUT_TIME : in std_logic_vector (3 downto 0); CTRL_activepoints : in std_logic_vector (31 downto 0) := (others => '1') ); end entity; @@ -136,12 +137,13 @@ architecture trb_net16_hub_logic_arch of trb_net16_hub_logic is signal register_buf_REPLY_READ_OUT : std_logic_vector(POINT_NUMBER-1 downto 0) := (others => '0'); - type timeout_counter_t is array (POINT_NUMBER-1 downto 0) of unsigned(25 downto 0); + type timeout_counter_t is array (POINT_NUMBER-1 downto 0) of unsigned(31 downto 0); signal timeout_counter : timeout_counter_t; signal timeout_counter_reset : std_logic_vector(POINT_NUMBER-1 downto 0); signal connection_timed_out : std_logic_vector(POINT_NUMBER-1 downto 0); signal timeout_found : std_logic; + begin ---------------------------------- @@ -494,9 +496,9 @@ begin if rising_edge(CLK) then connection_timed_out(i) <= '0'; timeout_found <= or_all(connection_timed_out); - if REPLY_DATAREADY_IN(i) = '1' or real_activepoints(i) = '0' or locked = '0' then + if REPLY_DATAREADY_IN(i) = '1' or real_activepoints(i) = '0' or locked = '0' or locking_point(i) = '1' then timeout_counter(i) <= (others => '0'); - elsif timeout_counter(i)(timeout_counter(i)'left) = '1' then + elsif timeout_counter(i)(conv_integer(('0'&CTRL_TIMEOUT_TIME)+16)) = '1' then connection_timed_out(i) <= '1'; else timeout_counter(i) <= timeout_counter(i) + to_unsigned(1,1);