From 85e983d6568d7e3cef0108742ec3c4e7a9f28a6e Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Wed, 19 Nov 2014 12:47:14 +0000
Subject: [PATCH] Use tech_xaui_mosi_addr_w(c_tech_stratixiv) to define
 c_xaui_mosi_addr_w=9.

---
 .../technology/xaui/tech_xaui_component_pkg.vhd    | 14 ++++++++++++++
 libraries/technology/xaui/tech_xaui_stratixiv.vhd  |  9 +++++----
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/libraries/technology/xaui/tech_xaui_component_pkg.vhd b/libraries/technology/xaui/tech_xaui_component_pkg.vhd
index bdadd96f5a..cb3e167e5a 100644
--- a/libraries/technology/xaui/tech_xaui_component_pkg.vhd
+++ b/libraries/technology/xaui/tech_xaui_component_pkg.vhd
@@ -27,6 +27,8 @@ USE technology_lib.technology_pkg.ALL;
 
 PACKAGE tech_xaui_component_pkg IS
 
+  FUNCTION tech_xaui_mosi_addr_w(technology : IN INTEGER) RETURN INTEGER;
+  
   ------------------------------------------------------------------------------
   -- ip_stratixiv
   ------------------------------------------------------------------------------
@@ -234,3 +236,15 @@ PACKAGE tech_xaui_component_pkg IS
   
   
 END tech_xaui_component_pkg;
+
+PACKAGE BODY tech_xaui_component_pkg IS
+
+  FUNCTION tech_xaui_mosi_addr_w(technology : IN INTEGER) RETURN INTEGER IS 
+  BEGIN
+    CASE technology IS
+      WHEN c_tech_stratixiv => RETURN 9;
+      WHEN OTHERS           => RETURN 9;
+    END CASE;
+  END;
+
+END tech_xaui_component_pkg;
diff --git a/libraries/technology/xaui/tech_xaui_stratixiv.vhd b/libraries/technology/xaui/tech_xaui_stratixiv.vhd
index 5b51dd636a..93e242586f 100644
--- a/libraries/technology/xaui/tech_xaui_stratixiv.vhd
+++ b/libraries/technology/xaui/tech_xaui_stratixiv.vhd
@@ -1,6 +1,6 @@
 --------------------------------------------------------------------------------
 --
--- Copyright (C) 2012
+-- 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
@@ -23,11 +23,12 @@
 -- Declare IP libraries to ensure default binding in simulation. The IP library clause is ignored by synthesis.
 LIBRARY ip_stratixiv_transceiver_lib, ip_stratixiv_phy_xaui_lib;
 
-LIBRARY IEEE, common_lib;
+LIBRARY IEEE, technology_lib, common_lib;
 USE IEEE.STD_LOGIC_1164.ALL;
 USE common_lib.common_pkg.ALL;
 USE common_lib.common_mem_pkg.ALL;
 USE common_lib.common_interface_layers_pkg.ALL;
+USE technology_lib.technology_pkg.ALL;
 USE work.tech_xaui_component_pkg.ALL;
 
 ENTITY tech_xaui_stratixiv IS
@@ -65,7 +66,7 @@ ENTITY tech_xaui_stratixiv IS
 END tech_xaui_stratixiv;
 
 
-ARCHITECTURE str OF tech_xaui_stratixiv IS  
+ARCHITECTURE str OF tech_xaui_stratixiv IS
 
   CONSTANT c_reconf_togxb_bus_w         : NATURAL := 4; 
   CONSTANT c_reconf_fromgxb_bus_w       : NATURAL := 17;
@@ -73,7 +74,7 @@ ARCHITECTURE str OF tech_xaui_stratixiv IS
   CONSTANT c_reconf_soft_nof_gx         : NATURAL := 16;                        -- g_nof_xaui=4 soft XAUI, with 16 transceivers requires gxb_reconfig as for 16 transceivers
   CONSTANT c_reconf_soft_fromgxb_bus_w  : NATURAL := 4*c_reconf_fromgxb_bus_w;
 
-  CONSTANT c_xaui_mosi_addr_w           : NATURAL := 9;
+  CONSTANT c_xaui_mosi_addr_w           : NATURAL := tech_xaui_mosi_addr_w(c_tech_stratixiv);
 
   SIGNAL reconfig_togxb            : STD_LOGIC_VECTOR(c_reconf_togxb_bus_w-1 DOWNTO 0);
   SIGNAL reconfig_fromgxb          : STD_LOGIC_VECTOR(c_reconf_fromgxb_bus_w-1 DOWNTO 0); 
-- 
GitLab