Post Go back to editing

AD9176 Mode 2

Category: Hardware
Product Number: AD9176
Software Version: 2019_r2

Hello,

I am trying to use the AD9176 + ZCU102 reference project but I want to use all 3 channels per DAC, so I changed the mode in config.tcl from the default of 04 to 02. Mode 4 works fine but mode 2 errors out when building the block design. I have tried both the 2019_r2 release as well as the latest on master. 

ERROR: [IP_Flow 19-3461] Value '96' is out of the range for parameter 'Bus Width(DMA_DATA_WIDTH_DEST)' for BD Cell 'dac_dma' . Valid values are - 16, 32, 64, 128, 256, 512, 1024
INFO: [IP_Flow 19-3438] Customization errors found on 'dac_dma'. Restoring to previous valid configuration.
INFO: [Common 17-17] undo 'set_property'
ERROR: [Common 17-39] 'set_property' failed due to earlier errors.

    while executing
"rdi::add_properties -dict {CONFIG.DMA_TYPE_SRC 0 CONFIG.DMA_TYPE_DEST 1 CONFIG.DMA_DATA_WIDTH_SRC 64 CONFIG.DMA_DATA_WIDTH_DEST 96} /dac_dma"
    invoked from within
"set_property -dict $config $cell"
    invoked from within
