]> jspc29.x-matter.uni-frankfurt.de Git - trb3sc.git/commitdiff
update included features with more information
authorJan Michel <j.michel@gsi.de>
Fri, 2 Feb 2018 10:54:56 +0000 (11:54 +0100)
committerJan Michel <j.michel@gsi.de>
Fri, 2 Feb 2018 10:54:56 +0000 (11:54 +0100)
backplanemaster/config.vhd
hub/config.vhd
tdctemplate/config_32_sfp_kel.vhd
tdctemplate/config_48_crate_4conn.vhd
template/config.vhd

index 2aea6ce179c6cbb2734b15f36844b8b0d3a8518a..eb23b7084ef1e108c047a6a41575fa8dee9cf44e 100644 (file)
@@ -62,7 +62,9 @@ package config is
 
 
 
-
+    type hub_mii_t is array(0 to 1) of integer;    
+    type hub_ct    is array(0 to 16) of integer;
+    type hub_cfg_t is array(0 to 1) of hub_ct;
 
 
 --With GbE:
@@ -72,11 +74,26 @@ package config is
 -- port 10: SCTRL channel on uplink to CTS
 -- port 11: SCTRL channel from GbE interface
 
- constant INTERFACE_NUM       : integer := 10;
- constant MII_IS_UPLINK       : hub_mii_config_t := (0,0,0,0,0,0,0,0,0, 1,1,1,0,0,0,0,0);--0,0,0,0,0,
- constant MII_IS_DOWNLINK     : hub_mii_config_t := (1,1,1,1,1,1,1,1,1, 1,0,0,0,0,0,0,0);--1,1,1,1,1,
- constant MII_IS_UPLINK_ONLY  : hub_mii_config_t := (0,0,0,0,0,0,0,0,0, 0,1,1,0,0,0,0,0);--0,0,0,0,0,
-
+--Without GbE:
+-- for MII_NUMBER=11
+-- port 0-8: downlinks to other FPGA
+-- port 9: SFP2
+-- port 10: SFP1
+
+  constant INTERFACE_NUM_ARR    : hub_mii_t := (11,10);
+  constant IS_UPLINK_ARR        : hub_cfg_t := ((0,0,0,0,0,0,0,0,0, 1,1,0,0,0,0,0,0),  
+                                                (0,0,0,0,0,0,0,0,0, 1,1,1,0,0,0,0,0));
+  constant IS_DOWNLINK_ARR      : hub_cfg_t := ((1,1,1,1,1,1,1,1,1, 1,1,1,0,0,0,0,0),  
+                                                (1,1,1,1,1,1,1,1,1, 1,0,0,0,0,0,0,0));
+  constant IS_UPLINK_ONLY_ARR   : hub_cfg_t := ((0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0),
+                                                (0,0,0,0,0,0,0,0,0, 0,1,1,0,0,0,0,0));
+
+                                                
+  constant INTERFACE_NUM        : integer;
+  constant MII_IS_UPLINK            : hub_ct;
+  constant MII_IS_DOWNLINK          : hub_ct;
+  constant MII_IS_UPLINK_ONLY       : hub_ct;
+  
 ------------------------------------------------------------------------------
 --Select settings by configuration 
 ------------------------------------------------------------------------------
@@ -91,7 +108,7 @@ package config is
     constant HARDWARE_INFO        : std_logic_vector(31 downto 0);
     constant CLOCK_FREQUENCY      : integer;
     constant MEDIA_FREQUENCY      : integer;
-    constant INCLUDED_FEATURES      : std_logic_vector(63 downto 0);
+    constant INCLUDED_FEATURES    : std_logic_vector(63 downto 0);
     
     
 end;
@@ -103,6 +120,13 @@ package body config is
                                       HW_INFO_BASE );
   constant CLOCK_FREQUENCY      : integer := CLOCK_FREQUENCY_ARR(USE_120_MHZ);
   constant MEDIA_FREQUENCY      : integer := MEDIA_FREQUENCY_ARR(USE_120_MHZ);
