From 6d1c17a8c8077a6e16262dd40071b7fc2e5fcc57 Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Wed, 19 Nov 2014 13:09:45 +0000
Subject: [PATCH] Moved constants and fucntions from tech_mac_10g_pkg.vhd to
 tech_mac_10g_component_pkg.vhd.

---
 libraries/technology/mac_10g/hdllib.cfg       |  1 -
 .../technology/mac_10g/tb_tech_mac_10g.vhd    |  2 +-
 .../mac_10g/tb_tech_mac_10g_pkg.vhd           |  2 +-
 libraries/technology/mac_10g/tech_mac_10g.vhd |  2 +-
 .../mac_10g/tech_mac_10g_arria10.vhd          |  1 -
 .../mac_10g/tech_mac_10g_component_pkg.vhd    | 36 ++++++++++-
 .../technology/mac_10g/tech_mac_10g_pkg.vhd   | 61 -------------------
 .../mac_10g/tech_mac_10g_stratixiv.vhd        |  1 -
 8 files changed, 37 insertions(+), 69 deletions(-)
 delete mode 100644 libraries/technology/mac_10g/tech_mac_10g_pkg.vhd

diff --git a/libraries/technology/mac_10g/hdllib.cfg b/libraries/technology/mac_10g/hdllib.cfg
index 2a92142f94..4cc05d9e23 100644
--- a/libraries/technology/mac_10g/hdllib.cfg
+++ b/libraries/technology/mac_10g/hdllib.cfg
@@ -8,7 +8,6 @@ build_dir_synth = $HDL_BUILD_DIR
 
 synth_files =
     tech_mac_10g_component_pkg.vhd
-    tech_mac_10g_pkg.vhd
     tech_mac_10g_stratixiv.vhd
     tech_mac_10g_arria10.vhd
     tech_mac_10g.vhd
diff --git a/libraries/technology/mac_10g/tb_tech_mac_10g.vhd b/libraries/technology/mac_10g/tb_tech_mac_10g.vhd
index 1f85e4e564..190ce4cb9d 100644
--- a/libraries/technology/mac_10g/tb_tech_mac_10g.vhd
+++ b/libraries/technology/mac_10g/tb_tech_mac_10g.vhd
@@ -40,7 +40,7 @@ USE common_lib.tb_common_pkg.ALL;
 USE dp_lib.dp_stream_pkg.ALL;
 USE technology_lib.technology_pkg.ALL;
 USE technology_lib.technology_select_pkg.ALL;
-USE WORK.tech_mac_10g_pkg.ALL;
+USE WORK.tech_mac_10g_component_pkg.ALL;
 USE WORK.tb_tech_mac_10g_pkg.ALL;
 
 
diff --git a/libraries/technology/mac_10g/tb_tech_mac_10g_pkg.vhd b/libraries/technology/mac_10g/tb_tech_mac_10g_pkg.vhd
index 9eb01ae7a8..ab7b63de79 100644
--- a/libraries/technology/mac_10g/tb_tech_mac_10g_pkg.vhd
+++ b/libraries/technology/mac_10g/tb_tech_mac_10g_pkg.vhd
@@ -32,7 +32,7 @@ USE common_lib.tb_common_pkg.ALL;
 USE dp_lib.dp_stream_pkg.ALL;
 USE dp_lib.tb_dp_pkg.ALL;
 USE technology_lib.technology_pkg.ALL;
-USE work.tech_mac_10g_pkg.ALL;
+USE work.tech_mac_10g_component_pkg.ALL;
 
 
 PACKAGE tb_tech_mac_10g_pkg IS
diff --git a/libraries/technology/mac_10g/tech_mac_10g.vhd b/libraries/technology/mac_10g/tech_mac_10g.vhd
index 2e15e77901..bcb43e372d 100644
--- a/libraries/technology/mac_10g/tech_mac_10g.vhd
+++ b/libraries/technology/mac_10g/tech_mac_10g.vhd
@@ -65,7 +65,7 @@ USE common_lib.common_mem_pkg.ALL;
 USE common_lib.common_interface_layers_pkg.ALL;
 USE common_lib.common_network_total_header_pkg.ALL;
 USE dp_lib.dp_stream_pkg.ALL;
