library: Added util_fir_int and util_fir_dec interpolation/decimation filters

main
Adrian Costina 2016-10-27 19:31:50 +03:00
parent 8107514dde
commit 30314e4492
9 changed files with 586 additions and 0 deletions

View File

@ -60,6 +60,8 @@ clean:
make -C util_clkdiv clean
make -C util_cpack clean
make -C util_dacfifo clean
make -C util_fir_dec clean
make -C util_fir_int clean
make -C util_gmii_to_rgmii clean
make -C util_gtlb clean
make -C util_i2c_mixer clean
@ -133,6 +135,8 @@ lib:
-make -C util_clkdiv
-make -C util_cpack
-make -C util_dacfifo
-make -C util_fir_dec
-make -C util_fir_int
-make -C util_gmii_to_rgmii
-make -C util_gtlb
-make -C util_i2c_mixer

View File

@ -0,0 +1,46 @@
####################################################################################
####################################################################################
## Copyright 2011(c) Analog Devices, Inc.
## Auto-generated, do not modify!
####################################################################################
####################################################################################
M_DEPS := util_fir_dec_ip.tcl
M_DEPS += ../scripts/adi_env.tcl
M_DEPS += ../scripts/adi_ip.tcl
M_DEPS += util_fir_dec.v
M_VIVADO := vivado -mode batch -source
M_FLIST := *.cache
M_FLIST += *.data
M_FLIST += *.xpr
M_FLIST += *.log
M_FLIST += component.xml
M_FLIST += *.jou
M_FLIST += xgui
M_FLIST += *.ip_user_files
M_FLIST += *.srcs
M_FLIST += *.hw
M_FLIST += *.sim
M_FLIST += .Xil
.PHONY: all clean clean-all
all: util_fir_dec.xpr
clean:clean-all
clean-all:
rm -rf $(M_FLIST)
util_fir_dec.xpr: $(M_DEPS)
-rm -rf $(M_FLIST)
$(M_VIVADO) util_fir_dec_ip.tcl >> util_fir_dec_ip.log 2>&1
####################################################################################
####################################################################################

View File

@ -0,0 +1,134 @@
; XILINX CORE Generator(tm)Distributed Arithmetic FIR filter coefficient (.COE) File
; Generated by MATLAB(R) 9.0 and the DSP System Toolbox 9.2.
; Generated on: 24-Oct-2016 14:07:18
Radix = 10;
Coefficient_Width = 16;
CoefData = 0,
-1,
-2,
-4,
-6,
-8,
-8,
-5,
0,
8,
18,
29,
37,
41,
37,
23,
0,
-31,
-67,
-100,
-124,
-130,
-113,
-69,
0,
87,
181,
263,
318,
326,
277,
166,
0,
-202,
-410,
-589,
-700,
-709,
-594,
-352,
0,
420,
848,
1211,
1432,
1446,
1210,
717,
0,
-863,
-1756,
-2535,
-3043,
-3133,
-2690,
-1646,
0,
2180,
4757,
7534,
10278,
12743,
14697,
15951,
16384,
15951,
14697,
12743,
10278,
7534,
4757,
2180,
0,
-1646,
-2690,
-3133,
-3043,
-2535,
-1756,
-863,
0,
717,
1210,
1446,
1432,
1211,
848,
420,
0,
-352,
-594,
-709,
-700,
-589,
-410,
-202,
0,
166,
277,
326,
318,
263,
181,
87,
0,
-69,
-113,
-130,
-124,
-100,
-67,
-31,
0,
23,
37,
41,
37,
29,
18,
8,
0,
-5,
-8,
-8,
-6,
-4,
-2,
-1,
0;

View File