+  
+  constant CFG_MODE             : integer := INCLUDE_GBE;
+  constant INTERFACE_NUM        : integer := INTERFACE_NUM_ARR(CFG_MODE);
+  constant MII_IS_UPLINK            : hub_ct  := IS_UPLINK_ARR(CFG_MODE);
+  constant MII_IS_DOWNLINK          : hub_ct  := IS_DOWNLINK_ARR(CFG_MODE);
+  constant MII_IS_UPLINK_ONLY       : hub_ct  := IS_UPLINK_ONLY_ARR(CFG_MODE); 
+    
 
 function generateIncludedFeatures return std_logic_vector is
   variable t : std_logic_vector(63 downto 0);
@@ -110,9 +134,10 @@ function generateIncludedFeatures return std_logic_vector is
     t               := (others => '0');
     t(63 downto 56) := std_logic_vector(to_unsigned(1,8)); --table version 1
 --     t(16 downto 16) := std_logic_vector(to_unsigned(USE_ETHERNET,1));
-    t(17 downto 17) := std_logic_vector(to_unsigned(INCLUDE_GBE,1)); --sctrl via GbE
+    t(22 downto 17) := "0100111"; --sctrl via GbE
     t(23 downto 23) := std_logic_vector(to_unsigned(INCLUDE_GBE,1));
-    t(26 downto 24) := std_logic_vector(to_unsigned(1,3)); --num SFPs with TrbNet
+    t(28)           := std_logic_vector(to_unsigned(1,1));
+    t(27 downto 24) := std_logic_vector(to_unsigned(2-INCLUDE_GBE,4)); --num SFPs with TrbNet
     t(40 downto 40) := std_logic_vector(to_unsigned(INCLUDE_LCD,1));
     t(42 downto 42) := std_logic_vector(to_unsigned(INCLUDE_SPI,1));
     t(43 downto 43) := std_logic_vector(to_unsigned(INCLUDE_UART,1));
index 4919f8154298527e4988f1e2229eab6840e69d09..b43f22fa4639d0486a4e03a42a539818bf1be00a 100644 (file)
@@ -12,8 +12,8 @@ package config is
 ------------------------------------------------------------------------------
 
 --design options: backplane or front SFP, with or without GBE
-    constant USE_BACKPLANE : integer := c_NO;
-    constant INCLUDE_GBE   : integer := c_NO;
+    constant USE_BACKPLANE : integer := c_YES;
+    constant INCLUDE_GBE   : integer := c_YES;
 
 --Runs with 120 MHz instead of 100 MHz     
     constant USE_120_MHZ            : integer := c_NO; 
@@ -140,9 +140,10 @@ function generateIncludedFeatures return std_logic_vector is
   begin
     t               := (others => '0');
     t(63 downto 56) := std_logic_vector(to_unsigned(1,8)); --table version 1
-    t(17 downto 17) := std_logic_vector(to_unsigned(INCLUDE_GBE,1)); --sctrl via GbE
+    t(22 downto 17) := "0100111"; --sctrl via GbE
     t(23 downto 23) := std_logic_vector(to_unsigned(INCLUDE_GBE,1));
     t(27 downto 24) := std_logic_vector(to_unsigned(INTERFACE_NUM-USE_BACKPLANE,4)); --num SFPs with TrbNet
+    t(28)           := std_logic_vector(to_unsigned(USE_BACKPLANE,1));
     t(40 downto 40) := std_logic_vector(to_unsigned(INCLUDE_LCD,1));
     t(42 downto 42) := std_logic_vector(to_unsigned(INCLUDE_SPI,1));
     t(43 downto 43) := std_logic_vector(to_unsigned(INCLUDE_UART,1));
