diff --git a/docs/library/axi_ltc2387/index.rst b/docs/library/axi_ltc2387/index.rst index 8d3debf8bc8..35a9a525d48 100644 --- a/docs/library/axi_ltc2387/index.rst +++ b/docs/library/axi_ltc2387/index.rst @@ -7,8 +7,7 @@ AXI LTC2387 :path: library/axi_ltc2387 The :git-hdl:`AXI LTC2387 ` IP core can be used to -interface :adi:`LTC2387-18`, :adi:`LTC2386-18`, :adi:`LTC2385-18` and -:adi:`ADAQ23878` devices. +interface :adi:`LTC2387-18`, :adi:`LTC2387-16` and :adi:`ADAQ23878` devices. This documentation only covers the IP core and requires that one must be familiar with the device for a complete and better understanding. @@ -74,15 +73,10 @@ From the HDL perspective, the selection between the 16-bit and the 18-bit version of the chip, is done by the `ADC_RES` and `OUT_RES` parameters of the modules. -* For the 18-bit, ADC_RES=18 (=> OUT_RES=32; addresses should be on a nb. of +* For the 18-bit, ADC_RES=18 (=> OUT_RES=32; addresses should be on a no. of bits power of 2) * For the 16-bit, ADC_RES=16 (=> OUT_RES=16) -.. warning:: - - When using the ONE LANE configuration (TWOLANES=0), the only resolution - supported is 18 bits! - Detailed Description -------------------------------------------------------------------------------- @@ -143,7 +137,8 @@ system level. The :ref:`axi_ltc2387 interface` must be connected directly to the top file of the design, as I/O primitives are part of the IP. -The example design uses a DMA to move the data from the output of the IP to memory. +The example design uses a DMA to move the data from the output of the IP to +memory. If the data needs to be processed in HDL before moving to the memory, it can be done at the output of the IP (at the system level) or inside the ADC interface @@ -169,8 +164,7 @@ References * HDL project at :git-hdl:`projects/cn0577` * HDL project documentation at :ref:`cn0577` * :adi:`LTC2387-18` 18-bit 15 MSPS -* :adi:`LTC2386-18` 18-bit 10 MSPS -* :adi:`LTC2385-18` 18-bit 5 MSPS +* :adi:`LTC2387-16` 16-bit 15 MSPS * :adi:`ADAQ23878` 18-bit 15 MSPS * :xilinx:`Zynq-7000 SoC Overview `. * :xilinx:`Zynq-7000 SoC Packaging and Pinout `. diff --git a/docs/projects/cn0577/cn0577_zed_block_diagram.svg b/docs/projects/cn0577/cn0577_zed_block_diagram.svg index 2af6a47b691..ea31a5e7849 100644 --- a/docs/projects/cn0577/cn0577_zed_block_diagram.svg +++ b/docs/projects/cn0577/cn0577_zed_block_diagram.svg @@ -3,13 +3,13 @@ @@ -108,7 +108,7 @@ @@ -123,7 +123,7 @@ @@ -140,7 +140,7 @@ inkscape:connector-curvature="0" id="path4660-1" d="M 5.77,0 -2.88,5 V -5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" transform="scale(-0.4)" /> @@ -215,7 +215,7 @@ inkscape:stockid="TriangleInL"> @@ -230,7 +230,7 @@ inkscape:stockid="TriangleInL"> @@ -245,7 +245,7 @@ inkscape:stockid="TriangleInL"> @@ -260,7 +260,7 @@ inkscape:stockid="TriangleInL"> @@ -275,7 +275,7 @@ inkscape:stockid="TriangleInL"> @@ -290,7 +290,7 @@ inkscape:stockid="TriangleInL"> @@ -323,7 +323,7 @@ inkscape:stockid="TriangleInM"> @@ -338,7 +338,7 @@ inkscape:stockid="TriangleInM"> @@ -353,7 +353,7 @@ inkscape:stockid="TriangleInM"> @@ -368,7 +368,7 @@ inkscape:stockid="TriangleInL"> @@ -393,7 +393,7 @@ inkscape:stockid="TriangleOutM"> @@ -408,7 +408,7 @@ inkscape:stockid="TriangleOutM"> @@ -423,7 +423,7 @@ inkscape:stockid="TriangleOutM"> @@ -438,7 +438,7 @@ inkscape:stockid="TriangleInM"> @@ -453,7 +453,7 @@ inkscape:stockid="TriangleOutM"> @@ -468,7 +468,7 @@ inkscape:stockid="TriangleOutM"> @@ -483,7 +483,7 @@ inkscape:stockid="TriangleOutM"> @@ -498,7 +498,7 @@ inkscape:stockid="TriangleOutM"> @@ -513,7 +513,7 @@ inkscape:stockid="TriangleOutM"> @@ -528,7 +528,7 @@ inkscape:stockid="TriangleOutM"> @@ -543,7 +543,7 @@ inkscape:stockid="TriangleOutM"> @@ -558,7 +558,7 @@ inkscape:stockid="TriangleOutM"> @@ -573,7 +573,7 @@ inkscape:stockid="TriangleOutM"> @@ -588,7 +588,7 @@ inkscape:stockid="TriangleOutM"> @@ -603,7 +603,7 @@ inkscape:stockid="TriangleOutM"> @@ -618,7 +618,7 @@ inkscape:stockid="TriangleOutM"> @@ -633,7 +633,7 @@ inkscape:stockid="TriangleOutM"> @@ -648,7 +648,7 @@ inkscape:stockid="TriangleOutM"> @@ -663,7 +663,7 @@ inkscape:stockid="TriangleOutM"> @@ -678,7 +678,7 @@ inkscape:stockid="TriangleOutM"> @@ -693,7 +693,7 @@ inkscape:stockid="TriangleOutM"> @@ -708,7 +708,7 @@ inkscape:stockid="TriangleOutM"> @@ -723,7 +723,7 @@ inkscape:stockid="TriangleOutM"> @@ -847,23 +847,27 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.4142136" - inkscape:cx="451.48767" - inkscape:cy="188.0904" + inkscape:cx="235.82011" + inkscape:cy="278.60006" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" units="px" - inkscape:window-width="1920" - inkscape:window-height="1018" - inkscape:window-x="-6" - inkscape:window-y="-6" + inkscape:window-width="1680" + inkscape:window-height="979" + inkscape:window-x="-8" + inkscape:window-y="-8" inkscape:window-maximized="1" showguides="true" inkscape:pagecheckerboard="0" - inkscape:snap-text-baseline="false"> + inkscape:snap-text-baseline="false" + inkscape:showpageshadow="2" + inkscape:deskcolor="#d1d1d1"> + id="grid7015" + originx="0" + originy="0" /> @@ -886,8 +890,8 @@ id="rect4477" width="545.4068" height="441.17999" - x="10.62466" - y="532.0343" + x="27.624659" + y="464.0343" inkscape:export-filename="C:\workspace\ad\ghdl\docs\block_diagrams\cn0577\cn0577_block_diagram.png" inkscape:export-xdpi="224.36" inkscape:export-ydpi="224.36" /> @@ -895,7 +899,7 @@ sodipodi:nodetypes="cc" inkscape:connector-curvature="0" id="path4518" - d="M 325.19076,543.09283 V 523.93246" + d="M 342.19076,475.09283 V 455.93246" style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInM);marker-end:url(#TriangleOutM);shape-rendering:crispEdges;enable-background:new" inkscape:export-filename="C:\workspace\ad\ghdl\docs\block_diagrams\cn0577\cn0577_block_diagram.png" inkscape:export-xdpi="224.36" @@ -904,7 +908,7 @@ sodipodi:nodetypes="cc" inkscape:connector-curvature="0" id="path4518-5" - d="M 351.30766,543.08625 V 524.02546" + d="M 368.30766,475.08625 V 456.02546" style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInM-7);marker-end:url(#TriangleOutM-2);shape-rendering:crispEdges;enable-background:new" inkscape:export-filename="C:\workspace\ad\ghdl\docs\block_diagrams\cn0577\cn0577_block_diagram.png" inkscape:export-xdpi="224.36" @@ -913,7 +917,7 @@ sodipodi:nodetypes="cc" inkscape:connector-curvature="0" id="path4518-5-9" - d="M 377.42456,543.06461 V 523.90446" + d="M 394.42456,475.06461 V 455.90446" style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInM-7-1);marker-end:url(#TriangleOutM-2-8);shape-rendering:crispEdges;enable-background:new" inkscape:export-filename="C:\workspace\ad\ghdl\docs\block_diagrams\cn0577\cn0577_block_diagram.png" inkscape:export-xdpi="224.36" @@ -924,14 +928,14 @@ id="rect4136" width="420.3652" height="75.00399" - x="-443.34177" - y="547.59076" + x="-460.34177" + y="479.59076" inkscape:export-filename="C:\workspace\ad\ghdl\docs\block_diagrams\cn0577\cn0577_block_diagram.png" inkscape:export-xdpi="224.36" inkscape:export-ydpi="224.36" /> Ethernet UART DDRx SPI IInterrupts Timer Receive path + x="57.718426" + y="452.58875">Receive path MEMORY INTERCONNECT Zed @@ -1182,16 +1186,16 @@ id="rect4488" width="28.897602" height="320.47269" - x="541.09644" - y="646.815" + x="558.09644" + y="578.815" inkscape:export-xdpi="224.36" inkscape:export-ydpi="224.36" inkscape:export-filename="C:\workspace\ad\ghdl\docs\block_diagrams\cn0577\cn0577_block_diagram.png" /> FMC CONNECTOR DMA DMA_clk= 100MHz ref_clk = 120MHz ARM (Zynq) @@ -1361,24 +1365,38 @@ style="fill:#a01414;fill-opacity:1;fill-rule:evenodd;stroke:#a01414;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" sodipodi:nodetypes="cccccccc" /> + + + + transform="matrix(1.7478534,0,0,1,-68.40762,-80.514048)" /> DCO - - - ref_clk = 120MHz sampling_clk clk_gate CNV pwm_0 pwm_1 @@ -1763,7 +1767,7 @@ @@ -1872,7 +1876,7 @@ @@ -2009,8 +2013,8 @@ 64 16/18 + x="292.12854" + y="695.64124">16/18 `__ diff --git a/library/axi_ltc2387/axi_ltc2387.v b/library/axi_ltc2387/axi_ltc2387.v index 274789045e3..0ef4871e791 100644 --- a/library/axi_ltc2387/axi_ltc2387.v +++ b/library/axi_ltc2387/axi_ltc2387.v @@ -1,6 +1,6 @@ // *************************************************************************** // *************************************************************************** -// Copyright (C) 2022-2024 Analog Devices, Inc. All rights reserved. +// Copyright (C) 2022-2025 Analog Devices, Inc. All rights reserved. // // In this HDL repository, there are many different and unique modules, consisting // of various HDL (Verilog or VHDL) components. The individual modules are @@ -52,7 +52,7 @@ module axi_ltc2387 #( parameter OUT_RES = 32, // 32-bit for ADC_RES=18 or 16-bit for ADC_RES=16 parameter TWOLANES = 1 ) ( - input delay_clk, + input delay_clk, // adc interface @@ -159,7 +159,7 @@ module axi_ltc2387 #( .FPGA_TECHNOLOGY (FPGA_TECHNOLOGY), .IO_DELAY_GROUP (IO_DELAY_GROUP), .DELAY_REFCLK_FREQUENCY (DELAY_REFCLK_FREQUENCY), - .RESOLUTION (ADC_RES), + .ADC_RES (ADC_RES), .IODELAY_CTRL (IODELAY_CTRL), .TWOLANES (TWOLANES) ) i_if ( diff --git a/library/axi_ltc2387/axi_ltc2387_channel.v b/library/axi_ltc2387/axi_ltc2387_channel.v index d56254dc56b..fe57fc578fe 100644 --- a/library/axi_ltc2387/axi_ltc2387_channel.v +++ b/library/axi_ltc2387/axi_ltc2387_channel.v @@ -101,7 +101,13 @@ module axi_ltc2387_channel #( assign adc_pn_err_s = adc_pn_err; - // expected pattern + // expected patterns: + // 18-bit, one-lane: 10 1000 0001 1111 1100 + // 16-bit, one-lane: 10 1000 0001 1111 11 + // 18-bit, two-lane: 11 0011 0000 1111 1100 + // 16-bit, one-lane: 11 0011 0000 1111 11 + // basically, the 16-bit variant doesn't have the LSBs 00 + // so we can sum this up as the 16-bit expected pattern + 2 zeroes for the 18-bit one generate if (TWOLANES == 1) begin diff --git a/library/axi_ltc2387/axi_ltc2387_if.v b/library/axi_ltc2387/axi_ltc2387_if.v index b1cefbc26c4..cbd73b1cfea 100644 --- a/library/axi_ltc2387/axi_ltc2387_if.v +++ b/library/axi_ltc2387/axi_ltc2387_if.v @@ -1,6 +1,6 @@ // *************************************************************************** // *************************************************************************** -// Copyright (C) 2022-2024 Analog Devices, Inc. All rights reserved. +// Copyright (C) 2022-2025 Analog Devices, Inc. All rights reserved. // // In this HDL repository, there are many different and unique modules, consisting // of various HDL (Verilog or VHDL) components. The individual modules are @@ -44,7 +44,7 @@ module axi_ltc2387_if #( parameter IODELAY_CTRL = 1, parameter DELAY_REFCLK_FREQUENCY = 200, parameter TWOLANES = 1, // 0 for one-lane, 1 for two lanes - parameter RESOLUTION = 18 // 16 or 18 bits + parameter ADC_RES = 18 // 16 or 18 bits ) ( // delay interface @@ -68,12 +68,12 @@ module axi_ltc2387_if #( input db_p, input db_n, - output reg adc_valid, - output reg [RESOLUTION-1:0] adc_data + output reg adc_valid, + output reg [ADC_RES-1:0] adc_data ); - localparam ONE_L_WIDTH = (RESOLUTION == 18) ? 9 : 8; - localparam TWO_L_WIDTH = (RESOLUTION == 18) ? 5 : 4; + localparam ONE_L_WIDTH = (ADC_RES == 18) ? 9 : 8; + localparam TWO_L_WIDTH = (ADC_RES == 18) ? 5 : 4; localparam WIDTH = (TWOLANES == 0) ? ONE_L_WIDTH : TWO_L_WIDTH; // internal wires @@ -100,7 +100,7 @@ module axi_ltc2387_if #( adc_valid <= 1'b0; clk_gate_d <= {clk_gate_d[1:0], clk_gate}; if (clk_gate_d[1] == 1'b1 && clk_gate_d[0] == 1'b0) begin - if (RESOLUTION == 18) begin + if (ADC_RES == 18) begin adc_data <= adc_data_int; adc_valid <= 1'b1; end else begin @@ -113,8 +113,13 @@ module axi_ltc2387_if #( always @(posedge dco) begin adc_data_da_p <= {adc_data_da_p[WIDTH-1:0], da_p_int_s}; adc_data_da_n <= {adc_data_da_n[WIDTH-1:0], da_n_int_s}; - adc_data_db_p <= {adc_data_db_p[WIDTH-1:0], db_p_int_s}; - adc_data_db_n <= {adc_data_db_n[WIDTH-1:0], db_n_int_s}; + if (TWOLANES) begin + adc_data_db_p <= {adc_data_db_p[WIDTH-1:0], db_p_int_s}; + adc_data_db_n <= {adc_data_db_n[WIDTH-1:0], db_n_int_s}; + end else begin + adc_data_db_p <= 'd0; + adc_data_db_n <= 'd0; + end end // bits rearrangement @@ -139,7 +144,7 @@ module axi_ltc2387_if #( assign adc_data_int[1] = da_p_int_s; assign adc_data_int[0] = da_n_int_s; end else begin - if (RESOLUTION == 18) begin + if (ADC_RES == 18) begin assign adc_data_int[17] = adc_data_da_p[3]; assign adc_data_int[16] = adc_data_db_p[3]; assign adc_data_int[15] = adc_data_da_n[3]; @@ -200,25 +205,34 @@ module axi_ltc2387_if #( .delay_rst (delay_rst), .delay_locked (delay_locked)); - ad_data_in #( - .FPGA_TECHNOLOGY (FPGA_TECHNOLOGY), - .IDDR_CLK_EDGE ("OPPOSITE_EDGE"), - .IODELAY_CTRL (0), - .IODELAY_GROUP (IO_DELAY_GROUP), - .REFCLK_FREQUENCY (DELAY_REFCLK_FREQUENCY) - ) i_rx_db ( - .rx_clk (dco), - .rx_data_in_p (db_p), - .rx_data_in_n (db_n), - .rx_data_p (db_p_int_s), - .rx_data_n (db_n_int_s), - .up_clk (up_clk), - .up_dld (up_dld[1]), - .up_dwdata (up_dwdata[9:5]), - .up_drdata (up_drdata[9:5]), - .delay_clk (delay_clk), - .delay_rst (delay_rst), - .delay_locked ()); + // instantiate only if TWOLANES + if (TWOLANES) begin + ad_data_in #( + .FPGA_TECHNOLOGY (FPGA_TECHNOLOGY), + .IDDR_CLK_EDGE ("OPPOSITE_EDGE"), + .IODELAY_CTRL (0), + .IODELAY_GROUP (IO_DELAY_GROUP), + .REFCLK_FREQUENCY (DELAY_REFCLK_FREQUENCY) + ) i_rx_db ( + .rx_clk (dco), + .rx_data_in_p (db_p), + .rx_data_in_n (db_n), + .rx_data_p (db_p_int_s), + .rx_data_n (db_n_int_s), + .up_clk (up_clk), + .up_dld (up_dld[1]), + .up_dwdata (up_dwdata[9:5]), + .up_drdata (up_drdata[9:5]), + .delay_clk (delay_clk), + .delay_rst (delay_rst), + .delay_locked ()); + end else begin + // when in one-lane mode, tie them to 0, + // otherwise the input pin of input buffer + // will have an illegal connection to logic constant value + assign db_p_int_s = 1'b0; + assign db_n_int_s = 1'b0; + end // clock diff --git a/library/axi_ltc2387/axi_ltc2387_ip.tcl b/library/axi_ltc2387/axi_ltc2387_ip.tcl index fa8e031b0ec..6d184b42b3a 100644 --- a/library/axi_ltc2387/axi_ltc2387_ip.tcl +++ b/library/axi_ltc2387/axi_ltc2387_ip.tcl @@ -1,5 +1,5 @@ ############################################################################### -## Copyright (C) 2022-2024 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2022-2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### @@ -31,68 +31,72 @@ adi_ip_files axi_ltc2387 [list \ adi_ip_properties axi_ltc2387 -set cc [ipx::current_core] -set page0 [ipgui::get_pagespec -name "Page 0" -component $cc] +ipx::infer_bus_interface ref_clk xilinx.com:signal:clock_rtl:1.0 [ipx::current_core] +ipx::infer_bus_interface dco_p xilinx.com:signal:clock_rtl:1.0 [ipx::current_core] +ipx::infer_bus_interface dco_n xilinx.com:signal:clock_rtl:1.0 [ipx::current_core] -ipx::infer_bus_interface ref_clk xilinx.com:signal:clock_rtl:1.0 $cc -ipx::infer_bus_interface dco_p xilinx.com:signal:clock_rtl:1.0 $cc -ipx::infer_bus_interface dco_n xilinx.com:signal:clock_rtl:1.0 $cc +set cc [ipx::current_core] -ipgui::add_static_text -name {Warning} -component $cc -parent $page0 -text {In one-lane mode, only 18-bit resolution is supported! -Output data width (OUT_RES) depends on ADC_RES!} +set page0 [ipgui::get_pagespec -name "Page 0" -component $cc] ipx::add_user_parameter ADC_RES $cc set_property value_resolve_type user [ipx::get_user_parameters ADC_RES -of_objects $cc] ipgui::add_param -name "ADC_RES" -component $cc -parent $page0 set_property -dict [list \ - "display_name" "ADC_RES" \ - "layout" "horizontal" \ - "tooltip" "ADC resolution" \ + "display_name" "ADC resolution" \ + "tooltip" "ADC_RES" \ "widget" "radioGroup" \ + "layout" "horizontal" \ ] [ipgui::get_guiparamspec -name "ADC_RES" -component $cc] set_property -dict [list \ - "value" "18" \ "value_format" "long" \ "value_validation_type" "list" \ - "value_validation_list" "18 16" \ + "value_validation_list" "16 18" \ ] [ipx::get_user_parameters ADC_RES -of_objects $cc] -# OUT_RES depends on the value of ADC_RES, and is set in the project ipx::add_user_parameter OUT_RES $cc set_property value_resolve_type user [ipx::get_user_parameters OUT_RES -of_objects $cc] ipgui::add_param -name "OUT_RES" -component $cc -parent $page0 set_property -dict [list \ - "display_name" "OUT_RES" \ - "layout" "horizontal" \ - "tooltip" "Output data width" \ + "display_name" "Output data width" \ + "tooltip" "OUT_RES" \ "widget" "radioGroup" \ + "layout" "horizontal" \ ] [ipgui::get_guiparamspec -name "OUT_RES" -component $cc] set_property -dict [list \ - "value" "32" \ "value_format" "long" \ "value_validation_type" "list" \ - "value_validation_list" "32 16" \ + "value_validation_list" "16 32" \ ] [ipx::get_user_parameters OUT_RES -of_objects $cc] ipx::add_user_parameter TWOLANES $cc set_property value_resolve_type user [ipx::get_user_parameters TWOLANES -of_objects $cc] ipgui::add_param -name "TWOLANES" -component $cc -parent $page0 set_property -dict [list \ - "display_name" "TWOLANES" \ - "layout" "horizontal" \ - "tooltip" "Two-lane mode (1) or one-lane mode (0)" \ + "display_name" "Lane mode" \ + "tooltip" "TWOLANES" \ "widget" "radioGroup" \ + "layout" "horizontal" \ ] [ipgui::get_guiparamspec -name "TWOLANES" -component $cc] set_property -dict [list \ - "value" "1" \ "value_format" "long" \ "value_validation_type" "list" \ - "value_validation_list" "1 0" \ + "value_validation_list" "0 1" \ ] [ipx::get_user_parameters TWOLANES -of_objects $cc] +# if TWOLANES=0, disable and tie to GND, ports db_p, db_n +adi_set_ports_dependency "db_p" \ + "(spirit:decode(id('MODELPARAM_VALUE.TWOLANES')) == 1)" +adi_set_ports_dependency "db_n" \ + "(spirit:decode(id('MODELPARAM_VALUE.TWOLANES')) == 1)" + +set_property driver_value 0 [ipx::get_ports -filter "direction==in" -of_objects $cc] + +#adi_add_auto_fpga_spec_params + ipx::create_xgui_files $cc ipx::update_checksums $cc ipx::save_core $cc diff --git a/projects/cn0577/README.md b/projects/cn0577/README.md index 078457fd9e3..125b6fa4ca4 100644 --- a/projects/cn0577/README.md +++ b/projects/cn0577/README.md @@ -1,6 +1,10 @@ # CN0577 HDL Project -- Evaluation board product page: [EVAL-CN0577](https://www.analog.com/cn0577) +- Evaluation board product page: + - [EVAL-CN0577](https://www.analog.com/cn0577) + - [EVAL-ADAQ23878](https://analog.com/eval-adaq23878) + - [EVAL-ADAQ23876](https://analog.com/eval-adaq23876) + - [EVAL-ADAQ23875](https://analog.com/eval-adaq23875) - System documentation: https://wiki.analog.com/resources/eval/user-guides/circuits-from-the-lab/cn0577 - HDL project documentation: http://analogdevicesinc.github.io/hdl/projects/cn0577/index.html - Evaluation board VADJ: 2.5V @@ -9,8 +13,11 @@ | Part name | Description | |-----------------------------------------|-----------------------------------------------------------| -| [ADAQ23876](https://www.analog.com/ADAQ23876) | 16-Bit, 15 MSPS, μModule Data Acquisition Solution | | [LTC2387-18](https://www.analog.com/LTC2387-18) | 18-Bit, 15 MSPS, SAR ADC | +| [LTC2387-16](https://www.analog.com/LTC2387-16) | 16-Bit, 15 MSPS, SAR ADC | +| [ADAQ23878](https://www.analog.com/ADAQ23878) | 18-Bit, 15 MSPS, μModule Data Acquisition Solution | +| [ADAQ23876](https://www.analog.com/ADAQ23876) | 16-Bit, 15 MSPS, μModule Data Acquisition Solution | +| [ADAQ23875](https://www.analog.com/ADAQ23875) | 16-Bit, 15 MSPS, μModule Data Acquisition Solution | ## Building the project diff --git a/projects/cn0577/common/cn0577_bd.tcl b/projects/cn0577/common/cn0577_bd.tcl index 2a6f609b030..b1fe8d24c89 100644 --- a/projects/cn0577/common/cn0577_bd.tcl +++ b/projects/cn0577/common/cn0577_bd.tcl @@ -1,9 +1,20 @@ ############################################################################### -## Copyright (C) 2022-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2022-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### -# ltc2387 +# env params + +set TWOLANES $ad_project_params(TWOLANES); # two-lane mode (1) or one-lane mode (0); default two-lane +set ADC_RES $ad_project_params(ADC_RES); # ADC resolution; default 18 bits +set OUT_RES [expr {$ADC_RES == 16 ? 16 : 32}] +set CLK_GATE_WIDTH [expr {($TWOLANES == 0 && $ADC_RES == 18) ? 9 : \ + ($TWOLANES == 0 && $ADC_RES == 16) ? 8 : \ + ($TWOLANES == 1 && $ADC_RES == 18) ? 5 : \ + 4}] + +# ltc2387 i/o + create_bd_port -dir I ref_clk create_bd_port -dir O sampling_clk create_bd_port -dir I dco_p @@ -18,9 +29,9 @@ create_bd_port -dir O clk_gate # adc peripheral ad_ip_instance axi_ltc2387 axi_ltc2387 -ad_ip_parameter axi_ltc2387 CONFIG.ADC_RES 18 -ad_ip_parameter axi_ltc2387 CONFIG.OUT_RES 32 -ad_ip_parameter axi_ltc2387 CONFIG.TWOLANES $two_lanes +ad_ip_parameter axi_ltc2387 CONFIG.ADC_RES $ADC_RES +ad_ip_parameter axi_ltc2387 CONFIG.OUT_RES $OUT_RES +ad_ip_parameter axi_ltc2387 CONFIG.TWOLANES $TWOLANES ad_ip_parameter axi_ltc2387 CONFIG.ADC_INIT_DELAY 27 # axi pwm gen @@ -29,7 +40,7 @@ ad_ip_instance axi_pwm_gen axi_pwm_gen ad_ip_parameter axi_pwm_gen CONFIG.N_PWMS 2 ad_ip_parameter axi_pwm_gen CONFIG.PULSE_0_WIDTH 1 ad_ip_parameter axi_pwm_gen CONFIG.PULSE_0_PERIOD 8 -ad_ip_parameter axi_pwm_gen CONFIG.PULSE_1_WIDTH 5 +ad_ip_parameter axi_pwm_gen CONFIG.PULSE_1_WIDTH $CLK_GATE_WIDTH ad_ip_parameter axi_pwm_gen CONFIG.PULSE_1_PERIOD 8 ad_ip_parameter axi_pwm_gen CONFIG.PULSE_1_OFFSET 0 @@ -43,7 +54,7 @@ ad_ip_parameter axi_ltc2387_dma CONFIG.SYNC_TRANSFER_START 0 ad_ip_parameter axi_ltc2387_dma CONFIG.AXI_SLICE_SRC 0 ad_ip_parameter axi_ltc2387_dma CONFIG.AXI_SLICE_DEST 0 ad_ip_parameter axi_ltc2387_dma CONFIG.DMA_2D_TRANSFER 0 -ad_ip_parameter axi_ltc2387_dma CONFIG.DMA_DATA_WIDTH_SRC 32 +ad_ip_parameter axi_ltc2387_dma CONFIG.DMA_DATA_WIDTH_SRC $OUT_RES ad_ip_parameter axi_ltc2387_dma CONFIG.DMA_DATA_WIDTH_DEST 64 # connections @@ -58,8 +69,11 @@ ad_connect dco_p axi_ltc2387/dco_p ad_connect dco_n axi_ltc2387/dco_n ad_connect da_p axi_ltc2387/da_p ad_connect da_n axi_ltc2387/da_n -ad_connect db_p axi_ltc2387/db_p -ad_connect db_n axi_ltc2387/db_n + +if {$TWOLANES == "1"} { + ad_connect db_p axi_ltc2387/db_p + ad_connect db_n axi_ltc2387/db_n +} ad_connect ref_clk axi_ltc2387_dma/fifo_wr_clk ad_connect axi_ltc2387/adc_valid axi_ltc2387_dma/fifo_wr_en diff --git a/projects/cn0577/zed/README.md b/projects/cn0577/zed/README.md index cdfb6f7c970..04ab8cd9802 100644 --- a/projects/cn0577/zed/README.md +++ b/projects/cn0577/zed/README.md @@ -1,4 +1,4 @@ - + # CN0577/ZED HDL Project @@ -6,9 +6,54 @@ ## Building the project +The parameters configurable through the ``make`` command, can be found below, as well as in the **system_project.tcl** file; it contains the default configuration. + ``` cd projects/cn0577/zed make ``` +The overwritable parameters from the environment are: + +- TWOLANES: whether to use two lanes or one lane mode; + - 1 - two-lane mode used (default) + - 0 - one-lane mode used +- ADC_RES: the resolution of the ADC input data; + - 18 - the resolution is 18 bits (default) + - 16 - the resolution is 16 bits + +### Example configurations + +#### Two lanes, 18-bit resolution (default) + +This specific command is equivalent to running `make` only: + +``` +make TWOLANES=1 \ +ADC_RES=18 +``` + Corresponding device tree: [zynq-zed-adv7511-cn0577.dts](https://github.com/analogdevicesinc/linux/blob/main/arch/arm/boot/dts/xilinx/zynq-zed-adv7511-cn0577.dts) + +#### One lane, 18-bit resolution + +``` +make TWOLANES=0 \ +ADC_RES=18 +``` + +#### Two lanes, 16-bit resolution + +``` +make TWOLANES=1 \ +ADC_RES=16 +``` + +Corresponding device tree: [zynq-zed-adv7511-adaq23875.dts](https://github.com/analogdevicesinc/linux/blob/main/arch/arm/boot/dts/xilinx/zynq-zed-adv7511-adaq23875.dts) + +#### One lane, 16-bit resolution + +``` +make TWOLANES=0 \ +ADC_RES=16 +``` diff --git a/projects/cn0577/zed/system_bd.tcl b/projects/cn0577/zed/system_bd.tcl index f259d8efcb0..a5a019dc41f 100644 --- a/projects/cn0577/zed/system_bd.tcl +++ b/projects/cn0577/zed/system_bd.tcl @@ -1,11 +1,8 @@ ############################################################################### -## Copyright (C) 2022-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2022-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### -# specify number of channels - the design supports one lane/two lanes -set two_lanes 1 - source $ad_hdl_dir/projects/common/zed/zed_system_bd.tcl source $ad_hdl_dir/projects/scripts/adi_pd.tcl source ../common/cn0577_bd.tcl @@ -15,6 +12,7 @@ ad_ip_parameter axi_sysid_0 CONFIG.ROM_ADDR_BITS 9 ad_ip_parameter rom_sys_0 CONFIG.PATH_TO_FILE "$mem_init_sys_file_path/mem_init_sys.txt" ad_ip_parameter rom_sys_0 CONFIG.ROM_ADDR_BITS 9 -set sys_cstring "TWO_LANES=$two_lanes" +set sys_cstring "TWOLANES=$ad_project_params(TWOLANES) \ +ADC_RES=$ad_project_params(ADC_RES)" sysid_gen_sys_init_file $sys_cstring diff --git a/projects/cn0577/zed/system_project.tcl b/projects/cn0577/zed/system_project.tcl index d4273fb7e45..3c6fbee9469 100644 --- a/projects/cn0577/zed/system_project.tcl +++ b/projects/cn0577/zed/system_project.tcl @@ -1,14 +1,28 @@ ############################################################################### -## Copyright (C) 2022-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2022-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### -# load script +# load scripts source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl -adi_project cn0577_zed +# TWOLANES: parameter describing the number of lanes +# - 1: in two-lane mode (default) +# - 0: in one-lane mode +# +# ADC_RES: parameter describing the ADC input resolution +# - 18: 18 bits (default) +# - 16: 16 bits +# +# in one-lane mode (TWOLANES=0), only the 18-bit resolution is supported! (ADC_RES=16) + +adi_project cn0577_zed 0 [list \ + TWOLANES [get_env_param TWOLANES 1 ] \ + ADC_RES [get_env_param ADC_RES 18 ] \ +] + adi_project_files cn0577_zed [list \ "system_top.v" \ "system_constr.xdc" \