From ec322aa638761bd11d841aa62336ba5894d2998d Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Fri, 13 Feb 2015 07:57:42 +0000
Subject: [PATCH] Added constants and record for MM rgeister of diag sequence
 tx/rx to diag_pkg.vhd.

---
 libraries/base/diag/hdllib.cfg            |  2 +-
 libraries/base/diag/src/vhdl/diag_pkg.vhd | 24 ++++++++++++++++++++---
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/libraries/base/diag/hdllib.cfg b/libraries/base/diag/hdllib.cfg
index 0708b35628..183673dc4e 100644
--- a/libraries/base/diag/hdllib.cfg
+++ b/libraries/base/diag/hdllib.cfg
@@ -9,7 +9,7 @@ build_dir_sim = $HDL_BUILD_DIR
 build_dir_synth = $HDL_BUILD_DIR
 
 synth_files =
-    $UNB/Firmware/modules/Lofar/diag/src/vhdl/diag_pkg.vhd
+    src/vhdl/diag_pkg.vhd
     $UNB/Firmware/modules/Lofar/diag/src/vhdl/diag_bypass.vhd
     src/vhdl/diag_tx_seq.vhd
     $UNB/Firmware/modules/Lofar/diag/src/vhdl/diag_tx_frm.vhd
diff --git a/libraries/base/diag/src/vhdl/diag_pkg.vhd b/libraries/base/diag/src/vhdl/diag_pkg.vhd
index 16d927402f..c24f0aaa65 100644
--- a/libraries/base/diag/src/vhdl/diag_pkg.vhd
+++ b/libraries/base/diag/src/vhdl/diag_pkg.vhd
@@ -143,6 +143,27 @@ PACKAGE diag_pkg IS
     e_imag
   );        
   
+  -----------------------------------------------------------------------------
+  -- CNTR / PSRG sequence test data
+  -----------------------------------------------------------------------------
+  
+  CONSTANT c_diag_seq_tx_reg_nof_dat : NATURAL := 3;
+  CONSTANT c_diag_seq_tx_reg_adr_w   : NATURAL := ceil_log2(c_diag_seq_tx_reg_nof_dat);
+  CONSTANT c_diag_seq_rx_reg_nof_dat : NATURAL := 3;
+  CONSTANT c_diag_seq_rx_reg_adr_w   : NATURAL := ceil_log2(c_diag_seq_rx_reg_nof_dat);
+  
+  -- Record with all diag seq MM register fields
+  TYPE t_diag_seq_mm_reg IS RECORD
+    tx_init   : STD_LOGIC_VECTOR(c_word_w -1 DOWNTO 0);  -- readback ctrl
+    tx_ctrl   : STD_LOGIC_VECTOR(c_word_w -1 DOWNTO 0);
+    rx_ctrl   : STD_LOGIC_VECTOR(c_word_w -1 DOWNTO 0);
+    tx_cnt    : STD_LOGIC_VECTOR(c_word_w -1 DOWNTO 0);  -- read cnt and stat
+    rx_cnt    : STD_LOGIC_VECTOR(c_word_w -1 DOWNTO 0);
+    rx_stat   : STD_LOGIC_VECTOR(c_word_w -1 DOWNTO 0);
+  END RECORD;  
+
+  TYPE t_diag_seq_mm_reg_arr IS ARRAY (INTEGER RANGE <>) OF t_diag_seq_mm_reg;
+  
 END diag_pkg;
 
 PACKAGE BODY diag_pkg IS
@@ -157,6 +178,3 @@ PACKAGE BODY diag_pkg IS
   END;
 
 END diag_pkg;
-
-
-
-- 
GitLab