index b82207e21b9283affa692c8d22626e5c7e31cddb..06d4558492f18558bef0f0f720e3b1dcba7068d2 100644 (file)
@@ -125,7 +125,7 @@ function generateIncludedFeatures return std_logic_vector is
     t(14 downto 12) := std_logic_vector(to_unsigned(RING_BUFFER_SIZE,3));
     t(15)           := '1'; --TDC
     t(17 downto 16) := std_logic_vector(to_unsigned(NUM_TDC_MODULES-1,2));
-    
+    t(28)           := std_logic_vector(to_unsigned(3-SERDES_NUM,1));
     t(40 downto 40) := std_logic_vector(to_unsigned(INCLUDE_LCD,1));
     t(42 downto 42) := std_logic_vector(to_unsigned(INCLUDE_SPI,1));
     t(43 downto 43) := std_logic_vector(to_unsigned(INCLUDE_UART,1));
index 2cb744188b6fcf5abe45a8dc8ae321213f6583eb..147e599ef13243442cdac4ffa24281d4151d679c 100644 (file)
@@ -49,7 +49,7 @@ package config is
     constant BROADCAST_SPECIAL_ADDR : std_logic_vector := x"70";
    
 --set to 0 for backplane serdes, set to 3 for front SFP serdes
-    constant SERDES_NUM             : integer := 0;
+    constant SERDES_NUM             : integer := 3;
     
     constant INCLUDE_UART           : integer  := c_NO;
     constant INCLUDE_SPI            : integer  := c_YES;
@@ -125,7 +125,7 @@ function generateIncludedFeatures return std_logic_vector is
     t(14 downto 12) := std_logic_vector(to_unsigned(RING_BUFFER_SIZE,3));
     t(15)           := '1'; --TDC
     t(17 downto 16) := std_logic_vector(to_unsigned(NUM_TDC_MODULES-1,2));
-    
+    t(28)           := std_logic_vector(to_unsigned(3-SERDES_NUM,1));
     t(40 downto 40) := std_logic_vector(to_unsigned(INCLUDE_LCD,1));
     t(42 downto 42) := std_logic_vector(to_unsigned(INCLUDE_SPI,1));
     t(43 downto 43) := std_logic_vector(to_unsigned(INCLUDE_UART,1));
index 92d55feab44415ec088a3da64c1c2ed7608c6ea6..1fa56affaa5c5cac3aef9e1c4422f97df6eb6147 100644 (file)
@@ -16,6 +16,7 @@ package config is
 
 --Runs with 120 MHz instead of 100 MHz     
     constant USE_120_MHZ            : integer := c_NO; 
+    constant USE_200MHZOSCILLATOR   : integer := c_YES;    
     constant USE_EXTERNAL_CLOCK     : integer := c_YES; --'no' not implemented.
     constant CLOCK_FAST_SELECT        : integer := c_NO; --fast clock select (135us) or slow (280ms)?
     
@@ -27,7 +28,7 @@ package config is
     constant BROADCAST_SPECIAL_ADDR : std_logic_vector := x"60";
    
 --set to 0 for backplane serdes, set to 3 for front SFP serdes
-    constant SERDES_NUM             : integer := 3;
+    constant SERDES_NUM             : integer := 0;
    
     constant INCLUDE_UART           : integer  := c_YES;
     constant INCLUDE_SPI            : integer  := c_YES;
@@ -94,7 +95,7 @@ function generateIncludedFeatures return std_logic_vector is
   begin
     t               := (others => '0');
     t(63 downto 56) := std_logic_vector(to_unsigned(1,8)); --table version 1
-
+    t(28)           := std_logic_vector(to_unsigned(3-SERDES_NUM,1));
     t(40 downto 40) := std_logic_vector(to_unsigned(INCLUDE_LCD,1));
     t(42 downto 42) := std_logic_vector(to_unsigned(INCLUDE_SPI,1));
     t(43 downto 43) := std_logic_vector(to_unsigned(INCLUDE_UART,1));