]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Thu, 12 Nov 2009 13:00:43 +0000 (13:00 +0000)
committerhadeshyp <hadeshyp>
Thu, 12 Nov 2009 13:00:43 +0000 (13:00 +0000)
pinout/mdc_oep3.lpf
trb_net16_api_ipu_streaming.vhd
trb_net16_endpoint_hades_full.vhd
trb_net16_hub_base.vhd
trb_net16_hub_func.vhd
trb_net16_hub_ipu_logic.vhd
trb_net16_hub_logic.vhd

index 90266e8924dad7379d167918ebba97fd85d7ce44..54338a21280a278eaaa76de65a15a4405d80c93b 100644 (file)
@@ -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
 #################################################################
index 0add059dc1a5b32486ece6e8fe26cdda0b7209d1..eefe4bbd35c1b31960f30b8b6087f89d3471d9aa 100644 (file)
@@ -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
index ab89d539ae12a4d4e4ac61165193f34e05cc64bb..3f21b3cdb35a98d2bbddadeff179b6e0f7996391 100644 (file)
@@ -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)
     );
index 8098d9b3884ad79f9eb94999307b5d5c72053d70..4213d45dfaef6f2bdeb45967776a14759f908a41 100644 (file)
@@ -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');
index 4db08e0bee148ef759d10885064ed9e63b4701fd..fd4e0133a52a59ebec8d1e7e1fd9de1a370a3981 100644 (file)
@@ -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;
index 49608bb164ba70fb5d4d510f9d116921c8a8e56e..fdaf8a0e6471451c79d18568528cae9ba18d0770 100644 (file)
@@ -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);
index 1dd2576e74832ebac35b51e0562972cd36fc41de..4e0d85aea3d00b91985944af4adf98708c83e076 100644 (file)
@@ -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);