Skip to content
Snippets Groups Projects
Commit 8cedd923 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Define pfs coeff constants in pfs_pkg.vhd.

parent c65b282d
No related branches found
No related tags found
2 merge requests!100Removed text for XSub that is now written in Confluence Subband correlator...,!68Resolve L2SDP-162
-------------------------------------------------------------------------------
--
-- Copyright 2020
-- Copyright 2021
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
......@@ -33,6 +33,7 @@ LIBRARY IEEE, common_lib, dp_lib, pfs_lib, pft2_lib;
USE IEEE.std_logic_1164.ALL;
USE common_lib.common_pkg.ALL;
USE dp_lib.dp_stream_pkg.ALL;
USE pfs_lib.pfs_pkg.ALL;
USE pft2_lib.pft_pkg.ALL;
ENTITY pfb2 IS
......@@ -44,7 +45,8 @@ ENTITY pfb2 IS
g_pfs_nof_taps : NATURAL := 16;
g_pfs_in_dat_w : NATURAL := 12;
g_pfs_out_dat_w : NATURAL := 18;
g_pfs_coef_dat_w : NATURAL := 16;
g_pfs_coef_dat_w : NATURAL := c_pfs_coef_w; -- = 16, should match coefs in g_pfs_coefs_file
g_pfs_coefs_file : STRING := c_pfs_coefs_file; -- = "data/pfs_coefsbuf_1024.hex"
-- pft2
g_pft_mode : PFT_MODE_TYPE := PFT_MODE_REAL2;
......@@ -94,7 +96,8 @@ BEGIN
g_nof_taps => c_nof_coeffs,
g_in_dat_w => g_pfs_in_dat_w,
g_out_dat_w => g_pfs_out_dat_w,
g_coef_dat_w => g_pfs_coef_dat_w
g_coef_dat_w => g_pfs_coef_dat_w,
g_coefs_file => g_pfs_coefs_file
)
PORT MAP (
in_dat_x => pfs_in_dat_x,
......
-------------------------------------------------------------------------------
--
-- Copyright 2020
-- Copyright 2021
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
......@@ -22,8 +22,8 @@
-- Purpose: Combine LOFAR1 pfb2 with subband statistics (SST), similar as wpfb_unit_dev
-- Description:
-- . support multiple complex input streams via g_nof_streams
-- . 1 complex pfb2 per stream
-- . 1 complex pfb2 can process two real inputs with PFT_MODE_REAL2
-- . one complex pfb2 per stream
-- . one complex pfb2 can process two real inputs with PFT_MODE_REAL2
-- . pass on in_sosi.bsn
--
-- Remark:
......@@ -33,6 +33,7 @@ USE IEEE.std_logic_1164.ALL;
USE common_lib.common_pkg.ALL;
USE common_lib.common_mem_pkg.ALL;
USE dp_lib.dp_stream_pkg.ALL;
USE pfs_lib.pfs_pkg.ALL;
USE pft2_lib.pft_pkg.ALL;
ENTITY pfb2_unit IS
......@@ -45,7 +46,8 @@ ENTITY pfb2_unit IS
g_pfs_nof_taps : NATURAL := 16;
g_pfs_in_dat_w : NATURAL := 12;
g_pfs_out_dat_w : NATURAL := 18;
g_pfs_coef_dat_w : NATURAL := 16;
g_pfs_coef_dat_w : NATURAL := c_pfs_coef_w; -- = 16, should match coefs in g_pfs_coefs_file
g_pfs_coefs_file : STRING := c_pfs_coefs_file; -- = "data/pfs_coefsbuf_1024.hex"
-- pft2
g_pft_mode : PFT_MODE_TYPE := PFT_MODE_REAL2;
......@@ -95,6 +97,7 @@ BEGIN
g_pfs_in_dat_w => g_pfs_in_dat_w,
g_pfs_out_dat_w => g_pfs_out_dat_w,
g_pfs_coef_dat_w => g_pfs_coef_dat_w,
g_pfs_coefs_file => g_pfs_coefs_file,
-- pft2
g_pft_mode => g_pft_mode,
......
......@@ -5,6 +5,7 @@ hdl_lib_uses_sim =
hdl_lib_technology =
synth_files =
src/vhdl/pfs_pkg.vhd
src/vhdl/pfs_ctrl.vhd
src/vhdl/pfs_tapsbuf.vhd
src/vhdl/pfs_coefsbuf.vhd
......
......@@ -26,6 +26,7 @@
LIBRARY IEEE, common_lib;
USE IEEE.std_logic_1164.ALL;
USE common_lib.common_pkg.ALL;
USE work.pfs_pkg.ALL;
ENTITY pfs IS
GENERIC (
......@@ -33,7 +34,8 @@ ENTITY pfs IS
g_nof_taps : NATURAL := 16*1024;
g_in_dat_w : NATURAL := 12;
g_out_dat_w : NATURAL := 18;
g_coef_dat_w : NATURAL := 16
g_coef_dat_w : NATURAL := c_pfs_coef_w; -- = 16, should match coefs in g_coefs_file
g_coefs_file : STRING := c_pfs_coefs_file -- = "data/pfs_coefsbuf_1024.hex"
);
PORT (
in_dat_x : IN STD_LOGIC_VECTOR(g_in_dat_w-1 DOWNTO 0);
......@@ -162,6 +164,7 @@ BEGIN
coefsbuf : ENTITY work.pfs_coefsbuf
GENERIC MAP (
g_data_w => g_coef_dat_w * c_nof_fir_taps,
g_coefs_file => g_coefs_file,
g_nof_coefs => g_nof_bands,
g_addr_w => c_nof_bands_w
)
......
......@@ -31,9 +31,11 @@ USE common_lib.common_mem_pkg.ALL;
ENTITY pfs_coefsbuf IS
GENERIC (
g_data_w : NATURAL;
g_nof_coefs : NATURAL;
g_addr_w : NATURAL
g_data_w : NATURAL;
g_coefs_file : STRING := "data/pfs_coefsbuf_1024.hex"; -- Quartus .hex extension, replaced by .bin in common_rom works for XST
--g_coefs_file : STRING := "data/pfs_coefsbuf_1024.bin"; -- Synplify fails on file extension change to .bin in common_rom and requires extra ../
g_nof_coefs : NATURAL;
g_addr_w : NATURAL
);
PORT (
addr : IN STD_LOGIC_VECTOR(g_addr_w-1 DOWNTO 0);
......@@ -57,8 +59,7 @@ BEGIN
rom : ENTITY common_lib.common_rom
GENERIC MAP (
g_ram => c_coefs_rom,
g_init_file => "data/pfs_coefsbuf_1024.hex" -- Quartus .hex extension, replaced by .bin in common_rom works for XST
--g_init_file => "data/pfs_coefsbuf_1024.bin" -- Synplify fails on file extension change to .bin in common_rom and requires extra ../
g_init_file => g_coefs_file
)
PORT MAP (
rst => rst,
......
-------------------------------------------------------------------------------
--
-- Copyright 2021
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
-------------------------------------------------------------------------------
--
-- Author: E. Kooistra, for pfs original 2004 by W. Lubberhuizen / W. Poeisz
-- Purpose: Polyphase FIR filter
-- Description: Ported from LOFAR1, see readme_lofar1.txt
-- Remark: Use package to keep default pfs constants
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
PACKAGE pfs_pkg IS
CONSTANT c_pfs_coef_w : NATURAL := 16;
CONSTANT c_pfs_coefs_file : STRING := "data/pfs_coefsbuf_1024.hex";
END pfs_pkg;
PACKAGE BODY pfs_pkg IS
END pfs_pkg;
-------------------------------------------------------------------------------
--
-- Copyright 2021
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
-------------------------------------------------------------------------------
--
-- Author: ported by E. Kooistra, original 2004 by W. Lubberhuizen / W. Poeisz
-- Purpose: Testbench for Polyphase FIR filter
--
-- Usage:
-- > as 5
-- > run -a
......
......@@ -113,12 +113,18 @@ c) Simulating tb/vhdl/tb_pft2.vhd
5) Add generics
* pft2:
- g_stage_dat_w
5) Add generics and package constant defaults
* pfs_pkg.vhd:
- g_pfs_coef_dat_w, default is c_pfs_coef_w = 16, should match coefs in g_pfs_coefs_file
- g_pfs_coefs_file, default is c_pfs_coefs_file = "data/pfs_coefsbuf_1024.hex"
* pft2_pkg.vhd:
- c_coeff_w in pft_tmult.vhd default is c_pft_twiddle_w = 16
- g_stage_dat_w in pft.vhd, default is c_pft_stage_dat_w = 20
- verified range of g_stage_dat_w in tb_pft2
- verified switch_en input in tb_pft2
* pfb2:
* pfb2.vhd:
- g_switch_en
- g_stage_dat_w
- g_pfs_bypass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment