-
+ 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:
-- 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
------------------------------------------------------------------------------
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;
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);
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));