From ed138b8042d99e6e8b4c849077c5a7548dcbd57e Mon Sep 17 00:00:00 2001
From: Pepping <pepping>
Date: Mon, 16 Feb 2015 10:19:43 +0000
Subject: [PATCH] Initial

---
 .../src/vhdl/mmm_unb1_fn_terminal_db.vhd      | 401 ++++++++++++++++++
 1 file changed, 401 insertions(+)
 create mode 100644 boards/uniboard1/designs/unb1_fn_terminal_db/src/vhdl/mmm_unb1_fn_terminal_db.vhd

diff --git a/boards/uniboard1/designs/unb1_fn_terminal_db/src/vhdl/mmm_unb1_fn_terminal_db.vhd b/boards/uniboard1/designs/unb1_fn_terminal_db/src/vhdl/mmm_unb1_fn_terminal_db.vhd
new file mode 100644
index 0000000000..76ebefd9d4
--- /dev/null
+++ b/boards/uniboard1/designs/unb1_fn_terminal_db/src/vhdl/mmm_unb1_fn_terminal_db.vhd
@@ -0,0 +1,401 @@
+------------------------------------------------------------------------------
+--
+-- Copyright (C) 2011
+-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.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, common_lib, unb1_board_lib, mm_lib, eth_lib, technology_lib, tech_tse_lib;
+USE IEEE.STD_LOGIC_1164.ALL;
+USE IEEE.NUMERIC_STD.ALL;
+USE common_lib.common_pkg.ALL;
+USE common_lib.common_mem_pkg.ALL;
+USE common_lib.tb_common_mem_pkg.ALL;
+USE common_lib.common_network_layers_pkg.ALL;
+USE common_lib.common_network_total_header_pkg.ALL;
+USE unb1_board_lib.unb1_board_pkg.ALL;
+USE unb1_board_lib.unb1_board_peripherals_pkg.ALL;
+USE mm_lib.mm_file_pkg.ALL;
+USE mm_lib.mm_file_unb_pkg.ALL;
+USE eth_lib.eth_pkg.ALL; 
+USE technology_lib.technology_pkg.ALL;
+USE tech_tse_lib.tech_tse_pkg.ALL;
+USE tech_tse_lib.tb_tech_tse_pkg.ALL;
+
+ENTITY mmm_unb1_fn_terminal_db IS
+  GENERIC (
+    g_sim         : BOOLEAN := FALSE; --FALSE: use SOPC; TRUE: use mm_file I/O
+    g_sim_unb_nr  : NATURAL := 0;
+    g_sim_node_nr : NATURAL := 0
+  );
+  PORT (
+    xo_clk                      : IN  STD_LOGIC;
+    xo_rst_n                    : IN  STD_LOGIC;
+    xo_rst                      : IN  STD_LOGIC;
+                                
+    mm_rst                      : IN  STD_LOGIC;
+    mm_clk                      : OUT STD_LOGIC;
+    mm_locked                   : OUT STD_LOGIC;
+    cal_clk                     : OUT STD_LOGIC;
+                                
+    pout_wdi                    : OUT STD_LOGIC;
+    pin_pps                     : IN  STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0);
+    
+    -- Interfaces to ctrl_unb1_board                            
+    -- Manual WDI override      
+    reg_wdi_mosi                : OUT t_mem_mosi;
+    reg_wdi_miso                : IN  t_mem_miso;
+                                
+    -- system_info              
+    reg_unb_system_info_mosi    : OUT t_mem_mosi;
+    reg_unb_system_info_miso    : IN  t_mem_miso;
+    rom_unb_system_info_mosi    : OUT t_mem_mosi;
+    rom_unb_system_info_miso    : IN  t_mem_miso;
+                                
+    -- UniBoard I2C sensors     
+    reg_unb_sens_mosi           : OUT t_mem_mosi; 
+    reg_unb_sens_miso           : IN  t_mem_miso; 
+
+    -- eth1g
+    eth1g_tse_clk               : OUT STD_LOGIC;
+    eth1g_mm_rst                : OUT STD_LOGIC;
+    eth1g_tse_mosi              : OUT t_mem_mosi;  
+    eth1g_tse_miso              : IN  t_mem_miso;  
+    eth1g_reg_mosi              : OUT t_mem_mosi;  
+    eth1g_reg_miso              : IN  t_mem_miso;  
+    eth1g_reg_interrupt         : IN  STD_LOGIC; 
+    eth1g_ram_mosi              : OUT t_mem_mosi;  
+    eth1g_ram_miso              : IN  t_mem_miso; 
+
+    -- . tr_nonbonded
+    reg_tr_nonbonded_mosi       : OUT t_mem_mosi;
+    reg_tr_nonbonded_miso       : IN  t_mem_miso;
+    reg_diagnostics_mosi        : OUT t_mem_mosi;
+    reg_diagnostics_miso        : IN  t_mem_miso;
+                                
+    -- . diag_data_buffer       
+    ram_diag_data_buf_mosi      : OUT t_mem_mosi;
+    ram_diag_data_buf_miso      : IN  t_mem_miso;
+    reg_diag_data_buf_mosi      : OUT t_mem_mosi;
+    reg_diag_data_buf_miso      : IN  t_mem_miso;
+    
+    -- . diag_data_buffer_mesh
+    ram_mesh_diag_data_buf_mosi : OUT t_mem_mosi;
+    ram_mesh_diag_data_buf_miso : IN  t_mem_miso;
+    
+    -- . bsn_monitor
+    reg_bsn_monitor_mosi        : OUT t_mem_mosi;
+    reg_bsn_monitor_miso        : IN  t_mem_miso
+
+  );
+END mmm_unb1_fn_terminal_db;
+
+
+ARCHITECTURE str OF mmm_unb1_fn_terminal_db IS
+
+
+   -- Simulation
+  CONSTANT c_mm_clk_period   : TIME := 100 ps;
+  CONSTANT c_tse_clk_period  : TIME := 8 ns;
+
+  CONSTANT c_sim_node_type : STRING(1 TO 2):= sel_a_b(g_sim_node_nr<4, "FN", "BN");
+  CONSTANT c_sim_node_nr   : NATURAL := sel_a_b(c_sim_node_type="BN", g_sim_node_nr-4, g_sim_node_nr);
+
+  SIGNAL i_mm_clk  : STD_LOGIC := '1';
+  SIGNAL i_tse_clk : STD_LOGIC := '1';
+  
+  ----------------------------------------------------------------------------
+  -- mm_file component
+  ----------------------------------------------------------------------------
+  COMPONENT mm_file
+  GENERIC(
+    g_file_prefix       : STRING;
+    g_mm_clk_period     : TIME := c_mm_clk_period;
+    g_update_on_change  : BOOLEAN := FALSE;
+    g_mm_rd_latency     : NATURAL := 1
+  );
+  PORT (
+    mm_rst        : IN  STD_LOGIC;
+    mm_clk        : IN  STD_LOGIC;
+    mm_master_out : OUT t_mem_mosi;
+    mm_master_in  : IN  t_mem_miso 
+  );
+  END COMPONENT;               
+
+  CONSTANT c_dut_src_mac           : STD_LOGIC_VECTOR(c_network_eth_mac_slv'RANGE) := X"002286080001";
+  SIGNAL eth_psc_access            : STD_LOGIC;
+                                   
+                                   
+  SIGNAL reg_ppsh_mosi             : t_mem_mosi := c_mem_mosi_rst;
+  SIGNAL reg_ppsh_miso             : t_mem_miso := c_mem_miso_rst;
+                                   
+  SIGNAL i_eth1g_reg_mosi          : t_mem_mosi;
+  SIGNAL i_eth1g_reg_miso          : t_mem_miso;
+                                   
+  SIGNAL eth1g_reg_proc_mosi       : t_mem_mosi;
+  SIGNAL eth1g_reg_proc_miso       : t_mem_miso;
+
+  CONSTANT c_sim_eth_src_mac       : STD_LOGIC_VECTOR(c_network_eth_mac_slv'RANGE) := X"00228608" & TO_UVEC(g_sim_unb_nr, c_byte_w) & TO_UVEC(g_sim_node_nr, c_byte_w);
+  CONSTANT c_sim_eth_control_rx_en : NATURAL := 2**c_eth_mm_reg_control_bi.rx_en;
+
+  SIGNAL sim_eth_mm_bus_switch     : STD_LOGIC;
+  SIGNAL sim_eth_psc_access        : STD_LOGIC;
+                                   
+  SIGNAL sim_eth1g_reg_mosi        : t_mem_mosi;
+
+
+BEGIN
+
+  mm_clk        <= i_mm_clk;
+  eth1g_tse_clk <= i_tse_clk;
+
+  ----------------------------------------------------------------------------
+  -- MM <-> file I/O for simulation. The files are created in $UPE/sim.
+  ----------------------------------------------------------------------------
+  gen_mm_file_io : IF g_sim = TRUE GENERATE
+
+    i_mm_clk  <= NOT i_mm_clk AFTER c_mm_clk_period/2;
+    mm_locked <= '0', '1' AFTER c_mm_clk_period*5;
+
+    i_tse_clk    <= NOT i_tse_clk AFTER c_tse_clk_period/2;
+    eth1g_mm_rst <= '1', '0' AFTER c_tse_clk_period*5;
+
+    u_mm_file_reg_unb_system_info    : mm_file GENERIC MAP(mmf_unb_file_prefix(g_sim_unb_nr, c_sim_node_nr, c_sim_node_type) & "PIO_SYSTEM_INFO")
+                                                  PORT MAP(mm_rst, i_mm_clk, reg_unb_system_info_mosi, reg_unb_system_info_miso );
+                                     
+    u_mm_file_rom_unb_system_info    : mm_file GENERIC MAP(mmf_unb_file_prefix(g_sim_unb_nr, c_sim_node_nr, c_sim_node_type) & "ROM_SYSTEM_INFO")
+                                                  PORT MAP(mm_rst, i_mm_clk, rom_unb_system_info_mosi, rom_unb_system_info_miso );
+                                     
+    u_mm_file_reg_wdi                : mm_file GENERIC MAP(mmf_unb_file_prefix(g_sim_unb_nr, c_sim_node_nr, c_sim_node_type) & "REG_WDI")
+                                                  PORT MAP(mm_rst, i_mm_clk, reg_wdi_mosi, reg_wdi_miso );
+                                     
+    u_mm_file_reg_unb_sens           : mm_file GENERIC MAP(mmf_unb_file_prefix(g_sim_unb_nr, c_sim_node_nr, c_sim_node_type) & "REG_UNB_SENS")
+                                                  PORT MAP(mm_rst, i_mm_clk, reg_unb_sens_mosi, reg_unb_sens_miso );
+                                     
+    u_mm_file_reg_eth                : mm_file GENERIC MAP(mmf_unb_file_prefix(g_sim_unb_nr, c_sim_node_nr, c_sim_node_type) & "AVS_ETH_0_MMS_REG")
+                                                  PORT MAP(mm_rst, i_mm_clk, i_eth1g_reg_mosi, eth1g_reg_miso );
+                                     
+    u_mm_file_reg_tr_nonbonded       : mm_file GENERIC MAP(mmf_unb_file_prefix(g_sim_unb_nr, c_sim_node_nr, c_sim_node_type) & "REG_TR_NONBONDED")
+                                                  PORT MAP(mm_rst, i_mm_clk, reg_tr_nonbonded_mosi, reg_tr_nonbonded_miso );
+                                     
+    u_mm_file_reg_diagnostics        : mm_file GENERIC MAP(mmf_unb_file_prefix(g_sim_unb_nr, c_sim_node_nr, c_sim_node_type) & "REG_DIAGNOSTICS")
+                                                  PORT MAP(mm_rst, i_mm_clk, reg_diagnostics_mosi, reg_diagnostics_miso );
+                                     
+    u_mm_file_ram_diag_data_buf      : mm_file GENERIC MAP(mmf_unb_file_prefix(g_sim_unb_nr, c_sim_node_nr, c_sim_node_type) & "RAM_DIAG_DATA_BUFFER")
+                                                  PORT MAP(mm_rst, i_mm_clk, ram_diag_data_buf_mosi, ram_diag_data_buf_miso);
+                                     
+    u_mm_file_reg_diag_data_buf      : mm_file GENERIC MAP(mmf_unb_file_prefix(g_sim_unb_nr, c_sim_node_nr, c_sim_node_type) & "REG_DIAG_DATA_BUFFER")
+                                                  PORT MAP(mm_rst, i_mm_clk, reg_diag_data_buf_mosi, reg_diag_data_buf_miso);
+
+    u_mm_file_ram_diag_data_buf_mesh : mm_file GENERIC MAP(mmf_unb_file_prefix(g_sim_unb_nr, c_sim_node_nr, c_sim_node_type) & "RAM_DIAG_DATA_BUFFER_MESH")
+                                                  PORT MAP(mm_rst, i_mm_clk, ram_mesh_diag_data_buf_mosi, ram_mesh_diag_data_buf_miso);
+                                         
+    u_mm_file_reg_bsn_monitor        : mm_file GENERIC MAP(mmf_unb_file_prefix(g_sim_unb_nr, c_sim_node_nr, c_sim_node_type) & "REG_BSN_MONITOR")
+                                                  PORT MAP(mm_rst, i_mm_clk, reg_bsn_monitor_mosi, reg_bsn_monitor_miso );
+
+    ----------------------------------------------------------------------------
+    -- 1GbE setup sequence normally performed by unb_os@NIOS
+    ----------------------------------------------------------------------------
+    p_eth_setup : PROCESS
+    BEGIN
+      sim_eth_mm_bus_switch <= '1';
+
+      eth1g_tse_mosi.wr <= '0';
+      eth1g_tse_mosi.rd <= '0';
+      WAIT FOR 400 ns;
+      WAIT UNTIL rising_edge(i_mm_clk);
+      proc_tech_tse_setup(c_tech_stratixiv, FALSE, c_tech_tse_tx_fifo_depth, c_tech_tse_rx_fifo_depth, c_tech_tse_tx_ready_latency, c_sim_eth_src_mac, sim_eth_psc_access, i_mm_clk, eth1g_tse_miso, eth1g_tse_mosi);
+
+      -- Enable RX
+      proc_mem_mm_bus_wr(c_eth_reg_control_wi+0, c_sim_eth_control_rx_en, i_mm_clk, eth1g_reg_miso, sim_eth1g_reg_mosi);  -- control rx en
+      sim_eth_mm_bus_switch <= '0';
+
+      WAIT;
+    END PROCESS;
+
+    p_switch : PROCESS(sim_eth_mm_bus_switch, sim_eth1g_reg_mosi, i_eth1g_reg_mosi)
+    BEGIN
+      IF sim_eth_mm_bus_switch = '1' THEN
+          eth1g_reg_mosi <= sim_eth1g_reg_mosi;
+        ELSE
+          eth1g_reg_mosi <= i_eth1g_reg_mosi;
+        END IF;
+    END PROCESS;
+
+    ----------------------------------------------------------------------------
+    -- Procedure that polls a sim control file that can be used to e.g. get
+    -- the simulation time in ns
+    ----------------------------------------------------------------------------
+    mmf_poll_sim_ctrl_file(c_mmf_unb_file_path & "sim.ctrl", c_mmf_unb_file_path & "sim.stat");
+
+  END GENERATE;
+
+  -----------------------------------------------------------------------------
+  -- SOPC system
+  -----------------------------------------------------------------------------
+  ----------------------------------------------------------------------------
+  -- SOPC for synthesis
+  ----------------------------------------------------------------------------
+  gen_sopc : IF g_sim = FALSE GENERATE
+    u_sopc : ENTITY work.sopc_unb1_fn_terminal_db
+    PORT MAP (
+      -- 1) global signals:
+      clk_0                                                   => xo_clk,        -- PLL reference = 25 MHz from ETH_clk pin
+      reset_n                                                 => xo_rst_n,
+      mm_clk                                                  => i_mm_clk,      -- PLL clk[0] = 125 MHz system clock that the NIOS2 and the MM bus run on
+      cal_clk                                                 => cal_clk,       -- PLL clk[1] =  40 MHz calibration clock for the IO reconfiguration
+      tse_clk                                                 => i_tse_clk,     -- PLL clk[2] = 125 MHz dedicated clock for the 1 Gbit Ethernet unit
+  
+      -- the_altpll_0
+      areset_to_the_altpll_0                                  => '0',
+      locked_from_the_altpll_0                                => mm_locked,
+      phasedone_from_the_altpll_0                             => OPEN,
+  
+      -- the_avs_eth_0
+      coe_clk_export_from_the_avs_eth_0                       => OPEN,
+      coe_reset_export_from_the_avs_eth_0                     => eth1g_mm_rst,
+      coe_tse_address_export_from_the_avs_eth_0               => eth1g_tse_mosi.address(c_unb1_board_peripherals_mm_reg_default.reg_tse_adr_w-1 DOWNTO 0),
+      coe_tse_write_export_from_the_avs_eth_0                 => eth1g_tse_mosi.wr,
+      coe_tse_writedata_export_from_the_avs_eth_0             => eth1g_tse_mosi.wrdata(c_word_w-1 DOWNTO 0),
+      coe_tse_read_export_from_the_avs_eth_0                  => eth1g_tse_mosi.rd,
+      coe_tse_readdata_export_to_the_avs_eth_0                => eth1g_tse_miso.rddata(c_word_w-1 DOWNTO 0),
+      coe_tse_waitrequest_export_to_the_avs_eth_0             => eth1g_tse_miso.waitrequest,
+      coe_reg_address_export_from_the_avs_eth_0               => eth1g_reg_mosi.address(c_unb1_board_peripherals_mm_reg_default.reg_eth_adr_w-1 DOWNTO 0),
+      coe_reg_write_export_from_the_avs_eth_0                 => eth1g_reg_mosi.wr,
+      coe_reg_writedata_export_from_the_avs_eth_0             => eth1g_reg_mosi.wrdata(c_word_w-1 DOWNTO 0),
+      coe_reg_read_export_from_the_avs_eth_0                  => eth1g_reg_mosi.rd,
+      coe_reg_readdata_export_to_the_avs_eth_0                => eth1g_reg_miso.rddata(c_word_w-1 DOWNTO 0),
+      coe_irq_export_to_the_avs_eth_0                         => eth1g_reg_interrupt,
+      coe_ram_address_export_from_the_avs_eth_0               => eth1g_ram_mosi.address(c_unb1_board_peripherals_mm_reg_default.ram_eth_adr_w-1 DOWNTO 0),
+      coe_ram_write_export_from_the_avs_eth_0                 => eth1g_ram_mosi.wr,
+      coe_ram_writedata_export_from_the_avs_eth_0             => eth1g_ram_mosi.wrdata(c_word_w-1 DOWNTO 0),
+      coe_ram_read_export_from_the_avs_eth_0                  => eth1g_ram_mosi.rd,
+      coe_ram_readdata_export_to_the_avs_eth_0                => eth1g_ram_miso.rddata(c_word_w-1 DOWNTO 0),
+  
+      -- the_reg_unb_sens
+      coe_address_export_from_the_reg_unb_sens                => reg_unb_sens_mosi.address(c_unb1_board_peripherals_mm_reg_default.reg_unb_sens_adr_w-1 DOWNTO 0),
+      coe_clk_export_from_the_reg_unb_sens                    => OPEN,
+      coe_read_export_from_the_reg_unb_sens                   => reg_unb_sens_mosi.rd,
+      coe_readdata_export_to_the_reg_unb_sens                 => reg_unb_sens_miso.rddata(c_word_w-1 DOWNTO 0),
+      coe_reset_export_from_the_reg_unb_sens                  => OPEN,
+      coe_write_export_from_the_reg_unb_sens                  => reg_unb_sens_mosi.wr,
+      coe_writedata_export_from_the_reg_unb_sens              => reg_unb_sens_mosi.wrdata(c_word_w-1 DOWNTO 0),
+  
+      -- the_reg_tr_nonbonded_mesh
+      coe_address_export_from_the_reg_tr_nonbonded_mesh       => reg_tr_nonbonded_mosi.address(c_unb1_board_peripherals_mm_reg_default.reg_tr_nonbonded_adr_w-1 DOWNTO 0),
+      coe_clk_export_from_the_reg_tr_nonbonded_mesh           => OPEN,
+      coe_read_export_from_the_reg_tr_nonbonded_mesh          => reg_tr_nonbonded_mosi.rd,
+      coe_readdata_export_to_the_reg_tr_nonbonded_mesh        => reg_tr_nonbonded_miso.rddata(c_word_w-1 DOWNTO 0),
+      coe_reset_export_from_the_reg_tr_nonbonded_mesh         => OPEN,
+      coe_write_export_from_the_reg_tr_nonbonded_mesh         => reg_tr_nonbonded_mosi.wr,
+      coe_writedata_export_from_the_reg_tr_nonbonded_mesh     => reg_tr_nonbonded_mosi.wrdata(c_word_w-1 DOWNTO 0),
+  
+      -- the_reg_diagnostics_mesh
+      coe_address_export_from_the_reg_diagnostics_mesh        => reg_diagnostics_mosi.address(c_unb1_board_peripherals_mm_reg_default.reg_diagnostics_adr_w-1 DOWNTO 0),
+      coe_clk_export_from_the_reg_diagnostics_mesh            => OPEN,
+      coe_read_export_from_the_reg_diagnostics_mesh           => reg_diagnostics_mosi.rd,
+      coe_readdata_export_to_the_reg_diagnostics_mesh         => reg_diagnostics_miso.rddata(c_word_w-1 DOWNTO 0),
+      coe_reset_export_from_the_reg_diagnostics_mesh          => OPEN,
+      coe_write_export_from_the_reg_diagnostics_mesh          => reg_diagnostics_mosi.wr,
+      coe_writedata_export_from_the_reg_diagnostics_mesh      => reg_diagnostics_mosi.wrdata(c_word_w-1 DOWNTO 0),
+  
+      -- the_ram_diag_data_buffer
+      coe_address_export_from_the_ram_diag_data_buffer        => ram_diag_data_buf_mosi.address(c_unb1_board_peripherals_mm_reg_default.ram_diag_db_adr_w-1 DOWNTO 0),
+      coe_clk_export_from_the_ram_diag_data_buffer            => OPEN,
+      coe_read_export_from_the_ram_diag_data_buffer           => ram_diag_data_buf_mosi.rd,
+      coe_readdata_export_to_the_ram_diag_data_buffer         => ram_diag_data_buf_miso.rddata(c_word_w-1 DOWNTO 0),
+      coe_reset_export_from_the_ram_diag_data_buffer          => OPEN,
+      coe_write_export_from_the_ram_diag_data_buffer          => ram_diag_data_buf_mosi.wr,
+      coe_writedata_export_from_the_ram_diag_data_buffer      => ram_diag_data_buf_mosi.wrdata(c_word_w-1 DOWNTO 0),
+  
+      -- the_reg_diag_data_buffer
+      coe_address_export_from_the_reg_diag_data_buffer        => reg_diag_data_buf_mosi.address(c_unb1_board_peripherals_mm_reg_default.reg_diag_db_adr_w-1 DOWNTO 0),
+      coe_clk_export_from_the_reg_diag_data_buffer            => OPEN,
+      coe_read_export_from_the_reg_diag_data_buffer           => reg_diag_data_buf_mosi.rd,
+      coe_readdata_export_to_the_reg_diag_data_buffer         => reg_diag_data_buf_miso.rddata(c_word_w-1 DOWNTO 0),
+      coe_reset_export_from_the_reg_diag_data_buffer          => OPEN,
+      coe_write_export_from_the_reg_diag_data_buffer          => reg_diag_data_buf_mosi.wr,
+      coe_writedata_export_from_the_reg_diag_data_buffer      => reg_diag_data_buf_mosi.wrdata(c_word_w-1 DOWNTO 0),
+  
+      -- the_ram_diag_data_buffer_mesh
+      coe_address_export_from_the_ram_diag_data_buffer_mesh   => ram_mesh_diag_data_buf_mosi.address(c_unb1_board_peripherals_mm_reg_default.ram_diag_db_adr_w-1 DOWNTO 0),
+      coe_clk_export_from_the_ram_diag_data_buffer_mesh       => OPEN,
+      coe_read_export_from_the_ram_diag_data_buffer_mesh      => ram_mesh_diag_data_buf_mosi.rd,
+      coe_readdata_export_to_the_ram_diag_data_buffer_mesh    => ram_mesh_diag_data_buf_miso.rddata(c_word_w-1 DOWNTO 0),
+      coe_reset_export_from_the_ram_diag_data_buffer_mesh     => OPEN,
+      coe_write_export_from_the_ram_diag_data_buffer_mesh     => ram_mesh_diag_data_buf_mosi.wr,
+      coe_writedata_export_from_the_ram_diag_data_buffer_mesh => ram_mesh_diag_data_buf_mosi.wrdata(c_word_w-1 DOWNTO 0),
+      
+      -- the_reg_bsn_monitor
+      coe_address_export_from_the_reg_bsn_monitor             => reg_bsn_monitor_mosi.address(c_unb1_board_peripherals_mm_reg_default.reg_bsn_monitor_adr_w-1 DOWNTO 0),
+      coe_clk_export_from_the_reg_bsn_monitor                 => OPEN,
+      coe_read_export_from_the_reg_bsn_monitor                => reg_bsn_monitor_mosi.rd,
+      coe_readdata_export_to_the_reg_bsn_monitor              => reg_bsn_monitor_miso.rddata(c_word_w-1 DOWNTO 0),
+      coe_reset_export_from_the_reg_bsn_monitor               => OPEN,
+      coe_write_export_from_the_reg_bsn_monitor               => reg_bsn_monitor_mosi.wr,
+      coe_writedata_export_from_the_reg_bsn_monitor           => reg_bsn_monitor_mosi.wrdata(c_word_w-1 DOWNTO 0),
+      
+      -- the_pio_debug_wave
+      out_port_from_the_pio_debug_wave                        => OPEN,
+  
+      -- the_pio_pps
+      in_port_to_the_pio_pps                                  => pin_pps,
+  
+      -- the_pio_system_info: actually a avs_common_mm instance
+      coe_clk_export_from_the_pio_system_info                 => OPEN,
+      coe_reset_export_from_the_pio_system_info               => OPEN,
+      coe_address_export_from_the_pio_system_info             => reg_unb_system_info_mosi.address(c_unb1_board_peripherals_mm_reg_default.reg_unb_system_info_adr_w-1 DOWNTO 0), 
+      coe_read_export_from_the_pio_system_info                => reg_unb_system_info_mosi.rd,
+      coe_readdata_export_to_the_pio_system_info              => reg_unb_system_info_miso.rddata(c_word_w-1 DOWNTO 0),
+      coe_write_export_from_the_pio_system_info               => reg_unb_system_info_mosi.wr,
+      coe_writedata_export_from_the_pio_system_info           => reg_unb_system_info_mosi.wrdata(c_word_w-1 DOWNTO 0),
+  
+      -- the_rom_system_info
+      coe_clk_export_from_the_rom_system_info                 => OPEN,
+      coe_reset_export_from_the_rom_system_info               => OPEN,
+      coe_address_export_from_the_rom_system_info             => rom_unb_system_info_mosi.address(c_unb1_board_peripherals_mm_reg_default.rom_unb_system_info_adr_w-1 DOWNTO 0), 
+      coe_read_export_from_the_rom_system_info                => rom_unb_system_info_mosi.rd,
+      coe_readdata_export_to_the_rom_system_info              => rom_unb_system_info_miso.rddata(c_word_w-1 DOWNTO 0),
+      coe_write_export_from_the_rom_system_info               => rom_unb_system_info_mosi.wr,
+      coe_writedata_export_from_the_rom_system_info           => rom_unb_system_info_mosi.wrdata(c_word_w-1 DOWNTO 0),
+  
+      -- the_pio_wdi
+      out_port_from_the_pio_wdi                               => pout_wdi,
+  
+      -- the_reg_wdi: Manual WDI override; causes FPGA reconfiguration if WDI is enabled (g_use_phy).
+      coe_clk_export_from_the_reg_wdi                         => OPEN,
+      coe_reset_export_from_the_reg_wdi                       => OPEN,
+      coe_address_export_from_the_reg_wdi                     => reg_wdi_mosi.address(0), 
+      coe_read_export_from_the_reg_wdi                        => reg_wdi_mosi.rd,
+      coe_readdata_export_to_the_reg_wdi                      => reg_wdi_miso.rddata(c_word_w-1 DOWNTO 0),
+      coe_write_export_from_the_reg_wdi                       => reg_wdi_mosi.wr,
+      coe_writedata_export_from_the_reg_wdi                   => reg_wdi_mosi.wrdata(c_word_w-1 DOWNTO 0)
+    );
+  END GENERATE;
+END;
+
+
+
+
+
+
+
+
+
+
+
+
-- 
GitLab