Skip to content

Commit dc243fc

Browse files
committed
docs/projects/fmcomms2: Update fir_filter.rst
Signed-off-by: BCapota <[email protected]>
1 parent f3fbd07 commit dc243fc

File tree

1 file changed

+36
-143
lines changed

1 file changed

+36
-143
lines changed

docs/projects/fmcomms2/fir_filter.rst

Lines changed: 36 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Integrate FIR filters into the FMCOMMS2 HDL design
66
Overview
77
-------------------------------------------------------------------------------
88

9-
This wiki page describes how to add a custom processing module into the
9+
This page describes how to add a custom processing module into the
1010
:git-hdl:`FMCOMMS2 <projects/fmcomms2>`'s TX and/or RX data path.
1111

1212
In this example, the custom modules are going to be some digital FIR filters, to
@@ -16,7 +16,7 @@ decimate and interpolate the incoming and outcoming data stream.
1616

1717
This example was built using the hdl_2023_r2 release branch, using Vivado and
1818
Vitis 2023.2. Sources from older examples can be found under the tag
19-
`eg_fmcomms2_fir_filter`_ using Vivado 16.2 and 16.4 versions, andstatus
19+
`eg_fmcomms2_fir_filter`_ using Vivado 16.2 and 16.4 versions, and status
2020
**are not supported by us anymore**.
2121

2222
Assuming we want to transmit a sinewave with the :adi:`AD9361` ADI Integrated RF
@@ -27,11 +27,12 @@ add some interpolation filters for transmitting.
2727

2828
A similar problem is encountered on the ADC side when receiving a low-frequency
2929
signal. This can be solved with the use of decimation filters. In our example,
30-
these filters were already implemented in :git-hdl:`util_fir_int
31-
<library/util_fir_int>` and :git-hdl:`util_fir_dec <library/util_fir_dec>` HDL
32-
IP core, which are wrappers for the FIR Compiler Xilinx IP. The wrappers are
33-
used to manage the data rates entering the filter and to facilitate the
34-
configuration of the filter parameters for a specific application (TX/RX).
30+
these filters were already implemented in
31+
:git-hdl:`util_fir_int <library/util_fir_int>` and
32+
:git-hdl:`util_fir_dec <library/util_fir_dec>` HDL IP cores, which are wrappers
33+
for the FIR Compiler Xilinx IP. The wrappers are used to manage the data rates
34+
entering the filter and to facilitate the configuration of the filter
35+
parameters for a specific application (TX/RX).
3536

3637
Choosing filter parameters and coefficients
3738
-------------------------------------------------------------------------------
@@ -103,13 +104,15 @@ Adding the filters in the data path
103104
-------------------------------------------------------------------------------
104105

105106
In the original :git-hdl:`fmcomms2 <projects/fmcomms2>` design, the data comes
106-
from the :git-hdl:`DMA <library/axi_dmac>`, goes to the :git-hdl:`util_upack2
107-
<library/util_pack/util_upack2>` core which transmits the individual channel
108-
data to a :git-hdl:`dac_fifo <library/util_rfifo>` core, from which the
109-
:git-hdl:`axi_ad9361 <library/axi_ad9361>` core reads the data and transmits it
110-
to the :adi:`AD9361` chip. The util_upack2 core is used to split the 64-bit data
111-
containing 2 RF channels, each one having I/Q data. dac_fifo is used for
112-
clock-domain crossing between the system clock and the AD9361 clock.
107+
from the :git-hdl:`DMA <library/axi_dmac>`, goes to the
108+
:git-hdl:`util_upack2 <library/util_pack/util_upack2>` core which transmits
109+
the individual channel data to a :git-hdl:`dac_fifo <library/util_rfifo>` core,
110+
from which the :git-hdl:`axi_ad9361 <library/axi_ad9361>` core reads the data
111+
and transmits it to the :adi:`AD9361` chip.
112+
113+
The util_upack2 core is used to split the 64-bit data containing 2 RF channels,
114+
each one having I/Q data. dac_fifo is used for clock-domain crossing between
115+
the system clock and the AD9361 clock.
113116

114117
The data processing is done at lower clock frequencies. This is the reason for
115118
placing the interpolation filters in front of the dac_fifo module.
@@ -145,7 +148,7 @@ Understanding FMCOMMS2 clock routing
145148
Adding FIR filters in FMCOMMS2 design and building the HDL
146149
-------------------------------------------------------------------------------
147150

148-
The design is obtain by simply sourcing the base FMCOMMS2 block design.
151+
The design is obtained by simply sourcing the base FMCOMMS2 block design.
149152

150153
.. code-block:: tcl
151154
@@ -167,9 +170,11 @@ can add the FIR filter modules in the reference design. With the following
167170
commands, all the unwanted connections will be removed and new ones will be
168171
created.
169172

170-
All the TCL commands from this page are available in the `fir_filter.tcl` script
173+
All the TCL commands from this page are available in the `fir_filter.tcl`_ script
171174
located in `hdl/docs/projects/fmcomms2`.
172175

176+
.. _fir_filter.tcl: https://analogdevicesinc.github.io/hdl/docs/projects/fmcomms2
177+
173178
.. code-block:: tcl
174179
175180
# delete reference design connections
@@ -187,10 +192,14 @@ We will disconnect/connect the Rx path in a similar manner.
187192
delete_bd_objs [get_bd_nets util_ad9361_adc_fifo_dout_enable_*]
188193
delete_bd_objs [get_bd_nets util_ad9361_adc_fifo_dout_data_*]
189194
190-
Adding interpolation filters.
195+
Add the two required IP cores to the Makefile:
191196

192-
Add the two required IP cores to the Makefile: **LIB_DEPS += util_fir_int** and
193-
**LIB_DEPS += util_fir_dec**.
197+
.. code-block::
198+
199+
LIB_DEPS += util_fir_int
200+
LIB_DEPS += util_fir_dec
201+
202+
Adding interpolation filters.
194203

195204
.. code-block:: tcl
196205
@@ -239,11 +248,11 @@ Data Rate) is presented in the diagram below:
239248

240249
At this point, we have two options:
241250

242-
#. Delete the upack_core and split the data into some simple slices
243-
#. Keep upack_core and the possibility to use half of the DMA bandwidth when
251+
#. Delete the util_ad9361_dac_upack and split the data into some simple slices
252+
#. Keep util_ad9361_dac_upack and the possibility to use half of the DMA bandwidth when
244253
one channel is not enabled.
245254

246-
For this example, the upack_core was kept. The core's proprieties remain
255+
For this example, the util_ad9361_dac_upack was kept. The core's proprieties remain
247256
unchanged, and a concatenate module was added, in order to merge the data coming
248257
out from the unpack module, then feed it into the interpolation filter.
249258

@@ -320,15 +329,6 @@ Connecting the FIR interpolation filters on the Tx side
320329
In this example, the TX data flow is controlled by the interpolation filter when
321330
interpolation is activated and by the axi_ad9361_core when interpolation is not
322331
active. In the reference design, the data flow is controlled by the ad9631_core.
323-
324-
..
325-
We must connect the upack_core's dma_xfer_in port to VCC so that the UPACK may
326-
transmit the valid and enable signals from one entity to another.
327-
328-
.. code-block:: tcl
329-
330-
ad_connect util_ad9361_dac_upack/dma_xfer_in VCC
331-
332332
At this moment, the Interpolation filters are completely integrated into the
333333
design and the data path should look like the one in the figure below.
334334

@@ -379,7 +379,8 @@ Generating the programing files
379379

380380
- If you did your changes in **GUI**, you can click on **"Generate Bitstream"**.
381381
After the bitstream generation is complete, click on **Files -> Export ->
382-
Export Hardware**, then select **Include Bitstream** option.
382+
Export Hardware**, then select **Include Bitstream** option, and the
383+
folder to be saved, should be the **.sdk** folder.
383384
- If you did your changes directly in the **Tcl files**, you can use
384385
``make`` to generate the bitstream and .xsa file.
385386
- Now, if your system is based on a **Zynq architecture**, you will have to
@@ -404,7 +405,7 @@ TX to RX for each channel with a SMA to SMA cable.
404405
:alt: FMCOMMS2_TXRX_LOOPBACK
405406

406407
When first booting up the design, none of the filters will be active. For the
407-
beginning make sure you have the same **LO frequency for RX and TX**, as in the
408+
beginning, make sure you have the same **LO frequency for RX and TX**, as in the
408409
picture below.
409410

410411
Configure the Transmit/DDS mode to *DAC Buffer Output*, and chose one of the
@@ -432,7 +433,7 @@ one of the two channels will be enabled.
432433
:align: center
433434
:alt: FMCOMMS2_FIR_SETUP_ACTIVATE_DMA_DATA_WAVEFORM
434435

435-
To better understand what is happening with the data inside the FPGA, 3 ILAs
436+
To better understand what is happening with the data inside the FPGA, 3 ILA
436437
(Integrated Logic Analyzer) modules were added in the HDL design.
437438

438439
The 1st ILA was connected to the control signals between the ad9361_core and the
@@ -550,10 +551,9 @@ All filters active characteristic
550551
:align: center
551552
:alt: FMCOMMS_FIR_TX_RX_ACTIVE_WAVEFORM
552553

553-
Download
554+
Older sources
554555
-------------------------------------------------------------------------------
555556

556-
- :dokuwiki:`boot.zip <_media/resources/fpga/docs/hdl/boot.zip>`
557557
- Sources from older examples can be found under the tag
558558
`eg_fmcomms2_fir_filter`_ using Vivado 16.2 and 16.4 versions, and
559559
**are not supported by us anymore**.
@@ -571,110 +571,3 @@ References
571571
.. _eg_fmcomms2_fir_filter: https://github.com/analogdevicesinc/hdl/releases/tag/eg_fmcomms2_fir_filter
572572
.. _MATLAB: https://www.mathworks.com/products/matlab.html
573573
.. _AXI AD9361: https://analogdevicesinc.github.io/hdl/library/axi_ad9361/index.html#register-map
574-
575-
.. code-block:: tcl
576-
577-
# delete reference design connections
578-
delete_bd_objs [get_bd_nets axi_ad9361_dac_fifo_din_valid_0]
579-
delete_bd_objs [get_bd_nets axi_ad9361_dac_fifo_din_enable_*]
580-
delete_bd_objs [get_bd_nets util_ad9361_dac_upack_fifo_rd_data_*]
581-
delete_bd_objs [get_bd_nets util_ad9361_dac_upack_fifo_rd_underflow]
582-
delete_bd_objs [get_bd_nets util_ad9361_dac_upack_fifo_rd_valid]
583-
584-
delete_bd_objs [get_bd_nets util_ad9361_adc_fifo_dout_valid_0]
585-
delete_bd_objs [get_bd_nets util_ad9361_adc_fifo_dout_enable_*]
586-
delete_bd_objs [get_bd_nets util_ad9361_adc_fifo_dout_data_*]
587-
588-
set util_fir_int_0 [create_bd_cell -type ip -vlnv analog.com:user:util_fir_int:1.0 util_fir_int_0]
589-
set util_fir_int_1 [create_bd_cell -type ip -vlnv analog.com:user:util_fir_int:1.0 util_fir_int_1]
590-
591-
set interp_slice [create_bd_cell -type inline_hdl -vlnv xilinx.com:inline_hdl:ilslice:1.0 interp_slice]
592-
593-
set fir_decimator_0 [create_bd_cell -type ip -vlnv analog.com:user:util_fir_dec:1.0 fir_decimator_0]
594-
set fir_decimator_1 [create_bd_cell -type ip -vlnv analog.com:user:util_fir_dec:1.0 fir_decimator_1]
595-
596-
set decim_slice [create_bd_cell -type inline_hdl -vlnv xilinx.com:inline_hdl:ilslice:1.0 decim_slice]
597-
598-
set concat_0 [create_bd_cell -type inline_hdl -vlnv xilinx.com:inline_hdl:ilconcat:1.0 concat_0]
599-
set_property -dict [list CONFIG.IN1_WIDTH.VALUE_SRC USER CONFIG.IN0_WIDTH.VALUE_SRC USER] $concat_0
600-
set_property -dict [list CONFIG.IN0_WIDTH {16} CONFIG.IN1_WIDTH {16}] $concat_0
601-
set concat_1 [create_bd_cell -type inline_hdl -vlnv xilinx.com:inline_hdl:ilconcat:1.0 concat_1]
602-
set_property -dict [list CONFIG.IN1_WIDTH.VALUE_SRC USER CONFIG.IN0_WIDTH.VALUE_SRC USER] $concat_1
603-
set_property -dict [list CONFIG.IN0_WIDTH {16} CONFIG.IN1_WIDTH {16}] $concat_1
604-
set pack0_slice_0 [create_bd_cell -type inline_hdl -vlnv xilinx.com:inline_hdl:ilslice:1.0 pack0_slice_0]
605-
set_property -dict [list CONFIG.DIN_FROM {15}] $pack0_slice_0
606-
set_property -dict [list CONFIG.DIN_TO {0}] $pack0_slice_0
607-
set_property -dict [list CONFIG.DOUT_WIDTH {16}] $pack0_slice_0
608-
set pack0_slice_1 [create_bd_cell -type inline_hdl -vlnv xilinx.com:inline_hdl:ilslice:1.0 pack0_slice_1]
609-
set_property -dict [list CONFIG.DIN_FROM {31}] $pack0_slice_1
610-
set_property -dict [list CONFIG.DIN_TO {16}] $pack0_slice_1
611-
set_property -dict [list CONFIG.DOUT_WIDTH {16}] $pack0_slice_1
612-
set pack1_slice_0 [create_bd_cell -type inline_hdl -vlnv xilinx.com:inline_hdl:ilslice:1.0 pack1_slice_0]
613-
set_property -dict [list CONFIG.DIN_FROM {15}] $pack1_slice_0
614-
set_property -dict [list CONFIG.DIN_TO {0}] $pack1_slice_0
615-
set_property -dict [list CONFIG.DOUT_WIDTH {16}] $pack1_slice_0
616-
set pack1_slice_1 [create_bd_cell -type inline_hdl -vlnv xilinx.com:inline_hdl:ilslice:1.0 pack1_slice_1]
617-
set_property -dict [list CONFIG.DIN_FROM {31}] $pack1_slice_1
618-
set_property -dict [list CONFIG.DIN_TO {16}] $pack1_slice_1
619-
set_property -dict [list CONFIG.DOUT_WIDTH {16}] $pack1_slice_1
620-
621-
# fir interpolator 0
622-
connect_bd_net [get_bd_pins util_ad9361_divclk/clk_out] [get_bd_pins util_fir_int_0/aclk]
623-
connect_bd_net [get_bd_pins util_ad9361_dac_upack/enable_0] [get_bd_pins axi_ad9361_dac_fifo/din_enable_0]
624-
connect_bd_net [get_bd_pins util_ad9361_dac_upack/enable_1] [get_bd_pins axi_ad9361_dac_fifo/din_enable_1]
625-
connect_bd_net [get_bd_pins util_ad9361_dac_upack/fifo_rd_en] [get_bd_pins util_fir_int_0/s_axis_data_tready]
626-
connect_bd_net [get_bd_pins util_ad9361_dac_upack/fifo_rd_en] [get_bd_pins util_fir_int_0/s_axis_data_tvalid]
627-
connect_bd_net [get_bd_pins axi_ad9361_dac_fifo/din_data_0] [get_bd_pins util_fir_int_0/channel_0]
628-
connect_bd_net [get_bd_pins axi_ad9361_dac_fifo/din_data_1] [get_bd_pins util_fir_int_0/channel_1]
629-
connect_bd_net [get_bd_pins axi_ad9361_dac_fifo/din_valid_0] [get_bd_pins util_fir_int_0/dac_read]
630-
connect_bd_net [get_bd_pins concat_0/In0] [get_bd_pins util_ad9361_dac_upack/fifo_rd_data_0]
631-
connect_bd_net [get_bd_pins concat_0/In1] [get_bd_pins util_ad9361_dac_upack/fifo_rd_data_1]
632-
connect_bd_net [get_bd_pins concat_0/dout] [get_bd_pins util_fir_int_0/s_axis_data_tdata]
633-
634-
# fir interpolator 1
635-
connect_bd_net [get_bd_pins util_ad9361_divclk/clk_out] [get_bd_pins util_fir_int_1/aclk]
636-
connect_bd_net [get_bd_pins util_ad9361_dac_upack/enable_2] [get_bd_pins axi_ad9361_dac_fifo/din_enable_2]
637-
connect_bd_net [get_bd_pins util_ad9361_dac_upack/enable_3] [get_bd_pins axi_ad9361_dac_fifo/din_enable_3]
638-
connect_bd_net [get_bd_pins util_ad9361_dac_upack/fifo_rd_en] [get_bd_pins util_fir_int_1/s_axis_data_tvalid]
639-
connect_bd_net [get_bd_pins axi_ad9361_dac_fifo/din_data_2] [get_bd_pins util_fir_int_1/channel_0]
640-
connect_bd_net [get_bd_pins axi_ad9361_dac_fifo/din_data_3] [get_bd_pins util_fir_int_0/channel_1]
641-
connect_bd_net [get_bd_pins axi_ad9361_dac_fifo/din_valid_2] [get_bd_pins util_fir_int_1/dac_read]
642-
connect_bd_net [get_bd_pins concat_1/In0] [get_bd_pins util_ad9361_dac_upack/fifo_rd_data_2]
643-
connect_bd_net [get_bd_pins concat_1/In1] [get_bd_pins util_ad9361_dac_upack/fifo_rd_data_3]
644-
connect_bd_net [get_bd_pins concat_1/dout] [get_bd_pins util_fir_int_1/s_axis_data_tdata]
645-
646-
# gpio controlled
647-
connect_bd_net [get_bd_pins axi_ad9361/up_dac_gpio_out] [get_bd_pins interp_slice/Din]
648-
connect_bd_net [get_bd_pins util_fir_int_0/interpolate] [get_bd_pins interp_slice/Dout]
649-
connect_bd_net [get_bd_pins util_fir_int_1/interpolate] [get_bd_pins interp_slice/Dout]
650-
651-
652-
# fir decimator 0
653-
connect_bd_net [get_bd_pins util_ad9361_divclk/clk_out] [get_bd_pins fir_decimator_0/aclk]
654-
connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_data_0] [get_bd_pins fir_decimator_0/channel_0]
655-
connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_data_1] [get_bd_pins fir_decimator_0/channel_1]
656-
connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_valid_0] [get_bd_pins fir_decimator_0/s_axis_data_tvalid]
657-
connect_bd_net [get_bd_pins util_ad9361_adc_pack/enable_0 ] [get_bd_pins util_ad9361_adc_fifo/dout_enable_0]
658-
connect_bd_net [get_bd_pins util_ad9361_adc_pack/enable_1 ] [get_bd_pins util_ad9361_adc_fifo/dout_enable_1]
659-
connect_bd_net [get_bd_pins pack0_slice_0/Din] [get_bd_pins fir_decimator_0/m_axis_data_tdata]
660-
connect_bd_net [get_bd_pins pack0_slice_1/Din] [get_bd_pins fir_decimator_0/m_axis_data_tdata]
661-
connect_bd_net [get_bd_pins util_ad9361_adc_pack/fifo_wr_data_0] [get_bd_pins pack0_slice_0/Dout]
662-
connect_bd_net [get_bd_pins util_ad9361_adc_pack/fifo_wr_data_1] [get_bd_pins pack0_slice_1/Dout]
663-
664-
# fir decimator 1
665-
connect_bd_net [get_bd_pins util_ad9361_divclk/clk_out] [get_bd_pins fir_decimator_1/aclk]
666-
connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_data_2] [get_bd_pins fir_decimator_1/channel_0]
667-
connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_data_3] [get_bd_pins fir_decimator_1/channel_1]
668-
connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_valid_2] [get_bd_pins fir_decimator_1/s_axis_data_tvalid]
669-
connect_bd_net [get_bd_pins util_ad9361_adc_pack/fifo_wr_en] [get_bd_pins fir_decimator_1/m_axis_data_tvalid]
670-
connect_bd_net [get_bd_pins util_ad9361_adc_pack/enable_2 ] [get_bd_pins util_ad9361_adc_fifo/dout_enable_2]
671-
connect_bd_net [get_bd_pins util_ad9361_adc_pack/enable_3 ] [get_bd_pins util_ad9361_adc_fifo/dout_enable_3]
672-
connect_bd_net [get_bd_pins pack1_slice_0/Din] [get_bd_pins fir_decimator_1/m_axis_data_tdata]
673-
connect_bd_net [get_bd_pins pack1_slice_1/Din] [get_bd_pins fir_decimator_1/m_axis_data_tdata]
674-
connect_bd_net [get_bd_pins util_ad9361_adc_pack/fifo_wr_data_2] [get_bd_pins pack1_slice_0/Dout]
675-
connect_bd_net [get_bd_pins util_ad9361_adc_pack/fifo_wr_data_3] [get_bd_pins pack1_slice_1/Dout]
676-
677-
#gpio controlled
678-
connect_bd_net [get_bd_pins axi_ad9361/up_dac_gpio_out] [get_bd_pins decim_slice/Din]
679-
connect_bd_net [get_bd_pins fir_decimator_0/decimate] [get_bd_pins decim_slice/Dout]
680-
connect_bd_net [get_bd_pins fir_decimator_1/decimate] [get_bd_pins decim_slice/Din]

0 commit comments

Comments
 (0)