-USE work.tech_mac_10g_pkg.ALL;
+USE work.tech_mac_10g_component_pkg.ALL;
 
 ENTITY tech_mac_10g IS
   GENERIC (
diff --git a/libraries/technology/mac_10g/tech_mac_10g_arria10.vhd b/libraries/technology/mac_10g/tech_mac_10g_arria10.vhd
index f206d62ef1..fa6395bc28 100644
--- a/libraries/technology/mac_10g/tech_mac_10g_arria10.vhd
+++ b/libraries/technology/mac_10g/tech_mac_10g_arria10.vhd
@@ -31,7 +31,6 @@ USE common_lib.common_interface_layers_pkg.ALL;
 USE dp_lib.dp_stream_pkg.ALL;
 USE technology_lib.technology_pkg.ALL;
 USE work.tech_mac_10g_component_pkg.ALL;
-USE work.tech_mac_10g_pkg.ALL;
 
 ENTITY tech_mac_10g_arria10 IS
   PORT (
diff --git a/libraries/technology/mac_10g/tech_mac_10g_component_pkg.vhd b/libraries/technology/mac_10g/tech_mac_10g_component_pkg.vhd
index 2ec8cf8a8f..3e38fb9204 100644
--- a/libraries/technology/mac_10g/tech_mac_10g_component_pkg.vhd
+++ b/libraries/technology/mac_10g/tech_mac_10g_component_pkg.vhd
@@ -22,11 +22,28 @@
 
 -- Purpose: IP components declarations for various devices that get wrapped by the tech components
 
-LIBRARY IEEE;
-USE IEEE.STD_LOGIC_1164.ALL;
+LIBRARY IEEE, technology_lib, common_lib;
+USE IEEE.std_logic_1164.ALL;
+USE common_lib.common_pkg.ALL;
+USE common_lib.common_interface_layers_pkg.ALL;
+USE technology_lib.technology_pkg.ALL;
 
 PACKAGE tech_mac_10g_component_pkg IS
 
+  FUNCTION func_tech_mac_10g_csr_addr_w(c_technology : NATURAL) RETURN NATURAL;
+  
+  CONSTANT c_tech_mac_10g_data_w               : NATURAL := c_xgmii_data_w;  -- = 64
+
+  CONSTANT c_tech_mac_10g_symbol_w             : NATURAL := c_byte_w;                                         -- = 8 bit
+  CONSTANT c_tech_mac_10g_symbols_per_beat     : NATURAL := c_tech_mac_10g_data_w / c_tech_mac_10g_symbol_w;  -- = 8 symbols
+
+  CONSTANT c_tech_mac_10g_empty_w              : NATURAL := 3;
+  CONSTANT c_tech_mac_10g_tx_error_w           : NATURAL := 1;
+  CONSTANT c_tech_mac_10g_rx_error_w           : NATURAL := 6;
+  
+  CONSTANT c_tech_mac_10g_tx_fifo_depth        : NATURAL := 256;  -- nof words for Tx FIFO
+  CONSTANT c_tech_mac_10g_rx_fifo_depth        : NATURAL := 256;  -- nof words for Rx FIFO
+
   ------------------------------------------------------------------------------
   -- ip_stratixiv
   ------------------------------------------------------------------------------
@@ -125,3 +142,18 @@ PACKAGE tech_mac_10g_component_pkg IS
   END COMPONENT;
   
 END tech_mac_10g_component_pkg;
+
+PACKAGE BODY tech_mac_10g_component_pkg IS
+
+  FUNCTION func_tech_mac_10g_csr_addr_w(c_technology : NATURAL) RETURN NATURAL IS
+    VARIABLE v_csr_addr_w : NATURAL;
+  BEGIN
+    CASE c_technology IS
+      WHEN c_tech_stratixiv => v_csr_addr_w := 13;
+      WHEN c_tech_arria10   => v_csr_addr_w := 13;  -- 13 with INSERT_CSR_ADAPTOR=1 in ip_arria10_mac_10g.qsys, 10 without
+      WHEN OTHERS           => v_csr_addr_w := 13;  -- default to c_tech_stratixiv
+    END CASE;
+    RETURN v_csr_addr_w; 
+  END func_tech_mac_10g_csr_addr_w;
+
+END tech_mac_10g_component_pkg;
diff --git a/libraries/technology/mac_10g/tech_mac_10g_pkg.vhd b/libraries/technology/mac_10g/tech_mac_10g_pkg.vhd
deleted file mode 100644
index a5a0588ba2..0000000000
--- a/libraries/technology/mac_10g/tech_mac_10g_pkg.vhd
+++ /dev/null
@@ -1,61 +0,0 @@
--------------------------------------------------------------------------------
---
--- Copyright (C) 2014
--- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
--- JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>
--- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program.  If not, see <http://www.gnu.org/licenses/>.
---
--------------------------------------------------------------------------------
-
-LIBRARY IEEE, technology_lib, common_lib;
-USE IEEE.std_logic_1164.ALL;
-USE common_lib.common_pkg.ALL;
-USE common_lib.common_interface_layers_pkg.ALL;
-USE technology_lib.technology_pkg.ALL;
-
-PACKAGE tech_mac_10g_pkg IS
-
-  FUNCTION func_tech_mac_10g_csr_addr_w(c_technology : NATURAL) RETURN NATURAL;
-  
-  CONSTANT c_tech_mac_10g_data_w               : NATURAL := c_xgmii_data_w;  -- = 64
-
-  CONSTANT c_tech_mac_10g_symbol_w             : NATURAL := c_byte_w;                                         -- = 8 bit
-  CONSTANT c_tech_mac_10g_symbols_per_beat     : NATURAL := c_tech_mac_10g_data_w / c_tech_mac_10g_symbol_w;  -- = 8 symbols
-
-  CONSTANT c_tech_mac_10g_empty_w              : NATURAL := 3;
-  CONSTANT c_tech_mac_10g_tx_error_w           : NATURAL := 1;
-  CONSTANT c_tech_mac_10g_rx_error_w           : NATURAL := 6;
-  
-  CONSTANT c_tech_mac_10g_tx_fifo_depth        : NATURAL := 256;  -- nof words for Tx FIFO
-  CONSTANT c_tech_mac_10g_rx_fifo_depth        : NATURAL := 256;  -- nof words for Rx FIFO
-
-END tech_mac_10g_pkg;
-
-
-PACKAGE BODY tech_mac_10g_pkg IS
-
-  FUNCTION func_tech_mac_10g_csr_addr_w(c_technology : NATURAL) RETURN NATURAL IS
-    VARIABLE v_csr_addr_w : NATURAL;
-  BEGIN
-    CASE c_technology IS
-      WHEN c_tech_stratixiv => v_csr_addr_w := 13;
-      WHEN c_tech_arria10   => v_csr_addr_w := 13;  -- 13 with INSERT_CSR_ADAPTOR=1 in ip_arria10_mac_10g.qsys, 10 without
-      WHEN OTHERS           => v_csr_addr_w := 13;  -- default to c_tech_stratixiv
-    END CASE;
-    RETURN v_csr_addr_w; 
-  END func_tech_mac_10g_csr_addr_w;
-  
-END tech_mac_10g_pkg;
diff --git a/libraries/technology/mac_10g/tech_mac_10g_stratixiv.vhd b/libraries/technology/mac_10g/tech_mac_10g_stratixiv.vhd
index 640c6bfa9c..b087325a7b 100644
--- a/libraries/technology/mac_10g/tech_mac_10g_stratixiv.vhd
+++ b/libraries/technology/mac_10g/tech_mac_10g_stratixiv.vhd
@@ -31,7 +31,6 @@ USE common_lib.common_interface_layers_pkg.ALL;
 USE dp_lib.dp_stream_pkg.ALL;
 USE technology_lib.technology_pkg.ALL;
 USE work.tech_mac_10g_component_pkg.ALL;
-USE work.tech_mac_10g_pkg.ALL;
 
 ENTITY tech_mac_10g_stratixiv IS
 	PORT (
-- 
GitLab