Skip to content
Snippets Groups Projects
Commit a2082192 authored by Jonathan Hargreaves's avatar Jonathan Hargreaves
Browse files

Fixed errors from EK review of merge request 4

parent 84e3253c
No related branches found
No related tags found
2 merge requests!6Master,!4Stat 313
Showing
with 119 additions and 70 deletions
...@@ -27,13 +27,13 @@ quartus_qsf_files = ...@@ -27,13 +27,13 @@ quartus_qsf_files =
$RADIOHDL_WORK/boards/uniboard2b/libraries/unb2c_board/quartus/unb2c_board.qsf $RADIOHDL_WORK/boards/uniboard2b/libraries/unb2c_board/quartus/unb2c_board.qsf
quartus_sdc_pre_files = quartus_sdc_pre_files =
quartus/lofar_unb2b_adc_full.sdc ../../quartus/lofar_unb2b_adc.sdc
quartus_sdc_files = quartus_sdc_files =
$RADIOHDL_WORK/boards/uniboard2b/libraries/unb2b_board/quartus/unb2b_board.sdc $RADIOHDL_WORK/boards/uniboard2b/libraries/unb2b_board/quartus/unb2b_board.sdc
quartus_tcl_files = quartus_tcl_files =
quartus/lofar_unb2b_adc_full_pins.tcl ../../quartus/lofar_unb2b_adc_pins.tcl
quartus_vhdl_files = quartus_vhdl_files =
......
...@@ -85,7 +85,7 @@ ARCHITECTURE str OF lofar2_unb2b_adc_full IS ...@@ -85,7 +85,7 @@ ARCHITECTURE str OF lofar2_unb2b_adc_full IS
BEGIN BEGIN
u_revision : ENTITY unb2b_test_lib.unb2b_test u_revision : ENTITY lofar2_unb2b_adc_lib.lofar2_unb2b_adc
GENERIC MAP ( GENERIC MAP (
g_design_name => g_design_name, g_design_name => g_design_name,
g_design_note => g_design_note, g_design_note => g_design_note,
......
###############################################################################
#
# Copyright (C) 2014
# 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/>.
#
###############################################################################
source $::env(RADIOHDL_WORK)/boards/uniboard2b/libraries/unb2b_board/quartus/pinning/unb2b_minimal_pins.tcl
source $::env(RADIOHDL_WORK)/boards/uniboard2b/libraries/unb2b_board/quartus/pinning/unb2b_jesd204b_pins.tcl
...@@ -13,7 +13,6 @@ test_bench_files = ...@@ -13,7 +13,6 @@ test_bench_files =
[modelsim_project_file] [modelsim_project_file]
modelsim_copy_files = modelsim_copy_files =
# Pinning design only intended for synthesis
[quartus_project_file] [quartus_project_file]
...@@ -27,13 +26,13 @@ quartus_qsf_files = ...@@ -27,13 +26,13 @@ quartus_qsf_files =
$RADIOHDL_WORK/boards/uniboard2b/libraries/unb2c_board/quartus/unb2c_board.qsf $RADIOHDL_WORK/boards/uniboard2b/libraries/unb2c_board/quartus/unb2c_board.qsf
quartus_sdc_pre_files = quartus_sdc_pre_files =
quartus/lofar_unb2b_adc_one_node.sdc ../../quartus/lofar_unb2b_adc.sdc
quartus_sdc_files = quartus_sdc_files =
$RADIOHDL_WORK/boards/uniboard2b/libraries/unb2b_board/quartus/unb2b_board.sdc $RADIOHDL_WORK/boards/uniboard2b/libraries/unb2b_board/quartus/unb2b_board.sdc
quartus_tcl_files = quartus_tcl_files =
quartus/lofar_unb2b_adc_one_node_pins.tcl ../../quartus/lofar_unb2b_adc_pins.tcl
quartus_vhdl_files = quartus_vhdl_files =
......
...@@ -85,7 +85,7 @@ ARCHITECTURE str OF lofar2_unb2b_adc_one_node IS ...@@ -85,7 +85,7 @@ ARCHITECTURE str OF lofar2_unb2b_adc_one_node IS
BEGIN BEGIN
u_revision : ENTITY unb2b_test_lib.unb2b_test u_revision : ENTITY lofar2_unb2b_adc_lib.lofar2_unb2b_adc
GENERIC MAP ( GENERIC MAP (
g_design_name => g_design_name, g_design_name => g_design_name,
g_design_note => g_design_note, g_design_note => g_design_note,
......
###############################################################################
#
# Copyright (C) 2014
# 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/>.
#
###############################################################################
source $::env(RADIOHDL_WORK)/boards/uniboard2b/libraries/unb2b_board/quartus/pinning/unb2b_minimal_pins.tcl
source $::env(RADIOHDL_WORK)/boards/uniboard2b/libraries/unb2b_board/quartus/pinning/unb2b_jesd204b_pins.tcl
...@@ -87,11 +87,25 @@ END lofar2_unb2b_adc; ...@@ -87,11 +87,25 @@ END lofar2_unb2b_adc;
ARCHITECTURE str OF lofar2_unb2b_adc IS ARCHITECTURE str OF lofar2_unb2b_adc IS
-- Revision parameters
CONSTANT c_revision_select : t_lofar2_unb2b_adc_config := func_sel_revision_rec(g_design_name);
CONSTANT c_nof_streams_jesd204b : NATURAL := c_revision_select.nof_streams_jesd204b;
CONSTANT c_nof_streams_db : NATURAL := c_revision_select.nof_streams_db;
CONSTANT c_nof_streams_input : NATURAL := c_revision_select.nof_streams_input;
-- Firmware version x.y -- Firmware version x.y
CONSTANT c_fw_version : t_unb2b_board_fw_version := (1, 1); CONSTANT c_fw_version : t_unb2b_board_fw_version := (1, 1);
CONSTANT c_mm_clk_freq : NATURAL := c_unb2b_board_mm_clk_freq_100M; CONSTANT c_mm_clk_freq : NATURAL := c_unb2b_board_mm_clk_freq_100M;
CONSTANT c_nof_streams_jesd204b : NATURAL := 12; CONSTANT c_lofar2_sample_clk_freq : NATURAL := 200 * 10**6; -- alternate 160MHz. TODO: Use to check PPS
CONSTANT c_nof_streams_db : NATURAL := 2;
-- Waveform Generator
CONSTANT c_wg_buf_directory : STRING := "data/";
CONSTANT c_wg_buf_dat_w : NATURAL := c_unb2b_board_peripherals_mm_reg_default.ram_diag_wg_dat_w;
CONSTANT c_wg_buf_addr_w : NATURAL := c_unb2b_board_peripherals_mm_reg_default.ram_diag_wg_adr_w;
SIGNAL wg_sosi_arr : t_dp_sosi_arr(0 TO c_nof_streams_input-1);
SIGNAL mux_sosi_arr : t_dp_sosi_arr(0 TO c_nof_streams_input-1);
SIGNAL nxt_mux_sosi_arr : t_dp_sosi_arr(0 TO c_nof_streams_input-1);
-- System -- System
SIGNAL cs_sim : STD_LOGIC; SIGNAL cs_sim : STD_LOGIC;
...@@ -216,11 +230,11 @@ BEGIN ...@@ -216,11 +230,11 @@ BEGIN
mm_clk => mm_clk, mm_clk => mm_clk,
mm_rst => mm_rst, mm_rst => mm_rst,
dp_rst => st_rst, dp_rst => dp_rst,
dp_clk => st_clk, dp_clk => dp_clk, -- Can be external 200MHz, or PLL generated
dp_pps => st_pps, dp_pps => st_pps,
dp_rst_in => st_rst, dp_rst_in => st_rst,
dp_clk_in => st_clk, dp_clk_in => jesd204b_frame_clk,
-- Toggle WDI -- Toggle WDI
pout_wdi => pout_wdi, pout_wdi => pout_wdi,
...@@ -391,6 +405,11 @@ BEGIN ...@@ -391,6 +405,11 @@ BEGIN
jesd204b_miso => jesd204b_miso jesd204b_miso => jesd204b_miso
); );
-----------------------------------------------------------------------------
-- JESD204B IP (ADC Handler)
-----------------------------------------------------------------------------
u_jesd204b: ENTITY tech_jesd204b_lib.tech_jesd204b u_jesd204b: ENTITY tech_jesd204b_lib.tech_jesd204b
GENERIC MAP( GENERIC MAP(
g_sim => g_sim, g_sim => g_sim,
...@@ -427,6 +446,10 @@ BEGIN ...@@ -427,6 +446,10 @@ BEGIN
END GENERATE; END GENERATE;
-----------------------------------------------------------------------------
-- Diagnostic Data Buffer (Records 8192 raw ADC samples after the PPS)
-----------------------------------------------------------------------------
u_diag_data_buffer : ENTITY diag_lib.mms_diag_data_buffer u_diag_data_buffer : ENTITY diag_lib.mms_diag_data_buffer
GENERIC MAP ( GENERIC MAP (
g_technology => g_technology, g_technology => g_technology,
...@@ -451,6 +474,79 @@ BEGIN ...@@ -451,6 +474,79 @@ BEGIN
in_sync => st_pps in_sync => st_pps
); );
-----------------------------------------------------------------------------
-- WG (Test Signal Generator)
-----------------------------------------------------------------------------
gen_wg : FOR I IN 0 TO c_nof_streams_input-1 GENERATE
u_sp : ENTITY diag_lib.mms_diag_wg_wideband
GENERIC MAP (
g_cross_clock_domain => TRUE,
g_buf_dir => c_wg_buf_directory,
-- Wideband parameters
g_wideband_factor => 1,
-- Basic WG parameters, see diag_wg.vhd for their meaning
g_buf_dat_w => c_wg_buf_dat_w,
g_buf_addr_w => c_wg_buf_addr_w,
g_calc_support => TRUE,
g_calc_gain_w => 1,
g_calc_dat_w => c_wg_buf_dat_w
)
PORT MAP (
-- Memory-mapped clock domain
mm_rst => mm_rst,
mm_clk => mm_clk,
reg_mosi => reg_wg_mosi_arr(I),
reg_miso => reg_wg_miso_arr(I),
buf_mosi => ram_wg_mosi_arr(I),
buf_miso => ram_wg_miso_arr(I),
-- Streaming clock domain
st_rst => dp_rst,
st_clk => jesd204b_frame_clk,
st_restart => st_pps,
out_ovr => wg_sosi_arr(I).err,
out_val => wg_sosi_arr(I).valid,
out_dat => wg_sosi_arr(I).data(c_wg_buf_dat_w-1 downto 0),
out_sync => wg_sosi_arr(I).sync
);
END GENERATE;
-----------------------------------------------------------------------------
-- ADC/WG Mux (Input Select)
-----------------------------------------------------------------------------
gen_mux : FOR I IN 0 TO c_nof_streams_input-1 GENERATE
p_sosi : PROCESS(jesd204b_rx_src_out_arr, wg_sosi_arr)
BEGIN
-- Valid is forced to '1' here for dp_shiftram.
nxt_mux_sosi_arr(I).valid <= '1';
-- Default use the ADUH data
nxt_mux_sosi_arr(I).data <= jesd204b_rx_src_out_arr(I).data;
IF wg_sosi_arr(I).valid='1' THEN
-- Valid WG data overrules ADUH data
nxt_mux_sosi_arr(I).data <= wg_sosi_arr(I).data;
END IF;
END PROCESS;
END GENERATE;
p_reg_mux : PROCESS(st_rst, jesd204b_frame_clk)
BEGIN
IF st_rst='1' THEN
mux_sosi_arr <= (OTHERS=>c_dp_sosi_rst);
ELSIF rising_edge(jesd204b_frame_clk) THEN
mux_sosi_arr <= nxt_mux_sosi_arr;
END IF;
END PROCESS;
END str; END str;
...@@ -24,37 +24,39 @@ USE IEEE.STD_LOGIC_1164.ALL; ...@@ -24,37 +24,39 @@ USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.numeric_std.ALL; USE IEEE.numeric_std.ALL;
USE common_lib.common_pkg.ALL; USE common_lib.common_pkg.ALL;
PACKAGE lofar2_unb2b_adc IS PACKAGE lofar2_unb2b_adc_pkg IS
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- Revision control -- Revision control
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
TYPE t_lofar2_unb2b_adc_config IS RECORD TYPE t_lofar2_unb2b_adc_config IS RECORD
nof_adc_input_streams : BOOLEAN; nof_streams_jesd204b : NATURAL;
nof_streams_db : NATURAL;
nof_streams_input : NATURAL;
END RECORD; END RECORD;
-- nof inputs -- nofjesd, nofdb, nofinput
CONSTANT c_one_node : t_lofar2_unb2b_adc_config := ( 1 ); CONSTANT c_one_node : t_lofar2_unb2b_adc_config := ( 12, 2, 1 );
CONSTANT c_full : t_lofar2_unb2b_adc_config := ( 12); CONSTANT c_full : t_lofar2_unb2b_adc_config := ( 12, 2, 12 );
-- Function to select the revision configuration. -- Function to select the revision configuration.
FUNCTION func_sel_revision_rec(g_design_name : STRING) RETURN t_lofar2_unb2b_adc_config; FUNCTION func_sel_revision_rec(g_design_name : STRING) RETURN t_lofar2_unb2b_adc_config;
END lofar2_unb2b_adc; END lofar2_unb2b_adc_pkg;
PACKAGE BODY lofar2_unb2b_adc IS PACKAGE BODY lofar2_unb2b_adc_pkg IS
FUNCTION func_sel_revision_rec(g_design_name : STRING) RETURN t_lofar2_unb2b_adc_config IS FUNCTION func_sel_revision_rec(g_design_name : STRING) RETURN t_lofar2_unb2b_adc_config IS
BEGIN BEGIN
IF g_design_name = "lofar2_unb2b_adc_one_node" THEN RETURN c_one_node; IF g_design_name = "lofar2_unb2b_adc_one_node" THEN RETURN c_one_node;
ELSIF g_design_name = "lofar2_unb2b_adc_full" THEN RETURN c_full; IF g_design_name = "lofar2_unb2b_adc_full" THEN RETURN c_full;
ELSE RETURN c_one_node; ELSE RETURN c_one_node;
END IF; END IF;
END; END;
END lofar2_unb2b_adc; END lofar2_unb2b_adc_pkg;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment