77-------------------------------------------------------------------------------
88
99This wiki page describes how to add a custom processing module into the
10- :git-hdl: `FMCOMMS2 <EVAL-AD-FMCOMMS2-EBZ > `'s TX and/or RX data path.
10+ :git-hdl: `FMCOMMS2 <projects/fmcomms2 > `'s TX and/or RX data path.
1111
1212In this example, the custom modules are going to be some digital FIR filters,
1313to decimate and interpolate the incoming and outcoming data stream.
@@ -150,13 +150,11 @@ Adding FIR filters in FMCOMMS2 design and building the HDL
150150
151151The design is obtain by simply sourcing the base FMCOMMS2 block design.
152152
153- # TODO: clarify the commands below
154-
155153.. code-block :: tcl
156154
157155 set project_dir [pwd]
158156 cd $ad_hdl_dir/projects/fmcomms2/zc706/
159- source system_bd .tcl
157+ source system_project .tcl
160158 cd $project_dir
161159
162160 At this point, FMCOMMS2 reference design's TX data path has the following
@@ -329,12 +327,13 @@ when interpolation is activated and by the axi_ad9361_core when interpolation
329327is not active. In the reference design, the data flow is controlled by the
330328ad9631_core.
331329
332- We must connect the upack_core's dma_xfer_in port to VCC so that the UPACK may
333- transmit the valid and enable signals from one entity to another.
330+ ..
331+ We must connect the upack_core's dma_xfer_in port to VCC so that the UPACK may
332+ transmit the valid and enable signals from one entity to another.
334333
335- .. code-block :: tcl
334+ .. code-block :: tcl
336335
337- ad_connect util_ad9361_dac_upack/dma_xfer_in VCC
336+ ad_connect util_ad9361_dac_upack/dma_xfer_in VCC
338337
339338 At this moment, the Interpolation filters are completely integrated into the
340339design and the data path should look like the one in the figure below.
@@ -366,7 +365,7 @@ Connecting the FIR decimation filters on the Rx side
366365 connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_data_2] [get_bd_pins fir_decimator_1/channel_0]
367366 connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_data_3] [get_bd_pins fir_decimator_1/channel_1]
368367 connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_valid_2] [get_bd_pins fir_decimator_1/s_axis_data_tvalid]
369- connect_bd_net [get_bd_pins util_ad9361_dac_pack/fifo_rd_en ] [get_bd_pins fir_decimator_1/m_axis_data_tvalid]
368+ connect_bd_net [get_bd_pins util_ad9361_adc_pack/fifo_wr_en ] [get_bd_pins fir_decimator_1/m_axis_data_tvalid]
370369 connect_bd_net [get_bd_pins util_ad9361_adc_pack/enable_2 ] [get_bd_pins util_ad9361_adc_fifo/dout_enable_2]
371370 connect_bd_net [get_bd_pins util_ad9361_adc_pack/enable_3 ] [get_bd_pins util_ad9361_adc_fifo/dout_enable_3]
372371 connect_bd_net [get_bd_pins pack1_slice_0/Din] [get_bd_pins fir_decimator_1/m_axis_data_tdata]
@@ -405,6 +404,11 @@ Base system functionality
405404For simply testing the FMCOMMS2 with filter design, we loop-back the data from
406405TX to RX for each channel with a SMA to SMA cable.
407406
407+ .. image :: fmcomms2_txrx_loopback.jpg
408+ :width: 1000
409+ :align: center
410+ :alt: FMCOMMS2_TXRX_LOOPBACK
411+
408412When first booting up the design, none of the filters will be active.
409413For the beginning make sure you have the same **LO frequency for RX and TX **,
410414as in the picture below.
@@ -416,8 +420,9 @@ the FIR interpolation filters. On the decimation side, data will always pass
416420through decimation filters.
417421
418422Below are the settings for FMCOMMS2 and the data plot in FFT and Time Domain
419- for the "sinewave_0.6.mat". As a functionality example, only one of the two
420- channels will be enabled.
423+ for the "sinewave_0.6.mat". The file "sinewave_0.6.mat" can be found under
424+ the installation folder, in **lib\o sc\w aveforms **. As a functionality example,
425+ only one of the two channels will be enabled.
421426
422427**FFT Domain **
423428
@@ -468,16 +473,12 @@ Activating Filters
468473Interpolation filter
469474~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
470475
471- # TODO: update the following paragraph and the link
472-
473476In the `Connecting the FIR interpolation filters on the Tx side `_ section
474477above, we added a GPIO control. The ad9361_core GPIO control register can be
475- found in the register map at the address **0xBC ** :dokuwiki: ` axi_ad9361_core </resources/fpga/docs/axi_ad9361> `
478+ found in the register map at the address **0xBC ** ` AXI AD9361 `_.
476479
477480To activate the interpolation filter, one must go to the Debug mode:
478481
479- # TODO: make sure these steps are up-to-date
480-
481482- At section Device selection chose **"cf-ad9361-dds-core-lpc" **
482483- In the Register Map settings, select the source to be AXI_CORE
483484- Read the 0xBC address then write 0x1 value at it, this will activate the filter.
@@ -511,10 +512,8 @@ At this point, again all filters are disabled.
511512Similar to interpolation, to activate the decimation we must go to the Debug,
512513but this time select the "cf-ad9361-lpc".
513514
514- # TODO: update the paragraph below
515-
516515Select the "Register Map Settings" source to be "AXI_CORE" and at the same
517- address **0xBC ** :dokuwiki: ` axi_ad9361_core </resources/fpga/docs/axi_ad9361> `
516+ address **0xBC ** ` AXI AD9361 `_.
518517this time being the ADC side GPIO, write 0x1, as in the example below:
519518
520519.. image :: activate_rx_interpolation_filters_write.png
@@ -549,14 +548,15 @@ All filters active characteristic
549548
550549**Time Domain characteristic **
551550
552- # TODO: missing image from Time Domain characteristic?
551+ .. image :: fmcomms2_fir_tx_rx_active_waveform.png
552+ :width: 1000
553+ :align: center
554+ :alt: FMCOMMS_FIR_TX_RX_ACTIVE_WAVEFORM
553555
554556Download
555557-------------------------------------------------------------------------------
556558
557- # TODO: update this link
558-
559- - `boot.zip <resources/fpga/docs/hdl/boot.zip >`__
559+ - :dokuwiki: `boot.zip <_media/resources/fpga/docs/hdl/boot.zip> `
560560- Sources from older examples can be found under the tag
561561 `eg_fmcomms2_fir_filter `_ using Vivado 16.2 and 16.4 versions, and
562562 **are not supported by us anymore **.
@@ -573,3 +573,120 @@ References
573573
574574.. _eg_fmcomms2_fir_filter : https://github.com/analogdevicesinc/hdl/releases/tag/eg_fmcomms2_fir_filter
575575.. _MATLAB : https://www.mathworks.com/products/matlab.html
576+ .. _AXI AD9361 : https://analogdevicesinc.github.io/hdl/library/axi_ad9361/index.html#register-map
577+
578+ .. code-block :: tcl
579+
580+ # delete reference design connections
581+ delete_bd_objs [get_bd_nets axi_ad9361_dac_fifo_din_valid_0]
582+ delete_bd_objs [get_bd_nets axi_ad9361_dac_fifo_din_enable_*]
583+ delete_bd_objs [get_bd_nets util_ad9361_dac_upack_fifo_rd_data_*]
584+ delete_bd_objs [get_bd_nets util_ad9361_dac_upack_fifo_rd_underflow]
585+ delete_bd_objs [get_bd_nets util_ad9361_dac_upack_fifo_rd_valid]
586+
587+ delete_bd_objs [get_bd_nets util_ad9361_adc_fifo_dout_valid_0]
588+ delete_bd_objs [get_bd_nets util_ad9361_adc_fifo_dout_enable_*]
589+ delete_bd_objs [get_bd_nets util_ad9361_adc_fifo_dout_data_*]
590+
591+ set fir_interpolator_0 [ create_bd_cell -type ip -vlnv analog.com:user:util_fir_int:1.0 fir_interpolator_0 ]
592+ set fir_interpolator_1 [ create_bd_cell -type ip -vlnv analog.com:user:util_fir_int:1.0 fir_interpolator_1 ]
593+
594+ set interp_slice [ create_bd_cell -type ip -vlnv xilinx.com:ip:xlslice:1.0 interp_slice ]
595+
596+ set fir_decimator_0 [ create_bd_cell -type ip -vlnv analog.com:user:util_fir_dec:1.0 fir_decimator_0 ]
597+ set fir_decimator_1 [ create_bd_cell -type ip -vlnv analog.com:user:util_fir_dec:1.0 fir_decimator_1 ]
598+
599+ set decim_slice [ create_bd_cell -type ip -vlnv xilinx.com:ip:xlslice:1.0 decim_slice ]
600+
601+ set concat_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:xlconcat:2.1 concat_0 ]
602+ set_property -dict [list CONFIG.IN1_WIDTH.VALUE_SRC USER CONFIG.IN0_WIDTH.VALUE_SRC USER] $concat_0
603+ set_property -dict [list CONFIG.IN0_WIDTH {16} CONFIG.IN1_WIDTH {16}] $concat_0
604+
605+ set concat_1 [ create_bd_cell -type ip -vlnv xilinx.com:ip:xlconcat:2.1 concat_1 ]
606+ set_property -dict [list CONFIG.IN1_WIDTH.VALUE_SRC USER CONFIG.IN0_WIDTH.VALUE_SRC USER] $concat_1
607+ set_property -dict [list CONFIG.IN0_WIDTH {16} CONFIG.IN1_WIDTH {16}] $concat_1
608+
609+ set pack0_slice_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:xlslice:1.0 pack0_slice_0 ]
610+ set_property -dict [list CONFIG.DIN_FROM {15}] $pack0_slice_0
611+ set_property -dict [list CONFIG.DIN_TO {0}] $pack0_slice_0
612+ set_property -dict [list CONFIG.DOUT_WIDTH {16}] $pack0_slice_0
613+
614+ set pack0_slice_1 [ create_bd_cell -type ip -vlnv xilinx.com:ip:xlslice:1.0 pack0_slice_1 ]
615+ set_property -dict [list CONFIG.DIN_FROM {31}] $pack0_slice_1
616+ set_property -dict [list CONFIG.DIN_TO {16}] $pack0_slice_1
617+ set_property -dict [list CONFIG.DOUT_WIDTH {16}] $pack0_slice_1
618+
619+ set pack1_slice_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:xlslice:1.0 pack1_slice_0 ]
620+ set_property -dict [list CONFIG.DIN_FROM {15}] $pack1_slice_0
621+ set_property -dict [list CONFIG.DIN_TO {0}] $pack1_slice_0
622+ set_property -dict [list CONFIG.DOUT_WIDTH {16}] $pack1_slice_0
623+
624+ set pack1_slice_1 [ create_bd_cell -type ip -vlnv xilinx.com:ip:xlslice:1.0 pack1_slice_1 ]
625+ set_property -dict [list CONFIG.DIN_FROM {31}] $pack1_slice_1
626+ set_property -dict [list CONFIG.DIN_TO {16}] $pack1_slice_1
627+ set_property -dict [list CONFIG.DOUT_WIDTH {16}] $pack1_slice_1
628+
629+ # fir interpolator 0
630+ connect_bd_net [get_bd_pins util_ad9361_divclk/clk_out] [get_bd_pins fir_interpolator_0/aclk]
631+ connect_bd_net [get_bd_pins util_ad9361_dac_upack/enable_0] [get_bd_pins axi_ad9361_dac_fifo/din_enable_0]
632+ connect_bd_net [get_bd_pins util_ad9361_dac_upack/enable_1] [get_bd_pins axi_ad9361_dac_fifo/din_enable_1]
633+ connect_bd_net [get_bd_pins util_ad9361_dac_upack/fifo_rd_en] [get_bd_pins fir_interpolator_0/s_axis_data_tready]
634+ connect_bd_net [get_bd_pins util_ad9361_dac_upack/fifo_rd_en] [get_bd_pins fir_interpolator_0/s_axis_data_tvalid]
635+ connect_bd_net [get_bd_pins axi_ad9361_dac_fifo/din_data_0] [get_bd_pins fir_interpolator_0/channel_0]
636+ connect_bd_net [get_bd_pins axi_ad9361_dac_fifo/din_data_1] [get_bd_pins fir_interpolator_0/channel_1]
637+ connect_bd_net [get_bd_pins axi_ad9361_dac_fifo/din_valid_0] [get_bd_pins fir_interpolator_0/dac_read]
638+
639+
640+ connect_bd_net [get_bd_pins concat_0/In0 ] [get_bd_pins util_ad9361_dac_upack/fifo_rd_data_0]
641+ connect_bd_net [get_bd_pins concat_0/In1 ] [get_bd_pins util_ad9361_dac_upack/fifo_rd_data_1]
642+ connect_bd_net [get_bd_pins concat_0/dout ] [get_bd_pins fir_interpolator_0/s_axis_data_tdata]
643+
644+ # fir interpolator 1
645+ connect_bd_net [get_bd_pins util_ad9361_divclk/clk_out] [get_bd_pins fir_interpolator_1/aclk]
646+ connect_bd_net [get_bd_pins util_ad9361_dac_upack/enable_2] [get_bd_pins axi_ad9361_dac_fifo/din_enable_2]
647+ connect_bd_net [get_bd_pins util_ad9361_dac_upack/enable_3] [get_bd_pins axi_ad9361_dac_fifo/din_enable_3]
648+ connect_bd_net [get_bd_pins util_ad9361_dac_upack/fifo_rd_en] [get_bd_pins fir_interpolator_1/s_axis_data_tvalid]
649+ connect_bd_net [get_bd_pins axi_ad9361_dac_fifo/din_data_2] [get_bd_pins fir_interpolator_1/channel_0]
650+ connect_bd_net [get_bd_pins axi_ad9361_dac_fifo/din_data_3] [get_bd_pins fir_interpolator_0/channel_1]
651+ connect_bd_net [get_bd_pins axi_ad9361_dac_fifo/din_valid_2] [get_bd_pins fir_interpolator_1/dac_read]
652+
653+
654+ connect_bd_net [get_bd_pins concat_1/In0 ] [get_bd_pins util_ad9361_dac_upack/fifo_rd_data_2]
655+ connect_bd_net [get_bd_pins concat_1/In1 ] [get_bd_pins util_ad9361_dac_upack/fifo_rd_data_3]
656+ connect_bd_net [get_bd_pins concat_1/dout ] [get_bd_pins fir_interpolator_1/s_axis_data_tdata]
657+
658+ # gpio controlled
659+ connect_bd_net [get_bd_pins axi_ad9361/up_dac_gpio_out] [get_bd_pins interp_slice/Din]
660+ connect_bd_net [get_bd_pins fir_interpolator_0/interpolate] [get_bd_pins interp_slice/Dout]
661+ connect_bd_net [get_bd_pins fir_interpolator_1/interpolate] [get_bd_pins interp_slice/Dout]
662+
663+
664+ # fir decimator 0
665+ connect_bd_net [get_bd_pins util_ad9361_divclk/clk_out] [get_bd_pins fir_decimator_0/aclk]
666+ connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_data_0] [get_bd_pins fir_decimator_0/channel_0]
667+ connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_data_1] [get_bd_pins fir_decimator_0/channel_1]
668+ connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_valid_0] [get_bd_pins fir_decimator_0/s_axis_data_tvalid]
669+ connect_bd_net [get_bd_pins util_ad9361_adc_pack/enable_0 ] [get_bd_pins util_ad9361_adc_fifo/dout_enable_0]
670+ connect_bd_net [get_bd_pins util_ad9361_adc_pack/enable_1 ] [get_bd_pins util_ad9361_adc_fifo/dout_enable_1]
671+ connect_bd_net [get_bd_pins pack0_slice_0/Din] [get_bd_pins fir_decimator_0/m_axis_data_tdata]
672+ connect_bd_net [get_bd_pins pack0_slice_1/Din] [get_bd_pins fir_decimator_0/m_axis_data_tdata]
673+ connect_bd_net [get_bd_pins util_ad9361_adc_pack/fifo_wr_data_0] [get_bd_pins pack0_slice_0/Dout]
674+ connect_bd_net [get_bd_pins util_ad9361_adc_pack/fifo_wr_data_1] [get_bd_pins pack0_slice_1/Dout]
675+
676+ # fir decimator 1
677+ connect_bd_net [get_bd_pins util_ad9361_divclk/clk_out] [get_bd_pins fir_decimator_1/aclk]
678+ connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_data_2] [get_bd_pins fir_decimator_1/channel_0]
679+ connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_data_3] [get_bd_pins fir_decimator_1/channel_1]
680+ connect_bd_net [get_bd_pins util_ad9361_adc_fifo/dout_valid_2] [get_bd_pins fir_decimator_1/s_axis_data_tvalid]
681+ connect_bd_net [get_bd_pins util_ad9361_adc_pack/fifo_wr_en] [get_bd_pins fir_decimator_1/m_axis_data_tvalid]
682+ connect_bd_net [get_bd_pins util_ad9361_adc_pack/enable_2 ] [get_bd_pins util_ad9361_adc_fifo/dout_enable_2]
683+ connect_bd_net [get_bd_pins util_ad9361_adc_pack/enable_3 ] [get_bd_pins util_ad9361_adc_fifo/dout_enable_3]
684+ connect_bd_net [get_bd_pins pack1_slice_0/Din] [get_bd_pins fir_decimator_1/m_axis_data_tdata]
685+ connect_bd_net [get_bd_pins pack1_slice_1/Din] [get_bd_pins fir_decimator_1/m_axis_data_tdata]
686+ connect_bd_net [get_bd_pins util_ad9361_adc_pack/fifo_wr_data_2] [get_bd_pins pack1_slice_0/Dout]
687+ connect_bd_net [get_bd_pins util_ad9361_adc_pack/fifo_wr_data_3] [get_bd_pins pack1_slice_1/Dout]
688+
689+ #gpio controlled
690+ connect_bd_net [get_bd_pins axi_ad9361/up_dac_gpio_out] [get_bd_pins decim_slice/Din]
691+ connect_bd_net [get_bd_pins fir_decimator_0/decimate] [get_bd_pins decim_slice/Dout]
692+ connect_bd_net [get_bd_pins fir_decimator_1/decimate] [get_bd_pins decim_slice/Din]
0 commit comments