"if {$i_params != {}} {
    set config {}
    # Add CONFIG. prefix to all config options
    foreach {k v} $i_params {
      lappend config "CONFIG.$k"..."
    (procedure "ad_ip_instance" line 4)
    invoked from within
"ad_ip_instance axi_dmac dac_dma [list \
  DMA_TYPE_SRC 0 \
  DMA_TYPE_DEST 1 \
  DMA_DATA_WIDTH_SRC 64 \
  DMA_DATA_WIDTH_DEST $dac_dma_data_width \
]"
    (file "../common/dac_fmc_ebz_bd.tcl" line 79)

Do you have any advice on getting this to work in mode 2?

Steps to reproduce:

  • clean copy of hdl repo
  • modify projects/dac_fmc_ebz/common/config.tcl to set mode 04 rather than mode 02
  • build zcu102 project

Thanks,
Jason

  • Hello,

    Thank for reporting this. Apparently this case is not supported well by the generic block design so some manual modifications are required.

    You could set the util_unpack core to have more channels (8)  and increase bus width of the DMA to 128  as the width of the axi_dac_fifo.

    Thank you,

    Laszlo

  • I'm back to working on this. I'm trying to get a dual-link Mode 2 going. Dual-link Mode 4 works just fine but the TCL scripts don't work for Mode 2 so I'm looking for some guidance.

    Here's the clocking I'm using as per the default Mode 4 configuration:
    pll1-clkin: 122,880,000
    pll2-out: 2,949,120,000 (24x clkin)
    DAC_CLK: 368,640,000 (/8)
    DAC_SYSREF: 5,760,000 (/512)
    FPGA_CLK: 368,640,000 (/8)
    FPGA_SYSREF: 5,760,000 (/512)
    adi,dac-interpolation = <8>;
    adi,channel-interpolation = <4>;
    adi,clock-output-divider = <4>;    (no idea what this setting does)
    dac-rate: 11,796,480,000 (32x dac_clk)

    I'd like to keep these same settings but with Mode 2. In Mode 4 I see the TPL core has a width of 256 (8 converters * 16b * 2 samples/clk). The link clock (util_dac_jesd204_xcvr/tx_out_clk_0) must be running at 184.32MHz (half the 368.64M FPGA_CLK). 

    Changing to Mode 2 I know the JESD link rate must double, since Lane Rate = (M/L) × NP × (10/8) × Data Rate and my (M/L) has gone from (8/8) to (12/6).

    When I changed config.tcl to be Mode 2, the DAC_DATA_WIDTH variable in dac_fmc_ebz_bd.tcl is set to 2*3*32= 192. This is lower than the 256 in Mode 4 since the TCL script bases the width on the number of lanes (which decreased) rather than the number of converters which increased. I believe I want it to be a width of 384 (12 converters * 16b * 2 samples/clk) so I can keep 2 samples per clock.

    To DMA of course doesn't support 384 so I increased the width to 512.

    The TPL core doesn't support the 12 converters needed for dual-link Mode 2. To fix this I added 12 to the list of NUM_CHANNELS in ad_ip_jesd204_tpl_dac_ip.tcl. This then configured to a width of 192 rather than my desired 384. I believe I need to set the link_layer_bytes_per_beat from the default of 4 to 8. Is this correct?

    The output of the TPL core then goes to the dac_jesd204_link which again defaults to 192 width on the input and output. I can change these by increasing the "Data Path Width" and "Tpl Data Path Width" from 4 to 8 but I don't entirely know what this will do. The phy link then goes to the xcvr core which I again don't know if I need to change the width.

    Key questions:
    - Do I need to change any of the clock rates for Mode 2?
    - How does the JESD link "know" to double the lane rate? Is that just by the device tree setting?
    - How is the internal FPGA clock configured to be half the input reference clock rate?
    - Are the changes I proposed (double TPL core bytes per beat, JESD transmit input/output data widths) correct?
    - Any other guidance on how to make Mode 2 work?

    Thanks,
    Jason

  • Hi  ,

    Just letting you know that we saw your new reply. It's very easy to miss new replies at already marked as solved threads.

    Will get back next week, but it will take some time because this needs a little bit more investigation.

    Best regards,
    Iulia

  • Hi  ,

    Apologies for the late reply, this might take a while to investigate. I will try to come back with a clear answer by next week.

    Meanwhile, are there any updates regarding this?

    Best regards,

    Andrei

  • No updates here. We're currently planning to stick with Mode 4 for the time being.

  • Hello,

    You can run single-link Mode 2 by doing the following manual modifications:

    - In config.tcl set mode to 02
    - In dac_fmc_ebz_bd.tcl set DAC_DATA_WIDTH to the next available value (128 in this case)
    - In the devicetree for mode4:
    - set adi,jesd-link-mode = <2>
    - remove adi,out-clk-select = <XCVR_REFCLK_DIV2>

    This should be enough for the single link Mode 2 to work.
    For dual-link it seems that the lack of support for 12 converters inside the tpl core could be a problem. I tried to find a way around it and I also used your idea, but couldn't get it to work.
    For now, I'd say that the dual-link mode 2 is not supported, but any other mode should work fine.

    > Do I need to change any of the clock rates for Mode 2?
    No, just the changes mentioned above are enough.


    > How does the JESD link "know" to double the lane rate? Is that just by the device tree setting?
    It is calculated based on the JESD parameters which change according to the selected link mode.


    > How is the internal FPGA clock configured to be half the input reference clock rate?
    Not sure what you mean. The FPGA clock is 368.64 MHz by default. The device clock should be Lane_rate/40 and is derived from FPGA clock. To configure the device clock as half of FPGA clock, you use this setting in the devicetree - adi,out-clk-select = <XCVR_REFCLK_DIV2>


    > Are the changes I proposed (double TPL core bytes per beat, JESD transmit input/output data widths) correct?
    Might need to look into it a bit more, but from initial testing, they don't seem to work.


    > Any other guidance on how to make Mode 2 work?
    It should work with the changes described above if you want to keep the settings from mode 4, but if you want to play around with the settings, I suggest consulting the datasheet first.

    Best regards,
    Andrei

  •  Hi  ,

    Do you have any updates on this matter? Or you will still stick with the Mode 4?

    If so, would it be ok if we close this thread for now and reopen it (by replying) at a later time when you have other updates?

    Iulia

  • Sure, no further updates here. We are fine with dual-link mode 4 for our project.