From 253a54d009784796f6242f426cf32a36ddd46bb8 Mon Sep 17 00:00:00 2001
From: Jan Michel <michel@physik.uni-frankfurt.de>
Date: Thu, 27 Oct 2022 14:54:58 +0200
Subject: [PATCH] add status port to gbe wrapper for possible LED use

---
 gbe_trb/base/gbe_wrapper.vhd                     | 3 ++-
 trb_net16_endpoint_hades_full_gbe.vhd            | 3 ++-
 trb_net16_endpoint_hades_full_handler_record.vhd | 2 ++
 trb_net_components.vhd                           | 4 +++-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/gbe_trb/base/gbe_wrapper.vhd b/gbe_trb/base/gbe_wrapper.vhd
index 4a23493..1faac46 100644
--- a/gbe_trb/base/gbe_wrapper.vhd
+++ b/gbe_trb/base/gbe_wrapper.vhd
@@ -95,7 +95,8 @@ entity gbe_wrapper is
     FWD_FULL_OUT             : out std_logic_vector(NUMBER_OF_GBE_LINKS - 1 downto 0);
 
     MAKE_RESET_OUT           : out std_logic;
-    DEBUG_OUT                : out std_logic_vector(127 downto 0)
+    DEBUG_OUT                : out std_logic_vector(127 downto 0);
+    STATUS_OUT               : out std_logic_vector(15 downto 0)
   );
 end entity gbe_wrapper;
 
diff --git a/trb_net16_endpoint_hades_full_gbe.vhd b/trb_net16_endpoint_hades_full_gbe.vhd
index 41cad6f..ebb099d 100644
--- a/trb_net16_endpoint_hades_full_gbe.vhd
+++ b/trb_net16_endpoint_hades_full_gbe.vhd
@@ -166,6 +166,7 @@ entity trb_net16_endpoint_hades_full_gbe is
     STAT_ONEWIRE              : out std_logic_vector (31 downto 0);
     STAT_ADDR_DEBUG           : out std_logic_vector (15 downto 0);
     STAT_TRIGGER_OUT          : out std_logic_vector (79 downto 0);
+    STATUS_GBE_OUT            : out std_logic_vector (15 downto 0);
     DEBUG_LVL1_HANDLER_OUT    : out std_logic_vector (15 downto 0)
     );
 end trb_net16_endpoint_hades_full_gbe;
@@ -609,7 +610,7 @@ begin
                 
                 MAKE_RESET_OUT           => open,
 
-                DEBUG_OUT                => open
+                STATUS_OUT               => STATUS_GBE_OUT
                 ); 
           end generate;
           gen_no_gbe : if USE_GBE = 0 generate
diff --git a/trb_net16_endpoint_hades_full_handler_record.vhd b/trb_net16_endpoint_hades_full_handler_record.vhd
index 5bd608f..6d718ae 100644
--- a/trb_net16_endpoint_hades_full_handler_record.vhd
+++ b/trb_net16_endpoint_hades_full_handler_record.vhd
@@ -84,6 +84,7 @@ entity trb_net16_endpoint_hades_full_handler_record is
     STAT_ONEWIRE                 : out std_logic_vector (31 downto 0);
     STAT_ADDR_DEBUG              : out std_logic_vector (15 downto 0);
     STAT_TRIGGER_OUT             : out std_logic_vector (79 downto 0);
+    STATUS_GBE_OUT               : out std_logic_vector (15 downto 0);    
     DEBUG_LVL1_HANDLER_OUT       : out std_logic_vector (15 downto 0)
     );
 end entity;
@@ -299,6 +300,7 @@ begin
       STAT_ONEWIRE               => open,
       STAT_ADDR_DEBUG            => open,
       STAT_TRIGGER_OUT           => STAT_TRIGGER_OUT,      
+      STATUS_GBE_OUT             => STATUS_GBE_OUT,
       DEBUG_LVL1_HANDLER_OUT     => DEBUG_LVL1_HANDLER_OUT
       );
 
diff --git a/trb_net_components.vhd b/trb_net_components.vhd
index c0c81c0..113169a 100644
--- a/trb_net_components.vhd
+++ b/trb_net_components.vhd
@@ -113,7 +113,8 @@ component  gbe_wrapper is
     FWD_FULL_OUT : out std_logic_vector(NUMBER_OF_GBE_LINKS - 1 downto 0);
 
 		MAKE_RESET_OUT           : out std_logic;
-		DEBUG_OUT                : out std_logic_vector(127 downto 0)
+		DEBUG_OUT                : out std_logic_vector(127 downto 0);
+		STATUS_OUT               : out std_logic_vector(15 downto 0)
 	);
 end component;
 
@@ -1012,6 +1013,7 @@ component trb_net16_endpoint_hades_full_gbe is
     STAT_ONEWIRE              : out std_logic_vector (31 downto 0);
     STAT_ADDR_DEBUG           : out std_logic_vector (15 downto 0);
     STAT_TRIGGER_OUT          : out std_logic_vector (79 downto 0);
+    STATUS_GBE_OUT            : out std_logic_vector (15 downto 0);    
     DEBUG_LVL1_HANDLER_OUT    : out std_logic_vector (15 downto 0)
     );
 end component;  
-- 
2.43.0