@ -0,0 +1,73 @@
// ***************************************************************************
// ***************************************************************************
// Copyright 2014(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// - Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// - Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
// - Neither the name of Analog Devices, Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
// - The use of this software may or may not infringe the patent rights
// of one or more patent holders. This license does not release you
// from the requirement that you obtain separate licenses from these
// patent holders to use this software.
// - Use of the software either in source or binary form, must be run
// on or directly connected to an Analog Devices Inc. component.
//
// THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE ARE DISCLAIMED.
//
// IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY
// RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ***************************************************************************
// This IP allows the decimation by 8 of the data from the input channels
// 0 and 1. The decimation filter is implemented using a fir_compiler IP from
// Xilinx.
// ***************************************************************************
`timescale 1ns/100ps
module util_fir_dec (
input aclk,
input s_axis_data_tvalid,
output s_axis_data_tready,
input [15:0] channel_0,
input [15:0] channel_1,
input decimate,
output m_axis_data_tvalid,
output [31:0] m_axis_data_tdata);
wire [31:0] s_axis_data_tdata;
wire m_axis_data_tvalid_s;
wire [31:0] m_axis_data_tdata_s;
assign s_axis_data_tdata = {channel_1, channel_0};
assign m_axis_data_tvalid = (decimate == 1'b1) ? m_axis_data_tvalid_s : s_axis_data_tvalid;
assign m_axis_data_tdata = (decimate == 1'b1) ? m_axis_data_tdata_s : {channel_1, channel_0};
fir_decim decimator (
.aclk(aclk),
.s_axis_data_tvalid(s_axis_data_tvalid),
.s_axis_data_tready(s_axis_data_tready),
.s_axis_data_tdata(s_axis_data_tdata),
.m_axis_data_tvalid(m_axis_data_tvalid_s),
.m_axis_data_tdata(m_axis_data_tdata_s)
);
endmodule // util_fir_dec

View File

@ -0,0 +1,39 @@
source ../scripts/adi_env.tcl
source $ad_hdl_dir/library/scripts/adi_ip.tcl
adi_ip_create util_fir_dec
set fir_decim [create_ip -name fir_compiler -vendor xilinx.com -library ip -version 7.2 -module_name fir_decim]
set_property -dict [ list \
CONFIG.Clock_Frequency {128.8} \
CONFIG.CoefficientSource {COE_File} \
CONFIG.Coefficient_File {../../../../coefile_dec.coe} \
CONFIG.Coefficient_Fractional_Bits {0} \
CONFIG.Coefficient_Sets {1} \
CONFIG.Coefficient_Sign {Signed} \
CONFIG.Coefficient_Structure {Inferred} \
CONFIG.Coefficient_Width {16} \
CONFIG.ColumnConfig {5} \
CONFIG.Decimation_Rate {8} \
CONFIG.Filter_Architecture {Systolic_Multiply_Accumulate} \
CONFIG.Filter_Type {Decimation} \
CONFIG.Interpolation_Rate {1} \
CONFIG.Number_Channels {1} \
CONFIG.Number_Paths {2} \
CONFIG.Output_Rounding_Mode {Truncate_LSBs} \
CONFIG.Output_Width {16} \
CONFIG.Quantization {Integer_Coefficients} \
CONFIG.RateSpecification {Frequency_Specification} \
CONFIG.Sample_Frequency {64.4} \
CONFIG.Zero_Pack_Factor {1} \
] [get_ips fir_decim]
generate_target {all} [get_files util_fir_dec.srcs/sources_1/ip/fir_decim/fir_decim.xci]
adi_ip_files util_fir_dec [list \
"util_fir_dec.v" ]
adi_ip_properties_lite util_fir_dec
ipx::save_core [ipx::current_core]

View File

@ -0,0 +1,46 @@
####################################################################################
####################################################################################
## Copyright 2011(c) Analog Devices, Inc.
## Auto-generated, do not modify!
####################################################################################
####################################################################################
M_DEPS := util_fir_int_ip.tcl
M_DEPS += ../scripts/adi_env.tcl
M_DEPS += ../scripts/adi_ip.tcl
M_DEPS += util_fir_int.v
M_VIVADO := vivado -mode batch -source
M_FLIST := *.cache
M_FLIST += *.data
M_FLIST += *.xpr
M_FLIST += *.log
M_FLIST += component.xml
M_FLIST += *.jou
M_FLIST += xgui
M_FLIST += *.ip_user_files
M_FLIST += *.srcs
M_FLIST += *.hw
M_FLIST += *.sim
M_FLIST += .Xil
.PHONY: all clean clean-all
all: util_fir_int.xpr
clean:clean-all
clean-all:
rm -rf $(M_FLIST)
util_fir_int.xpr: $(M_DEPS)
-rm -rf $(M_FLIST)
$(M_VIVADO) util_fir_int_ip.tcl >> util_fir_int_ip.log 2>&1
####################################################################################
####################################################################################

View File

@ -0,0 +1,134 @@
; XILINX CORE Generator(tm)Distributed Arithmetic FIR filter coefficient (.COE) File
; Generated by MATLAB(R) 9.0 and the DSP System Toolbox 9.2.
; Generated on: 21-Oct-2016 22:25:08
Radix = 10;
Coefficient_Width = 16;
CoefData = 0,
-1,
-2,
-4,
-6,
-8,
-8,
-5,
0,
8,
18,
29,
37,
41,
37,
23,
0,
-31,
-67,
-100,
-124,
-130,
-113,
-69,
0,
87,
181,
263,
318,
326,
277,
166,
0,
-202,
-410,
-589,
-700,
-709,
-594,
-352,
0,
420,
848,
1211,
1432,
1446,
1210,
717,
0,
-863,
-1756,
-2535,
-3043,
-3133,
-2690,
-1646,
0,
2180,
4757,
7534,
10278,
12743,
14697,
15951,
16384,
15951,
14697,
12743,
10278,
7534,
4757,
2180,
0,
-1646,
-2690,
-3133,
-3043,
-2535,
-1756,
-863,
0,
717,
1210,
1446,
1432,
1211,
848,
420,
0,
-352,
-594,
-709,
-700,
-589,
-410,
-202,
0,
166,
277,
326,
318,
263,
181,
87,
0,
-69,
-113,
-130,
-124,
-100,
-67,
-31,
0,
23,
37,
41,
37,
29,
18,
8,
0,
-5,
-8,
-8,
-6,
-4,
-2,
-1,
0;

View File

@ -0,0 +1,70 @@
// ***************************************************************************
// ***************************************************************************
// Copyright 2014(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// - Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// - Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
// - Neither the name of Analog Devices, Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
// - The use of this software may or may not infringe the patent rights
// of one or more patent holders. This license does not release you
// from the requirement that you obtain separate licenses from these
// patent holders to use this software.
// - Use of the software either in source or binary form, must be run
// on or directly connected to an Analog Devices Inc. component.
//
// THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE ARE DISCLAIMED.
//
// IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY
// RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ***************************************************************************
// This IP allows the interpolation by 8 of the data from the input
// The interpolation filter is implemented using a fir_compiler IP from
// Xilinx.
// ***************************************************************************
`timescale 1ns/100ps
module util_fir_int (
input aclk,
input s_axis_data_tvalid,
output s_axis_data_tready,
input [31:0] s_axis_data_tdata,
output [15:0] channel_0,
output [15:0] channel_1,
output m_axis_data_tvalid,
input interpolate,
input dac_read);
wire [31:0] m_axis_data_tdata_s;
wire s_axis_data_tready_s;
assign {channel_1, channel_0} = (interpolate == 1'b1) ? m_axis_data_tdata_s : s_axis_data_tdata;
assign s_axis_data_tready = (interpolate == 1'b1) ? s_axis_data_tready_s : dac_read;
fir_interp interpolator (
.aclk(aclk),
.s_axis_data_tvalid(s_axis_data_tvalid),
.s_axis_data_tready(s_axis_data_tready_s),
.s_axis_data_tdata(s_axis_data_tdata),
.m_axis_data_tvalid(m_axis_data_tvalid),
.m_axis_data_tdata(m_axis_data_tdata_s)
);
endmodule // util_fir_int

View File

@ -0,0 +1,40 @@
source ../scripts/adi_env.tcl
source $ad_hdl_dir/library/scripts/adi_ip.tcl
adi_ip_create util_fir_int
set fir_interp [create_ip -name fir_compiler -vendor xilinx.com -library ip -version 7.2 -module_name fir_interp]
set_property -dict [ list \
CONFIG.Clock_Frequency {128.8} \
CONFIG.CoefficientSource {COE_File} \
CONFIG.Coefficient_File {../../../../coefile_int.coe} \
CONFIG.Coefficient_Fractional_Bits {0} \
CONFIG.Coefficient_Sets {1} \
CONFIG.Coefficient_Sign {Signed} \
CONFIG.Coefficient_Structure {Inferred} \
CONFIG.Coefficient_Width {16} \
CONFIG.ColumnConfig {5} \
CONFIG.Decimation_Rate {1} \
CONFIG.Filter_Architecture {Systolic_Multiply_Accumulate} \
CONFIG.Filter_Type {Interpolation} \
CONFIG.Interpolation_Rate {8} \
CONFIG.M_DATA_Has_TREADY {false} \
CONFIG.Number_Channels {1} \
CONFIG.Number_Paths {2} \
CONFIG.Output_Rounding_Mode {Truncate_LSBs} \
CONFIG.Output_Width {16} \
CONFIG.Quantization {Integer_Coefficients} \
CONFIG.RateSpecification {Frequency_Specification} \
CONFIG.Sample_Frequency {8} \
CONFIG.Zero_Pack_Factor {1} \
] [get_ips fir_interp]
generate_target {all} [get_files util_fir_int.srcs/sources_1/ip/fir_interp/fir_interp.xci]
adi_ip_files util_fir_int [list \
"util_fir_int.v" ]
adi_ip_properties_lite util_fir_int
ipx::save_core [ipx::current_core]