From 4d2fd5a6384fea7a6f1906290b18e9a3f96fe245 Mon Sep 17 00:00:00 2001 From: Pop Ioan Daniel Date: Thu, 28 Nov 2024 16:10:35 +0200 Subject: [PATCH 1/3] library: axi_ad7616: Add AXI ADC Signed-off-by: Pop Ioan Daniel --- library/axi_ad7616/Makefile | 17 +- library/axi_ad7616/axi_ad7616.v | 420 +++++++++++++++++++----- library/axi_ad7616/axi_ad7616_control.v | 159 --------- library/axi_ad7616/axi_ad7616_ip.tcl | 28 +- library/axi_ad7616/axi_ad7616_pif.v | 211 ++++++++---- 5 files changed, 536 insertions(+), 299 deletions(-) delete mode 100644 library/axi_ad7616/axi_ad7616_control.v diff --git a/library/axi_ad7616/Makefile b/library/axi_ad7616/Makefile index d49c6265c1..a6d38786ef 100644 --- a/library/axi_ad7616/Makefile +++ b/library/axi_ad7616/Makefile @@ -1,16 +1,29 @@ #################################################################################### -## Copyright (c) 2018 - 2023 Analog Devices, Inc. +## Copyright (c) 2018 - 2024 Analog Devices, Inc. ### SPDX short identifier: BSD-1-Clause ## Auto-generated, do not modify! #################################################################################### LIBRARY_NAME := axi_ad7616 +GENERIC_DEPS += ../common/ad_datafmt.v +GENERIC_DEPS += ../common/ad_edge_detect.v +GENERIC_DEPS += ../common/ad_rst.v +GENERIC_DEPS += ../common/up_adc_channel.v +GENERIC_DEPS += ../common/up_adc_common.v GENERIC_DEPS += ../common/up_axi.v +GENERIC_DEPS += ../common/up_clock_mon.v +GENERIC_DEPS += ../common/up_delay_cntrl.v +GENERIC_DEPS += ../common/up_xfer_cntrl.v +GENERIC_DEPS += ../common/up_xfer_status.v GENERIC_DEPS += axi_ad7616.v -GENERIC_DEPS += axi_ad7616_control.v GENERIC_DEPS += axi_ad7616_pif.v +XILINX_DEPS += ../xilinx/common/ad_dcfilter.v +XILINX_DEPS += ../xilinx/common/ad_rst_constr.xdc +XILINX_DEPS += ../xilinx/common/up_clock_mon_constr.xdc +XILINX_DEPS += ../xilinx/common/up_xfer_cntrl_constr.xdc +XILINX_DEPS += ../xilinx/common/up_xfer_status_constr.xdc XILINX_DEPS += axi_ad7616_ip.tcl include ../scripts/library.mk diff --git a/library/axi_ad7616/axi_ad7616.v b/library/axi_ad7616/axi_ad7616.v index f93ff54074..e6a63a3a3e 100644 --- a/library/axi_ad7616/axi_ad7616.v +++ b/library/axi_ad7616/axi_ad7616.v @@ -1,6 +1,6 @@ // *************************************************************************** // *************************************************************************** -// Copyright (C) 2015-2023 Analog Devices, Inc. All rights reserved. +// Copyright (C) 2023-2024 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 @@ -37,142 +37,406 @@ module axi_ad7616 #( - parameter ID = 0 + parameter ID = 0 ) ( // physical data interface - output rx_cs_n, - output [15:0] rx_db_o, - input [15:0] rx_db_i, - output rx_db_t, - output rx_rd_n, - output rx_wr_n, + output rx_cs_n, + output [15:0] rx_db_o, + input [15:0] rx_db_i, + output rx_db_t, + output rx_rd_n, + output rx_wr_n, // physical control interface - input rx_trigger, + input rx_trigger, // AXI Slave Memory Map - input s_axi_aclk, - input s_axi_aresetn, - input s_axi_awvalid, - input [15:0] s_axi_awaddr, - input [ 2:0] s_axi_awprot, - output s_axi_awready, - input s_axi_wvalid, - input [31:0] s_axi_wdata, - input [ 3:0] s_axi_wstrb, - output s_axi_wready, - output s_axi_bvalid, - output [ 1:0] s_axi_bresp, - input s_axi_bready, - input s_axi_arvalid, - input [15:0] s_axi_araddr, - input [ 2:0] s_axi_arprot, - output s_axi_arready, - output s_axi_rvalid, - output [ 1:0] s_axi_rresp, - output [31:0] s_axi_rdata, - input s_axi_rready, - - // Write FIFO interface - - output adc_valid, - output [15:0] adc_data, - output adc_sync + input s_axi_aclk, + input s_axi_aresetn, + input s_axi_awvalid, + input [15:0] s_axi_awaddr, + input [ 2:0] s_axi_awprot, + output s_axi_awready, + input s_axi_wvalid, + input [31:0] s_axi_wdata, + input [ 3:0] s_axi_wstrb, + output s_axi_wready, + output s_axi_bvalid, + output [ 1:0] s_axi_bresp, + input s_axi_bready, + input s_axi_arvalid, + input [15:0] s_axi_araddr, + input [ 2:0] s_axi_arprot, + output s_axi_arready, + output s_axi_rvalid, + output [ 1:0] s_axi_rresp, + output [31:0] s_axi_rdata, + input s_axi_rready, + + output adc_valid, + output adc_clk, + input adc_dovf, + + output [15:0] adc_data_0, + output [15:0] adc_data_1, + output [15:0] adc_data_2, + output [15:0] adc_data_3, + output [15:0] adc_data_4, + output [15:0] adc_data_5, + output [15:0] adc_data_6, + output [15:0] adc_data_7, + output [15:0] adc_data_8, + output [15:0] adc_data_9, + output [15:0] adc_data_10, + output [15:0] adc_data_11, + output [15:0] adc_data_12, + output [15:0] adc_data_13, + output [15:0] adc_data_14, + output [15:0] adc_data_15, + + output adc_enable_0, + output adc_enable_1, + output adc_enable_2, + output adc_enable_3, + output adc_enable_4, + output adc_enable_5, + output adc_enable_6, + output adc_enable_7, + output adc_enable_8, + output adc_enable_9, + output adc_enable_10, + output adc_enable_11, + output adc_enable_12, + output adc_enable_13, + output adc_enable_14, + output adc_enable_15, + output adc_reset ); + localparam [31:0] RD_RAW_CAP = 32'h2000; + // internal registers - reg up_wack = 1'b0; - reg up_rack = 1'b0; - reg [31:0] up_rdata = 32'b0; + reg up_wack = 1'b0; + reg up_rack = 1'b0; + reg [31:0] up_rdata = 32'b0; + reg [31:0] up_rdata_r; + reg up_rack_r; + reg up_wack_r; // internal signals - wire up_clk; - wire up_rstn; - wire up_rst; - wire up_rreq_s; - wire [13:0] up_raddr_s; - wire up_wreq_s; - wire [13:0] up_waddr_s; - wire [31:0] up_wdata_s; + wire [15:0] adc_data_0_s; + wire [15:0] adc_data_1_s; + wire [15:0] adc_data_2_s; + wire [15:0] adc_data_3_s; + wire [15:0] adc_data_4_s; + wire [15:0] adc_data_5_s; + wire [15:0] adc_data_6_s; + wire [15:0] adc_data_7_s; + wire [15:0] adc_data_8_s; + wire [15:0] adc_data_9_s; + wire [15:0] adc_data_10_s; + wire [15:0] adc_data_11_s; + wire [15:0] adc_data_12_s; + wire [15:0] adc_data_13_s; + wire [15:0] adc_data_14_s; + wire [15:0] adc_data_15_s; + + wire [255:0] adc_data_s; + wire [ 7:0] adc_custom_control; + + wire adc_dfmt_enable_s[0:15]; + wire adc_dfmt_type_s[0:15]; + wire adc_dfmt_se_s[0:15]; + + wire [15:0] adc_enable; + wire adc_reset_s; - wire up_wack_cntrl_s; - wire up_rack_cntrl_s; - wire [31:0] up_rdata_cntrl_s; + wire [255:0] dma_data; + wire dma_dvalid; - wire trigger_s; + wire up_clk; + wire up_rstn; + wire up_rst; + wire up_rreq_s; + wire [13:0] up_raddr_s; + wire up_wreq_s; + wire [13:0] up_waddr_s; + wire [31:0] up_wdata_s; + wire [31:0] up_rdata_s[0:16]; + wire [16:0] up_rack_s; + wire [16:0] up_wack_s; - wire rd_req_s; - wire wr_req_s; - wire [15:0] wr_data_s; - wire [15:0] rd_data_s; - wire rd_valid_s; - wire [ 4:0] burst_length_s; + wire up_wack_cntrl_s; + wire up_rack_cntrl_s; + wire [31:0] up_rdata_cntrl_s; + + wire trigger_s; + + wire rd_req_s; + wire wr_req_s; + wire [31:0] wr_data_s; + wire [15:0] rd_data_s; + wire rd_valid_s; + wire [ 4:0] burst_length_s; + + wire [31:0] adc_config_ctrl_s; + wire adc_ctrl_status_s; + wire m_axis_ready_s; + wire m_axis_valid_s; + wire [15:0] m_axis_data_s; + wire m_axis_xfer_req_s; + + wire [31:0] adc_config_ctrl; // defaults + assign adc_clk = s_axi_aclk; assign up_clk = s_axi_aclk; assign up_rstn = s_axi_aresetn; assign up_rst = ~s_axi_aresetn; + assign adc_reset = adc_reset_s; + + assign adc_enable_0 = adc_enable[0]; + assign adc_enable_1 = adc_enable[1]; + assign adc_enable_2 = adc_enable[2]; + assign adc_enable_3 = adc_enable[3]; + assign adc_enable_4 = adc_enable[4]; + assign adc_enable_5 = adc_enable[5]; + assign adc_enable_6 = adc_enable[6]; + assign adc_enable_7 = adc_enable[7]; + assign adc_enable_8 = adc_enable[8]; + assign adc_enable_9 = adc_enable[9]; + assign adc_enable_10 = adc_enable[10]; + assign adc_enable_11 = adc_enable[11]; + assign adc_enable_12 = adc_enable[12]; + assign adc_enable_13 = adc_enable[13]; + assign adc_enable_14 = adc_enable[14]; + assign adc_enable_15 = adc_enable[15]; // processor read interface + integer j; + + always @(*) begin + up_rdata_r = 'h00; + up_rack_r = 'h00; + up_wack_r = 'h00; + for (j = 0; j <= 16; j = j + 1) begin + up_rack_r = up_rack_r | up_rack_s[j]; + up_wack_r = up_wack_r | up_wack_s[j]; + up_rdata_r = up_rdata_r | up_rdata_s[j]; + end + end + always @(negedge up_rstn or posedge up_clk) begin if (up_rstn == 0) begin - up_wack <= 'd0; - up_rack <= 'd0; up_rdata <= 'd0; + up_rack <= 'd0; + up_wack <= 'd0; end else begin - up_wack <= up_wack_cntrl_s; - up_rack <= up_rack_cntrl_s; - up_rdata <= up_rdata_cntrl_s; + up_rdata <= up_rdata_r; + up_rack <= up_rack_r; + up_wack <= up_wack_r; end end - axi_ad7616_pif i_ad7616_parallel_interface ( + generate + genvar i; + for (i = 0; i < 16; i = i + 1) begin + up_adc_channel #( + .CHANNEL_ID(i) + ) i_up_adc_channel ( + .adc_clk (up_clk), + .adc_rst (adc_reset_s), + .adc_enable (adc_enable[i]), + .adc_iqcor_enb (), + .adc_dcfilt_enb (), + .adc_dfmt_se (adc_dfmt_se_s[i]), + .adc_dfmt_type (adc_dfmt_type_s[i]), + .adc_dfmt_enable (adc_dfmt_enable_s[i]), + .adc_dcfilt_offset (), + .adc_dcfilt_coeff (), + .adc_iqcor_coeff_1 (), + .adc_iqcor_coeff_2 (), + .adc_pnseq_sel (), + .adc_data_sel (), + .adc_pn_err (1'b0), + .adc_pn_oos (1'b0), + .adc_or (1'b0), + .adc_read_data ({16'd0,rd_data_s}), + .adc_status_header(), + .adc_crc_err(), + .up_adc_pn_err (), + .up_adc_pn_oos (), + .up_adc_or (), + .up_usr_datatype_be (), + .up_usr_datatype_signed (), + .up_usr_datatype_shift (), + .up_usr_datatype_total_bits (), + .up_usr_datatype_bits (), + .up_usr_decimation_m (), + .up_usr_decimation_n (), + .adc_usr_datatype_be (1'b0), + .adc_usr_datatype_signed (1'b1), + .adc_usr_datatype_shift (8'd0), + .adc_usr_datatype_total_bits (8'd16), + .adc_usr_datatype_bits (8'd16), + .adc_usr_decimation_m (16'd1), + .adc_usr_decimation_n (16'd1), + .up_rstn (up_rstn), + .up_clk (up_clk), + .up_wreq (up_wreq_s), + .up_waddr (up_waddr_s), + .up_wdata (up_wdata_s), + .up_wack (up_wack_s[i]), + .up_rreq (up_rreq_s), + .up_raddr (up_raddr_s), + .up_rdata (up_rdata_s[i]), + .up_rack (up_rack_s[i])); + end + endgenerate + + genvar k; + generate + for (k = 0;k < 16;k = k + 1) begin + ad_datafmt #( + .DATA_WIDTH (16), + .BITS_PER_SAMPLE (16) + ) i_datafmt ( + .clk (up_clk), + .valid (1'b1), + .data (adc_data_s[k*16+15:k*16]), + .valid_out (dma_dvalid), + .data_out (dma_data[k*16+15:k*16]), + .dfmt_enable (adc_dfmt_enable_s[k]), + .dfmt_type (adc_dfmt_type_s[k]), + .dfmt_se (adc_dfmt_se_s[k])); + end + endgenerate + + axi_ad7616_pif #( + .UP_ADDRESS_WIDTH(14) + ) i_ad7616_parallel_interface ( .cs_n (rx_cs_n), .db_o (rx_db_o), .db_i (rx_db_i), .db_t (rx_db_t), .rd_n (rx_rd_n), .wr_n (rx_wr_n), - .adc_data (adc_data), + .adc_data_0 (adc_data_0_s), + .adc_data_1 (adc_data_1_s), + .adc_data_2 (adc_data_2_s), + .adc_data_3 (adc_data_3_s), + .adc_data_4 (adc_data_4_s), + .adc_data_5 (adc_data_5_s), + .adc_data_6 (adc_data_6_s), + .adc_data_7 (adc_data_7_s), + .adc_data_8 (adc_data_8_s), + .adc_data_9 (adc_data_9_s), + .adc_data_10 (adc_data_10_s), + .adc_data_11 (adc_data_11_s), + .adc_data_12 (adc_data_12_s), + .adc_data_13 (adc_data_13_s), + .adc_data_14 (adc_data_14_s), + .adc_data_15 (adc_data_15_s), .adc_valid (adc_valid), - .adc_sync (adc_sync), .end_of_conv (rx_trigger), .burst_length(burst_length_s), .clk (up_clk), .rstn (up_rstn), .rd_req (rd_req_s), .wr_req (wr_req_s), - .wr_data (wr_data_s), + .wr_data (wr_data_s[15:0]), .rd_data (rd_data_s), .rd_valid (rd_valid_s)); - axi_ad7616_control #( - .ID(ID) - ) i_ad7616_control ( - .up_burst_length (burst_length_s), - .up_read_data (rd_data_s), - .up_read_valid (rd_valid_s), - .up_write_data (wr_data_s), - .up_read_req (rd_req_s), - .up_write_req (wr_req_s), + assign adc_data_s = {adc_data_0_s,adc_data_1_s,adc_data_2_s,adc_data_3_s,adc_data_4_s,adc_data_5_s,adc_data_6_s,adc_data_7_s,adc_data_8_s,adc_data_9_s, + adc_data_10_s,adc_data_11_s,adc_data_12_s,adc_data_13_s,adc_data_14_s,adc_data_15_s}; + + assign adc_data_15 = dma_data[0*16+15:0*16]; + assign adc_data_14 = dma_data[1*16+15:1*16]; + assign adc_data_13 = dma_data[2*16+15:2*16]; + assign adc_data_12 = dma_data[3*16+15:3*16]; + assign adc_data_11 = dma_data[4*16+15:4*16]; + assign adc_data_10 = dma_data[5*16+15:5*16]; + assign adc_data_9 = dma_data[6*16+15:6*16]; + assign adc_data_8 = dma_data[7*16+15:7*16]; + assign adc_data_7 = dma_data[8*16+15:8*16]; + assign adc_data_6 = dma_data[9*16+15:9*16]; + assign adc_data_5 = dma_data[10*16+15:10*16]; + assign adc_data_4 = dma_data[11*16+15:11*16]; + assign adc_data_3 = dma_data[12*16+15:12*16]; + assign adc_data_2 = dma_data[13*16+15:13*16]; + assign adc_data_1 = dma_data[14*16+15:14*16]; + assign adc_data_0 = dma_data[15*16+15:15*16]; + + assign wr_req_s = adc_config_ctrl[0]; + assign rd_req_s = adc_config_ctrl[1]; + assign burst_length_s = adc_custom_control[4:0]; + + up_adc_common #( + .ID (ID), + .CONFIG (RD_RAW_CAP) + ) i_up_adc_common ( + .mmcm_rst (), + .adc_clk (up_clk), + .adc_rst (adc_reset_s), + .adc_r1_mode (), + .adc_ddr_edgesel (), + .adc_pin_mode (), + .adc_status (), + .adc_sync_status (1'b1), + .adc_status_ovf (adc_dovf), + .adc_clk_ratio (), + .adc_start_code (), + .adc_sref_sync (), + .adc_sync (), + .adc_ext_sync_arm (), + .adc_ext_sync_disarm (), + .adc_ext_sync_manual_req (), + .adc_num_lanes (), + .adc_custom_control (adc_custom_control), + .adc_crc_enable (), + .adc_sdr_ddr_n (), + .adc_symb_op (), + .adc_symb_8_16b (), + .up_pps_rcounter (), + .up_pps_status (), + .up_pps_irq_mask (), + .up_adc_r1_mode (), + .up_status_pn_err (), + .up_status_pn_oos (), + .up_status_or (), + .up_drp_sel (), + .up_drp_wr (), + .up_drp_addr (), + .up_drp_wdata (), + .up_drp_rdata (), + .up_drp_ready (), + .up_drp_locked (1'b1), + .adc_config_wr (wr_data_s), + .adc_config_ctrl (adc_config_ctrl), + .adc_config_rd ({16'd0, rd_data_s}), + .adc_ctrl_status (1'b1), + .up_adc_gpio_in (), + .up_adc_gpio_out (), + .up_adc_ce (), .up_rstn (up_rstn), .up_clk (up_clk), .up_wreq (up_wreq_s), .up_waddr (up_waddr_s), .up_wdata (up_wdata_s), - .up_wack (up_wack_cntrl_s), + .up_wack (up_wack_s[16]), .up_rreq (up_rreq_s), .up_raddr (up_raddr_s), - .up_rdata (up_rdata_cntrl_s), - .up_rack (up_rack_cntrl_s)); + .up_rdata (up_rdata_s[16]), + .up_rack (up_rack_s[16])); // up bus interface diff --git a/library/axi_ad7616/axi_ad7616_control.v b/library/axi_ad7616/axi_ad7616_control.v deleted file mode 100644 index 3283922a10..0000000000 --- a/library/axi_ad7616/axi_ad7616_control.v +++ /dev/null @@ -1,159 +0,0 @@ -// *************************************************************************** -// *************************************************************************** -// Copyright (C) 2015-2023 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 -// developed independently, and may be accompanied by separate and unique license -// terms. -// -// The user should read each of these license terms, and understand the -// freedoms and responsibilities that he or she has by using this source/core. -// -// This core is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -// A PARTICULAR PURPOSE. -// -// Redistribution and use of source or resulting binaries, with or without modification -// of this file, are permitted under one of the following two license terms: -// -// 1. The GNU General Public License version 2 as published by the -// Free Software Foundation, which can be found in the top level directory -// of this repository (LICENSE_GPL2), and also online at: -// -// -// OR -// -// 2. An ADI specific BSD license, which can be found in the top level directory -// of this repository (LICENSE_ADIBSD), and also on-line at: -// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD -// This will allow to generate bit files and not release the source code, -// as long as it attaches to an ADI device. -// -// *************************************************************************** -// *************************************************************************** - -`timescale 1ns/100ps - -module axi_ad7616_control #( - - parameter ID = 0 -) ( - - // control signals - - input [15:0] up_read_data, - input up_read_valid, - output reg [15:0] up_write_data, - output up_read_req, - output up_write_req, - - output reg [ 4:0] up_burst_length, - - // bus interface - - input up_rstn, - input up_clk, - input up_wreq, - input [13:0] up_waddr, - input [31:0] up_wdata, - output reg up_wack, - input up_rreq, - input [13:0] up_raddr, - output reg [31:0] up_rdata, - output reg up_rack -); - - localparam PCORE_VERSION = 'h00001002; - localparam POS_EDGE = 0; - localparam NEG_EDGE = 1; - - // internal signals - - reg [31:0] up_scratch = 32'b0; - reg up_resetn = 1'b0; - reg up_cnvst_en = 1'b0; - reg [31:0] up_conv_rate = 32'b0; - - reg [31:0] cnvst_counter = 32'b0; - reg [ 3:0] pulse_counter = 8'b0; - reg cnvst_buf = 1'b0; - reg cnvst_pulse = 1'b0; - reg [ 2:0] chsel_ff = 3'b0; - - wire up_rst; - wire up_rack_s; - - wire [31:0] up_read_data_s; - wire up_read_valid_s; - - // the up_[read/write]_data interfaces are valid just in parallel mode - - assign up_read_valid_s = up_read_valid; - assign up_read_data_s = {16'h0, up_read_data}; - - // processor write interface - - always @(negedge up_rstn or posedge up_clk) begin - if (up_rstn == 0) begin - up_wack <= 1'h0; - up_scratch <= 32'b0; - up_resetn <= 1'b0; - up_cnvst_en <= 1'b0; - up_conv_rate <= 32'b0; - up_burst_length <= 5'h0; - up_write_data <= 16'h0; - end else begin - up_wack <= up_wreq; - if ((up_wreq == 1'b1) && (up_waddr[8:0] == 9'h102)) begin - up_scratch <= up_wdata; - end - if ((up_wreq == 1'b1) && (up_waddr[8:0] == 9'h110)) begin - up_resetn <= up_wdata[0]; - up_cnvst_en <= up_wdata[1]; - end - if ((up_wreq == 1'b1) && (up_waddr[8:0] == 9'h111)) begin - up_conv_rate <= up_wdata; - end - if ((up_wreq == 1'b1) && (up_waddr[8:0] == 9'h112)) begin - up_burst_length <= up_wdata; - end - if ((up_wreq == 1'b1) && (up_waddr[8:0] == 9'h114)) begin - up_write_data <= up_wdata; - end - end - end - - assign up_write_req = (up_waddr[8:0] == 9'h114) ? up_wreq : 1'h0; - - // processor read interface - - assign up_rack_s = (up_raddr[8:0] == 9'h113) ? up_read_valid_s : up_rreq; - assign up_read_req = (up_raddr[8:0] == 9'h113) ? up_rreq : 1'b0; - - always @(negedge up_rstn or posedge up_clk) begin - if (up_rstn == 0) begin - up_rack <= 1'b0; - up_rdata <= 32'b0; - end else begin - up_rack <= up_rack_s; - if (up_rack_s == 1'b1) begin - case (up_raddr[8:0]) - 9'h100 : up_rdata <= PCORE_VERSION; - 9'h101 : up_rdata <= ID; - 9'h102 : up_rdata <= up_scratch; - 9'h110 : up_rdata <= {29'b0, up_cnvst_en, up_resetn}; - 9'h111 : up_rdata <= up_conv_rate; - 9'h112 : up_rdata <= {27'b0, up_burst_length}; - 9'h113 : up_rdata <= up_read_data_s; - default : up_rdata <= 'h0; - endcase - end - end - end - - // instantiations - - assign up_rst = ~up_rstn; - -endmodule diff --git a/library/axi_ad7616/axi_ad7616_ip.tcl b/library/axi_ad7616/axi_ad7616_ip.tcl index ca1c98e2a2..c3c4257a97 100644 --- a/library/axi_ad7616/axi_ad7616_ip.tcl +++ b/library/axi_ad7616/axi_ad7616_ip.tcl @@ -1,5 +1,5 @@ ############################################################################### -## Copyright (C) 2015-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2015-2024 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### @@ -10,16 +10,36 @@ source $ad_hdl_dir/library/scripts/adi_ip_xilinx.tcl global VIVADO_IP_LIBRARY adi_ip_create axi_ad7616 + adi_ip_files axi_ad7616 [list \ + "$ad_hdl_dir/library/common/ad_edge_detect.v" \ + "$ad_hdl_dir/library/common/ad_rst.v" \ "$ad_hdl_dir/library/common/up_axi.v" \ - "axi_ad7616_control.v" \ + "$ad_hdl_dir/library/xilinx/common/ad_dcfilter.v" \ + "$ad_hdl_dir/library/common/ad_datafmt.v" \ + "$ad_hdl_dir/library/common/up_xfer_cntrl.v" \ + "$ad_hdl_dir/library/common/up_xfer_status.v" \ + "$ad_hdl_dir/library/common/up_clock_mon.v" \ + "$ad_hdl_dir/library/common/up_delay_cntrl.v" \ + "$ad_hdl_dir/library/common/up_adc_channel.v" \ + "$ad_hdl_dir/library/common/up_adc_common.v" \ + "$ad_hdl_dir/library/xilinx/common/up_xfer_cntrl_constr.xdc" \ + "$ad_hdl_dir/library/xilinx/common/ad_rst_constr.xdc" \ + "$ad_hdl_dir/library/xilinx/common/up_xfer_status_constr.xdc" \ + "$ad_hdl_dir/library/xilinx/common/up_clock_mon_constr.xdc" \ "axi_ad7616_pif.v" \ "axi_ad7616.v" ] adi_ip_properties axi_ad7616 -set_property company_url {https://wiki.analog.com/resources/fpga/docs/axi_ad7616} [ipx::current_core] +set_property company_url {https://analogdevicesinc.github.io/hdl/library/axi_ad7616/index.html} [ipx::current_core] + +set cc [ipx::current_core] set_property DRIVER_VALUE "0" [ipx::get_ports rx_db_i] -ipx::save_core [ipx::current_core] +set_property display_name "AXI AD7616" $cc +set_property description "AXI AD7616 HDL interface" $cc + +ipx::create_xgui_files $cc +ipx::save_core $cc diff --git a/library/axi_ad7616/axi_ad7616_pif.v b/library/axi_ad7616/axi_ad7616_pif.v index 4ad8a4a4a1..863337345b 100644 --- a/library/axi_ad7616/axi_ad7616_pif.v +++ b/library/axi_ad7616/axi_ad7616_pif.v @@ -1,6 +1,6 @@ // *************************************************************************** // *************************************************************************** -// Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved. +// Copyright (C) 2014-2024 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 @@ -42,64 +42,89 @@ module axi_ad7616_pif #( // physical interface - output cs_n, - output [15:0] db_o, - input [15:0] db_i, - output db_t, - output rd_n, - output wr_n, + output cs_n, + output [15:0] db_o, + input [15:0] db_i, + output db_t, + output rd_n, + output wr_n, // FIFO interface - output [15:0] adc_data, - output adc_valid, - output reg adc_sync, + output reg [15:0] adc_data_0 = 16'b0, + output reg [15:0] adc_data_1 = 16'b0, + output reg [15:0] adc_data_2 = 16'b0, + output reg [15:0] adc_data_3 = 16'b0, + output reg [15:0] adc_data_4 = 16'b0, + output reg [15:0] adc_data_5 = 16'b0, + output reg [15:0] adc_data_6 = 16'b0, + output reg [15:0] adc_data_7 = 16'b0, + output reg [15:0] adc_data_8 = 16'b0, + output reg [15:0] adc_data_9 = 16'b0, + output reg [15:0] adc_data_10 = 16'b0, + output reg [15:0] adc_data_11 = 16'b0, + output reg [15:0] adc_data_12 = 16'b0, + output reg [15:0] adc_data_13 = 16'b0, + output reg [15:0] adc_data_14 = 16'b0, + output reg [15:0] adc_data_15 = 16'b0, + + output adc_valid, // end of convertion - input end_of_conv, - input [ 4:0] burst_length, + input end_of_conv, + input [ 4:0] burst_length, // register access - input clk, - input rstn, - input rd_req, - input wr_req, - input [15:0] wr_data, - output reg [15:0] rd_data, - output reg rd_valid + input clk, + input rstn, + input rd_req, + input wr_req, + input [15:0] wr_data, + output reg [15:0] rd_data, + output reg rd_valid ); // state registers - localparam [ 2:0] IDLE = 3'h0, - CS_LOW = 3'h1, - CNTRL0_LOW = 3'h2, - CNTRL0_HIGH = 3'h3, - CNTRL1_LOW = 3'h4, - CNTRL1_HIGH = 3'h5, - CS_HIGH = 3'h6; + localparam [ 2:0] IDLE = 3'h0, + CS_LOW = 3'h1, + CNTRL0_LOW = 3'h2, + CNTRL0_HIGH = 3'h3, + CNTRL1_LOW = 3'h4, + CNTRL1_HIGH = 3'h5, + CS_HIGH = 3'h6; // internal registers - reg [ 2:0] transfer_state = 3'h0; - reg [ 2:0] transfer_state_next = 3'h0; - reg [ 1:0] width_counter = 2'h0; - reg [ 4:0] burst_counter = 5'h0; + reg [ 2:0] transfer_state = 3'h0; + reg [ 2:0] transfer_state_next = 3'h0; + reg [ 1:0] width_counter = 2'h0; + reg [ 4:0] burst_counter = 5'h0; - reg wr_req_d = 1'h0; - reg rd_req_d = 1'h0; - reg rd_conv_d = 1'h0; + reg wr_req_d = 1'h0; + reg rd_req_d = 1'h0; + reg rd_conv_d = 1'h0; - reg xfer_req_d = 1'h0; + reg xfer_req_d = 1'h0; - reg rd_valid_d = 1'h0; + reg rd_valid_d = 1'h0; + + reg [ 4:0] channel_counter = 5'h0; + reg [ 4:0] nr_rd_burst = 5'd16; + reg wr_req_edge = 1'h0; + reg wr_req_edge_d = 1'h0; + reg rd_req_edge = 1'h0; + reg rd_req_edge_d = 1'h0; + reg adc_valid_s = 1'h0; // internal wires - wire start_transfer_s; - wire rd_valid_s; + wire rd_new_data_s; + wire start_transfer_s; + wire rd_valid_s; + wire adc_valid_d; // FSM state register @@ -138,14 +163,90 @@ module axi_ad7616_pif #( end end - always @(negedge clk) begin - if (transfer_state == IDLE) begin + always @(posedge clk) begin wr_req_d <= wr_req; + wr_req_edge <= (wr_req && !wr_req_d); rd_req_d <= rd_req; + rd_req_edge <= (rd_req && !rd_req_d); + if (transfer_state == IDLE) begin rd_conv_d <= end_of_conv; end end + //delay with 1 clk + + always @(posedge clk) begin + wr_req_edge_d <= wr_req_edge; + rd_req_edge_d <= rd_req_edge; + end + + always @(posedge clk) begin + if (rstn == 1'b0) begin + channel_counter <= 5'h0; + end else begin + if (rd_new_data_s == 1'b1 && rd_conv_d == 1'b1) begin + channel_counter <= channel_counter + 1; + end else if (channel_counter == nr_rd_burst) begin + channel_counter <= 5'h0; + end + end + end + + always @(posedge clk) begin + if (rd_conv_d == 1'b1 && rd_new_data_s == 1'b1) begin + case (channel_counter) + 5'd0 : begin + adc_data_0 <= rd_data; + end + 5'd1 : begin + adc_data_1 <= rd_data; + end + 5'd2 : begin + adc_data_2 <= rd_data; + end + 5'd3 : begin + adc_data_3 <= rd_data; + end + 5'd4 : begin + adc_data_4 <= rd_data; + end + 5'd5 : begin + adc_data_5 <= rd_data; + end + 5'd6 : begin + adc_data_6 <= rd_data; + end + 5'd7 : begin + adc_data_7 <= rd_data; + end + 5'd8 : begin + adc_data_8 <= rd_data; + end + 5'd9 : begin + adc_data_9 <= rd_data; + end + 5'd10 : begin + adc_data_10 <= rd_data; + end + 5'd11 : begin + adc_data_11 <= rd_data; + end + 5'd12 : begin + adc_data_12 <= rd_data; + end + 5'd13 : begin + adc_data_13 <= rd_data; + end + 5'd14 : begin + adc_data_14 <= rd_data; + end + 5'd15 : begin + adc_data_15 <= rd_data; + end + endcase + end + end + // FSM next state logic always @(*) begin @@ -161,7 +262,7 @@ module axi_ad7616_pif #( end CNTRL0_HIGH : begin transfer_state_next <= (width_counter != 2'b11) ? CNTRL0_HIGH : - ((wr_req_d == 1'b1) || (rd_req_d == 1'b1)) ? CS_HIGH : CNTRL1_LOW; + ((wr_req_edge_d == 1'b1) || (rd_req_edge_d == 1'b1)) ? CS_HIGH : CNTRL1_LOW; end CNTRL1_LOW : begin transfer_state_next <= (width_counter != 2'b11) ? CNTRL1_LOW : CNTRL1_HIGH; @@ -170,7 +271,7 @@ module axi_ad7616_pif #( transfer_state_next <= (width_counter != 2'b11) ? CNTRL1_HIGH : CS_HIGH; end CS_HIGH : begin - transfer_state_next <= (burst_length == burst_counter) ? IDLE : CNTRL0_LOW; + transfer_state_next <= (burst_length == burst_counter || channel_counter == nr_rd_burst) ? IDLE : CNTRL0_LOW; end default : begin transfer_state_next <= IDLE; @@ -181,35 +282,33 @@ module axi_ad7616_pif #( // data valid for the register access and m_axis interface assign rd_valid_s = (((transfer_state == CNTRL0_HIGH) || (transfer_state == CNTRL1_HIGH)) && - ((rd_req_d == 1'b1) || (rd_conv_d == 1'b1))) ? 1'b1 : 1'b0; + ((rd_req_edge_d == 1'b1) || (rd_conv_d == 1'b1))) ? 1'b1 : 1'b0; // FSM output logic assign db_o = wr_data; + assign rd_new_data_s = rd_valid_s & ~rd_valid_d; + always @(posedge clk) begin rd_data <= (rd_valid_s & ~rd_valid_d) ? db_i : rd_data; rd_valid_d <= rd_valid_s; rd_valid <= rd_valid_s & ~rd_valid_d; end - assign adc_valid = rd_valid; - assign adc_data = rd_data; + assign adc_valid_d = (channel_counter == 5'd16) ? rd_valid : 1'b0; - assign cs_n = (transfer_state == IDLE) ? 1'b1 : 1'b0; - assign db_t = ~wr_req_d; - assign rd_n = (((transfer_state == CNTRL0_LOW) && ((rd_conv_d == 1'b1) || rd_req_d == 1'b1)) || - (transfer_state == CNTRL1_LOW)) ? 1'b0 : 1'b1; - assign wr_n = ((transfer_state == CNTRL0_LOW) && (wr_req_d == 1'b1)) ? 1'b0 : 1'b1; - - // sync will be asserted at the first valid data right after the convertion start + //delay with 1 clk always @(posedge clk) begin - if (end_of_conv == 1'b1) begin - adc_sync <= 1'b1; - end else if (rd_valid == 1'b1) begin - adc_sync <= 1'b0; - end + adc_valid_s <= adc_valid_d; end + assign adc_valid = adc_valid_s; + assign cs_n = (transfer_state == IDLE) ? 1'b1 : 1'b0; + assign db_t = ~wr_req_edge_d; + assign rd_n = (((transfer_state == CNTRL0_LOW) && ((rd_conv_d == 1'b1) || rd_req_edge_d == 1'b1)) || + (transfer_state == CNTRL1_LOW)) ? 1'b0 : 1'b1; + assign wr_n = ((transfer_state == CNTRL0_LOW) && (wr_req_edge_d == 1'b1)) ? 1'b0 : 1'b1; + endmodule From 5a9f08f822305df3728e0ea0cfe9bbe5049cb224 Mon Sep 17 00:00:00 2001 From: Pop Ioan Daniel Date: Thu, 28 Nov 2024 16:18:21 +0200 Subject: [PATCH 2/3] projects: ad7616: Project development Signed-off-by: Pop Ioan Daniel --- projects/ad7616_sdz/Makefile | 2 +- projects/ad7616_sdz/common/ad7616_bd.tcl | 82 ++++++++----------- .../ad7616_sdz/common/ad7616_serial_fmc.txt | 2 +- projects/ad7616_sdz/zed/Makefile | 3 +- projects/ad7616_sdz/zed/system_bd.tcl | 2 +- projects/ad7616_sdz/zed/system_project.tcl | 18 ++-- projects/ad7616_sdz/zed/system_top_pi.v | 4 +- 7 files changed, 49 insertions(+), 64 deletions(-) diff --git a/projects/ad7616_sdz/Makefile b/projects/ad7616_sdz/Makefile index 1402069e10..6667c4f442 100644 --- a/projects/ad7616_sdz/Makefile +++ b/projects/ad7616_sdz/Makefile @@ -1,5 +1,5 @@ #################################################################################### -## Copyright (c) 2018 - 2023 Analog Devices, Inc. +## Copyright (c) 2018 - 2024 Analog Devices, Inc. ### SPDX short identifier: BSD-1-Clause ## Auto-generated, do not modify! #################################################################################### diff --git a/projects/ad7616_sdz/common/ad7616_bd.tcl b/projects/ad7616_sdz/common/ad7616_bd.tcl index d3db7cf5a3..5902ae64a0 100644 --- a/projects/ad7616_sdz/common/ad7616_bd.tcl +++ b/projects/ad7616_sdz/common/ad7616_bd.tcl @@ -4,31 +4,10 @@ ############################################################################### ##-------------------------------------------------------------- -# IMPORTANT: Set AD7616 operation and interface mode -# -# The get_env_param procedure retrieves parameter value from the environment if exists, -# other case returns the default value specified in its second parameter field. -# -# How to use over-writable parameters from the environment: -# -# e.g. -# make SER_PAR_N=0 -# -# SER_PAR_N - Defines the interface type (serial OR parallel) -# - Default value is 1 -# -# LEGEND: Serial - 1 -# Parallel - 0 -# -# NOTE : This switch is a 'hardware' switch. Please rebuild the design if the -# variable has been changed. -# SL5 - mounted - Serial -# SL5 - unmounted - Parallel -# -##-------------------------------------------------------------- +# system level parameter -set SER_PAR_N $ad_project_params(SER_PAR_N) -puts "build parameters: SER_PAR_N: $SER_PAR_N" +set INTF $ad_project_params(INTF) +puts "build parameters: INTF: $INTF" # control lines @@ -50,14 +29,7 @@ ad_ip_parameter axi_ad7616_dma CONFIG.DMA_DATA_WIDTH_DEST 64 ad_ip_instance axi_pwm_gen ad7616_pwm_gen ad_ip_parameter ad7616_pwm_gen CONFIG.PULSE_0_PERIOD 100 ad_ip_parameter ad7616_pwm_gen CONFIG.PULSE_0_WIDTH 5 -ad_ip_parameter ad7616_pwm_gen CONFIG.ASYNC_CLK_EN 1 - -# axi_clkgen - -ad_ip_instance axi_clkgen spi_clkgen -ad_ip_parameter spi_clkgen CONFIG.CLK0_DIV 6 -ad_ip_parameter spi_clkgen CONFIG.VCO_DIV 1 -ad_ip_parameter spi_clkgen CONFIG.VCO_MUL 6 +ad_ip_parameter ad7616_pwm_gen CONFIG.ASYNC_CLK_EN 0 # trigger to BUSY's negative edge @@ -65,13 +37,13 @@ create_bd_cell -type module -reference sync_bits busy_sync create_bd_cell -type module -reference ad_edge_detect busy_capture set_property -dict [list CONFIG.EDGE 1] [get_bd_cells busy_capture] -ad_connect spi_clk busy_capture/clk +ad_connect $sys_cpu_clk busy_capture/clk ad_connect busy_capture/rst GND -ad_connect spi_clk busy_sync/out_clk +ad_connect $sys_cpu_clk busy_sync/out_clk ad_connect busy_sync/in_bits rx_busy ad_connect busy_sync/out_bits busy_capture/signal_in -if {$SER_PAR_N == 1} { +if {$INTF == 1} { create_bd_intf_port -mode Master -vlnv analog.com:interface:spi_engine_rtl:1.0 ad7616_spi source $ad_hdl_dir/library/spi_engine/scripts/spi_engine.tcl @@ -94,16 +66,20 @@ if {$SER_PAR_N == 1} { # interface connections ad_connect $sys_cpu_clk $hier_spi_engine/clk - ad_connect spi_clk $hier_spi_engine/spi_clk + ad_connect $sys_cpu_clk $hier_spi_engine/spi_clk + ad_connect sys_cpu_resetn $hier_spi_engine/resetn ad_connect $hier_spi_engine/m_spi ad7616_spi - ad_connect spi_clk axi_ad7616_dma/s_axis_aclk + ad_connect $sys_cpu_clk axi_ad7616_dma/s_axis_aclk ad_connect axi_ad7616_dma/s_axis $hier_spi_engine/m_axis_sample ad_connect busy_sync/out_resetn $hier_spi_engine/${hier_spi_engine}_axi_regmap/spi_resetn ad_connect busy_capture/signal_out $hier_spi_engine/${hier_spi_engine}_offload/trigger + ad_ip_parameter ad7616_pwm_gen CONFIG.ASYNC_CLK_EN 1 + ad_connect $sys_cpu_clk ad7616_pwm_gen/ext_clk + # interconnect ad_cpu_interconnect 0x44A00000 $hier_spi_engine/${hier_spi_engine}_axi_regmap @@ -122,12 +98,18 @@ if {$SER_PAR_N == 1} { create_bd_port -dir O rx_wr_n create_bd_port -dir O rx_cs_n - ad_ip_parameter axi_ad7616_dma CONFIG.DMA_DATA_WIDTH_SRC 16 + ad_ip_parameter axi_ad7616_dma CONFIG.DMA_DATA_WIDTH_SRC 256 ad_ip_parameter axi_ad7616_dma CONFIG.DMA_TYPE_SRC 2 ad_ip_parameter axi_ad7616_dma CONFIG.SYNC_TRANSFER_START 1 ad_ip_instance axi_ad7616 axi_ad7616 + # cpack + + ad_ip_instance util_cpack2 ad7616_adc_pack + ad_ip_parameter ad7616_adc_pack CONFIG.NUM_OF_CHANNELS 16 + ad_ip_parameter ad7616_adc_pack CONFIG.SAMPLE_DATA_WIDTH 16; + # interface connections ad_connect rx_db_o axi_ad7616/rx_db_o @@ -137,10 +119,20 @@ if {$SER_PAR_N == 1} { ad_connect rx_wr_n axi_ad7616/rx_wr_n ad_connect rx_cs_n axi_ad7616/rx_cs_n - ad_connect $sys_cpu_clk axi_ad7616_dma/fifo_wr_clk - ad_connect axi_ad7616/adc_valid axi_ad7616_dma/fifo_wr_en - ad_connect axi_ad7616/adc_data axi_ad7616_dma/fifo_wr_din - ad_connect axi_ad7616/adc_sync axi_ad7616_dma/sync + ad_connect axi_ad7616/adc_clk axi_ad7616_dma/fifo_wr_clk + + ad_connect axi_ad7616/adc_clk ad7616_adc_pack/clk + ad_connect axi_ad7616/adc_reset ad7616_adc_pack/reset + ad_connect axi_ad7616/adc_valid ad7616_adc_pack/fifo_wr_en + + ad_connect ad7616_adc_pack/packed_fifo_wr axi_ad7616_dma/fifo_wr + ad_connect ad7616_adc_pack/packed_sync axi_ad7616_dma/sync + ad_connect ad7616_adc_pack/fifo_wr_overflow axi_ad7616/adc_dovf + + for {set i 0} {$i < 16} {incr i} { + ad_connect axi_ad7616/adc_data_$i ad7616_adc_pack/fifo_wr_data_$i + ad_connect axi_ad7616/adc_enable_$i ad7616_adc_pack/enable_$i + } ad_connect busy_capture/signal_out axi_ad7616/rx_trigger ad_connect busy_sync/out_resetn sys_cpu_resetn @@ -152,20 +144,16 @@ if {$SER_PAR_N == 1} { } # interface connections -ad_connect $sys_cpu_clk spi_clkgen/clk -ad_connect spi_clk spi_clkgen/clk_0 - + ad_connect ad7616_pwm_gen/pwm_0 rx_cnvst ad_connect $sys_cpu_clk ad7616_pwm_gen/s_axi_aclk ad_connect sys_cpu_resetn ad7616_pwm_gen/s_axi_aresetn -ad_connect spi_clk ad7616_pwm_gen/ext_clk ad_connect $sys_cpu_clk axi_ad7616_dma/s_axi_aclk ad_connect sys_cpu_resetn axi_ad7616_dma/m_dest_axi_aresetn # interconnect ad_cpu_interconnect 0x44A30000 axi_ad7616_dma -ad_cpu_interconnect 0x44A70000 spi_clkgen ad_cpu_interconnect 0x44B00000 ad7616_pwm_gen # memory interconnect diff --git a/projects/ad7616_sdz/common/ad7616_serial_fmc.txt b/projects/ad7616_sdz/common/ad7616_serial_fmc.txt index ca3fab6904..56912c7b79 100644 --- a/projects/ad7616_sdz/common/ad7616_serial_fmc.txt +++ b/projects/ad7616_sdz/common/ad7616_serial_fmc.txt @@ -12,7 +12,7 @@ M22 FMC_LPC_LA04_N CSn ad7616_spi_cs LVCOMOS25 #N A18 FMC_LPC_LA24_P CONVST adc_cnvst LVCOMOS25 #N/A E20 FMC_LPC_LA21_N CHSEL0 adc_chsel[0] LVCOMOS25 #N/A E18 FMC_LPC_LA26_N CHSEL1 adc_chsel[1] LVCOMOS25 #N/A -D22 FMC_LPC_LA25_P CHSEL2 adc_chsel[2 LVCOMOS25 #N/A +D22 FMC_LPC_LA25_P CHSEL2 adc_chsel[2] LVCOMOS25 #N/A E19 FMC_LPC_LA21_P HW_RNGSEL0 adc_hw_rngsel[0] LVCOMOS25 #N/A F18 FMC_LPC_LA26_P HW_RNGSEL1 adc_hw_rngsel[1] LVCOMOS25 #N/A T19 FMC_LPC_LA10_N BUSY adc_busy LVCOMOS25 #N/A diff --git a/projects/ad7616_sdz/zed/Makefile b/projects/ad7616_sdz/zed/Makefile index 85ac8e849a..d140fee827 100644 --- a/projects/ad7616_sdz/zed/Makefile +++ b/projects/ad7616_sdz/zed/Makefile @@ -1,5 +1,5 @@ #################################################################################### -## Copyright (c) 2018 - 2023 Analog Devices, Inc. +## Copyright (c) 2018 - 2024 Analog Devices, Inc. ### SPDX short identifier: BSD-1-Clause ## Auto-generated, do not modify! #################################################################################### @@ -31,5 +31,6 @@ LIB_DEPS += spi_engine/spi_engine_interconnect LIB_DEPS += spi_engine/spi_engine_offload LIB_DEPS += sysid_rom LIB_DEPS += util_i2c_mixer +LIB_DEPS += util_pack/util_cpack2 include ../../scripts/project-xilinx.mk diff --git a/projects/ad7616_sdz/zed/system_bd.tcl b/projects/ad7616_sdz/zed/system_bd.tcl index ae95923a49..0f71916631 100644 --- a/projects/ad7616_sdz/zed/system_bd.tcl +++ b/projects/ad7616_sdz/zed/system_bd.tcl @@ -19,6 +19,6 @@ 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 "SER_PAR_N=$ad_project_params(SER_PAR_N)" +set sys_cstring "INTF=$ad_project_params(INTF)" sysid_gen_sys_init_file $sys_cstring diff --git a/projects/ad7616_sdz/zed/system_project.tcl b/projects/ad7616_sdz/zed/system_project.tcl index 7262df3092..ca683a4fa7 100644 --- a/projects/ad7616_sdz/zed/system_project.tcl +++ b/projects/ad7616_sdz/zed/system_project.tcl @@ -1,5 +1,5 @@ ############################################################################### -## Copyright (C) 2019-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2019-2024 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### @@ -16,10 +16,10 @@ source $ad_hdl_dir/projects/scripts/adi_board.tcl # How to use over-writable parameters from the environment: # # e.g. -# make SER_PAR_N=0 +# make INTF=0 # -# SER_PAR_N - Defines the interface type (serial OR parallel) -# - Default value is 1 +# INTF - Defines the interface type (serial OR parallel) +# - Default value is 0 # # LEGEND: Serial - 1 # Parallel - 0 @@ -31,21 +31,17 @@ source $ad_hdl_dir/projects/scripts/adi_board.tcl # ##-------------------------------------------------------------- -if {[info exists ::env(SER_PAR_N)]} { - set S_SER_PAR_N [get_env_param SER_PAR_N 0] -} elseif {![info exists SER_PAR_N]} { - set S_SER_PAR_N 1 -} +set INTF [get_env_param INTF 0] adi_project ad7616_sdz_zed 0 [list \ - SER_PAR_N $S_SER_PAR_N \ + INTF $INTF \ ] adi_project_files ad7616_sdz_zed [list \ "$ad_hdl_dir/library/common/ad_iobuf.v" \ "$ad_hdl_dir/projects/common/zed/zed_system_constr.xdc"] -switch $S_SER_PAR_N { +switch $INTF { 1 { adi_project_files ad7616_sdz_zed [list \ "system_top_si.v" \ diff --git a/projects/ad7616_sdz/zed/system_top_pi.v b/projects/ad7616_sdz/zed/system_top_pi.v index 1430e65fdd..4716a1e9eb 100644 --- a/projects/ad7616_sdz/zed/system_top_pi.v +++ b/projects/ad7616_sdz/zed/system_top_pi.v @@ -1,6 +1,6 @@ // *************************************************************************** // *************************************************************************** -// Copyright (C) 2019-2023 Analog Devices, Inc. All rights reserved. +// Copyright (C) 2019-2024 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 @@ -135,7 +135,7 @@ module system_top ( ad_iobuf #( .DATA_WIDTH(16) ) i_iobuf_adc_db ( - .dio_t(adc_db_t), + .dio_t({16{adc_db_t}}), .dio_i(adc_db_o[15:0]), .dio_o(adc_db_i[15:0]), .dio_p(adc_db[15:0])); From fb2492931d4fd6af100052d5508255b8e08ab308 Mon Sep 17 00:00:00 2001 From: Pop Ioan Daniel Date: Thu, 28 Nov 2024 16:22:54 +0200 Subject: [PATCH 3/3] docs: Update ad7616 documentation Signed-off-by: Pop Ioan Daniel --- docs/library/axi_ad7616/axi_ad7616.svg | 1139 +++++++++++++++++ docs/library/axi_ad7616/block_diagram.svg | 487 ------- docs/library/axi_ad7616/index.rst | 96 +- .../ad7616_sdz/ad7616_parallel_hdl.svg | 963 +++++++++----- .../projects/ad7616_sdz/ad7616_serial_hdl.svg | 108 +- docs/projects/ad7616_sdz/index.rst | 54 +- 6 files changed, 1901 insertions(+), 946 deletions(-) create mode 100644 docs/library/axi_ad7616/axi_ad7616.svg delete mode 100644 docs/library/axi_ad7616/block_diagram.svg diff --git a/docs/library/axi_ad7616/axi_ad7616.svg b/docs/library/axi_ad7616/axi_ad7616.svg new file mode 100644 index 0000000000..56ed59f84d --- /dev/null +++ b/docs/library/axi_ad7616/axi_ad7616.svg @@ -0,0 +1,1139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + DFMT + + Channel 0 + Channel 1 + ... + Channel 15 + + + + + + PARALLELINTERFACE + AXI_AD7616 + + + uP CHANNEL + + + + uP COMMON + + + + uP (AXI) + + + + ... + + + + DB_O + + BUSY + + + WR_N + + RD_N + + CS_N + DATA + + ADC_CONFIG + + + DB_I + DB_T + DATA_F + + TRIGGER + + + diff --git a/docs/library/axi_ad7616/block_diagram.svg b/docs/library/axi_ad7616/block_diagram.svg deleted file mode 100644 index b73c3a3951..0000000000 --- a/docs/library/axi_ad7616/block_diagram.svg +++ /dev/null @@ -1,487 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - DB[15:0]WRn/RDn - - - - - INPUT - OUTPUT - - - - - - - - S_AXI_LITE - WR_FIFO - - REGISTERMAP - - - CONTROL  - PARALLEL INTERFACE - - BUSY - - burst_length - - - - - - - - 15:0 - adc_data - adc_valid - adc_sync - - diff --git a/docs/library/axi_ad7616/index.rst b/docs/library/axi_ad7616/index.rst index fc75470dae..6426cbc934 100644 --- a/docs/library/axi_ad7616/index.rst +++ b/docs/library/axi_ad7616/index.rst @@ -11,6 +11,9 @@ FPGA. The core has a AXI Memory Map interface for configuration, supports the parallel data interface of the device, and has a simple FIFO interface for the DMAC. +More about the generic framework interfacing ADCs, that contains the +``up_adc_channel`` and ``up_adc_common modules``, can be read in :ref:`axi_adc`. + Files -------------------------------------------------------------------------------- @@ -21,15 +24,17 @@ Files - Description * - :git-hdl:`library/axi_ad7616/axi_ad7616.v` - Verilog source for the AXI AD7616. - * - :git-hdl:`library/axi_ad7616/axi_ad7616_control.v` - - Verilog source for the AXI AD7616 control. * - :git-hdl:`library/axi_ad7616/axi_ad7616_pif.v` - Verilog source for the AXI AD7616 parallel interface. + * - :git-hdl:`library/common/up_adc_common.v` + - Verilog source for the ADC Common regmap. + * - :git-hdl:`library/common/up_adc_channel.v` + - Verilog source for the ADC Channel regmap. Block Diagram -------------------------------------------------------------------------------- -.. image:: block_diagram.svg +.. image:: axi_ad7616.svg :alt: AXI AD7616 block diagram Configuration Parameters @@ -61,18 +66,93 @@ Interface - End of conversion signal * - adc_valid - Shows when a valid data is available on the bus - * - adc_data - - Data bus - * - adc_sync - - Shows the first valid beat on a sequence + * - adc_data_* + - Channel ADC data + * - adc_enable_* + - ADC enable signal for each channel + * - adc_clk + - ADC clock + * - adc_reset + - ADC reset + * - adc_dovf + - ADC data overflow signaling * - s_axi - Standard AXI Slave Memory Map interface Register Map -------------------------------------------------------------------------------- +The register map of the core contains instances of several generic register maps +like ADC common, ADC channel or PWM Generator. The following table presents the +base addresses of each instance, after that can be found the detailed +description of each generic register map. + +.. hdl-regmap:: + :name: COMMON + :no-type-info: + +.. hdl-regmap:: + :name: ADC_COMMON + :no-type-info: + .. hdl-regmap:: - :name: AXI_AD7616 + :name: ADC_CHANNEL + :no-type-info: + +Theory of operation +-------------------------------------------------------------------------------- + +The axi_ad7616 IP can be configured in various operation modes, this feature +being integrated in the device register map. Thus, to be able to configure the +operation mode and any other features available through the mentioned register +map, **adc_config_ctrl** signal, that is available in the *up_adc_common* +module, is used in this way: bit 1 - RD request to the device register map('b1), +bit 0 - WR request to the device register map('b1). Also, **adc_custom_control** +signal, that is available in the *up_adc_common* module, controls burst_length. + +Software Parallel Mode Channel Conversion Setting +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. wavedrom:: + + {signal: [ + {name: 'RESET_N', wave:'101................'}, + {name: 'CNVST', wave:'0....10..........1.'}, + {name: 'BUSY', wave:'0....1.0.........1.'}, + {name: 'CS_N', wave:'1.....01..........010101..............', "period" :0.5}, + {name: 'WR_N', wave:'1.....01..............01..............', "period" :0.5}, + {name: 'RD_N', wave:'1.................0101................', "period" :0.5}, + {name: 'DB[0:15]', wave:'z.....=.z.........=.=.=.z.........|.....', data: ['CHx',"A0","B0","CHy"], "period" :0.45} + ], + foot: {text: + ['tspan', 'CHx CONVERSION START'] + } + } + +Parallel Read Timing Diagram +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. wavedrom:: + + {signal: [ + {name: 'CNVST', wave:'010..........10....'}, + {name: 'BUSY', wave:'0..1......0................1......0...', "period" :0.5}, + {name: 'CS_N', wave:'1..........0..1..0..1..............0..', "period" :0.5}, + {name: 'RD_N', wave:'1......................01........01................................01.', "period" :0.25}, + {name: 'DB[0:15]', wave:'z.....=.z=.z.......', data: ['CONVA',"CONVB","B0","CHy"], "period" :1,"phase":-0.1} + ] + } + +Parallel Write Timing Diagram +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. wavedrom:: + + {signal: [ + {name: 'CNVST', wave:'0..........................1..0', "period" :0.5}, + {name: 'CS_N', wave:'1......0.....1.....0.....1.....', "period" :0.5}, + {name: 'WR_N', wave:'1......0...1.......0...1......', "period" :0.5,"phase":-0.5}, + {name: 'DB[0:15]', wave:'z..=.z.=.z.', data: ['WRITE REG 1',"WRITE REG 2","B0","CHy"], "period" :1.3,"phase":0.7} + ] + } + Software Support -------------------------------------------------------------------------------- diff --git a/docs/projects/ad7616_sdz/ad7616_parallel_hdl.svg b/docs/projects/ad7616_sdz/ad7616_parallel_hdl.svg index a1e53bcd12..9ca134c804 100644 --- a/docs/projects/ad7616_sdz/ad7616_parallel_hdl.svg +++ b/docs/projects/ad7616_sdz/ad7616_parallel_hdl.svg @@ -1,13 +1,13 @@ @@ -45,7 +45,7 @@ inkscape:connector-curvature="0" id="path2456" 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)" /> @@ -135,7 +135,7 @@ @@ -150,7 +150,7 @@ inkscape:stockid="TriangleInM"> @@ -166,7 +166,7 @@ inkscape:stockid="TriangleOutM"> @@ -182,7 +182,7 @@ inkscape:stockid="TriangleInM"> @@ -198,7 +198,7 @@ inkscape:stockid="TriangleOutM"> @@ -215,7 +215,7 @@ inkscape:connector-curvature="0" id="path16078" 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.8)" /> + + + + + + + + + + + + + + + + + + + + + + type="xygrid" + spacingy="1" + spacingx="1" + units="px" + visible="true" /> @@ -1188,7 +1297,6 @@ image/svg+xml - @@ -1198,12 +1306,12 @@ inkscape:groupmode="layer" inkscape:label="Layer 1"> + style="display:inline;opacity:1;fill:#000000;fill-opacity:0;fill-rule:nonzero;stroke:#000000;stroke-width:1.51598;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;shape-rendering:crispEdges;enable-background:new" /> FMC CONNECTOR + style="opacity:1;fill:#f9f9f9;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.62271;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" /> @@ -1482,33 +1590,33 @@ sodipodi:nodetypes="cc" inkscape:connector-curvature="0" id="path1206-1-0" - d="M 498.48353,71.123518 H 677.41759" - style="display:inline;opacity:1;fill:none;stroke:#000000;stroke-width:1.99313998;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker1216-0-3);shape-rendering:crispEdges;enable-background:new" /> + d="M 533.02356,71.767535 H 712.06159" + style="display:inline;opacity:1;fill:none;stroke:#000000;stroke-width:1.99314;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker1216-0-3);shape-rendering:crispEdges;enable-background:new" /> + d="m 533.02356,165.8827 179.03364,-0.161" + style="display:inline;opacity:1;fill:none;stroke:#000000;stroke-width:1.98635;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker1216-0-3-1-2);shape-rendering:crispEdges;enable-background:new" /> AXI AD7616 RX_WR_N + style="display:inline;fill:#e5e5e5;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.55709;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal;shape-rendering:crispEdges;enable-background:new" /> AD7616PARALLELINTERFACE - + d="m 80.827055,130.26684 -18.091052,0.0805" + style="display:inline;opacity:1;fill:none;stroke:#000000;stroke-width:2.00017;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker10933-1);marker-end:url(#marker1216-9-9-6-3-5);shape-rendering:crispEdges;enable-background:new" /> + d="m 533.17506,118.57745 178.77502,0.22769" + style="display:inline;opacity:1;fill:none;stroke:#000000;stroke-width:1.99314;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker1216-0-3-1-2-0);shape-rendering:crispEdges;enable-background:new" /> RX_DB_0[15:0] + d="M 717.84618,93.646726 H 537.9823" + style="display:inline;opacity:1;fill:none;stroke:#000000;stroke-width:1.97469;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker1216-0-3-9-7);shape-rendering:crispEdges;enable-background:new" /> + RX_DB_I[15:0] RX_DB_T + d="m 532.87207,141.11807 h 50.33878 l 128.84641,0.11385" + style="display:inline;opacity:1;fill:none;stroke:#000000;stroke-width:1.99314;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker1216-0-3-1-2-0-6);shape-rendering:crispEdges;enable-background:new" /> RX_RD_N + d="M 533.07555,185.38135 H 712.07019" + style="display:inline;opacity:1;fill:none;stroke:#000000;stroke-width:1.99314;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker1216-0-3-75);shape-rendering:crispEdges;enable-background:new" /> + d="M 717.68554,278.93514 H 554.1611" + style="display:inline;opacity:1;fill:none;stroke:#000000;stroke-width:1.90176;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker1216-0-3-9-7-8);shape-rendering:crispEdges;enable-background:new" /> RX_CS_N RX_BUSY + style="display:inline;opacity:1;fill:#e5e5e5;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.74916;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal;shape-rendering:crispEdges;enable-background:new" /> + d="M 551.86284,-21.558571 H 711.06618" + style="display:inline;opacity:1;fill:none;stroke:#000000;stroke-width:1.98635;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker1216-0-3-1-2-6);shape-rendering:crispEdges;enable-background:new" /> RX_CNVST AXI PWM GEN + style="display:inline;opacity:1;fill:#e5e5e5;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.74916;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal;shape-rendering:crispEdges;enable-background:new" /> SYNC BITS + style="display:inline;opacity:1;fill:#e5e5e5;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.95052;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal;shape-rendering:crispEdges;enable-background:new" /> EDGE DETECT trigger - - - AXI CLKGEN - spi_clk = 100MHz - - - - + style="display:inline;fill:none;fill-opacity:1;stroke:#3f4b55;stroke-width:1.98857;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:1.98857, 5.96574;stroke-dashoffset:0;stroke-opacity:1;shape-rendering:crispEdges;enable-background:new" /> AD7616_DMA + + + AD7616_PACK + sys_clk = 100MHz + id="tspan673-8-9"> sys_clk = 100MHz + + ... + style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.8;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.67501;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.673913" /> + style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.67501;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.673913" /> + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.5506;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.067;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> @@ -1965,9 +2045,9 @@ inkscape:connector-curvature="0" id="path8426" d="M 406.04958,433.33004 H 404.6091" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.06700003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.067;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> @@ -1975,9 +2055,9 @@ inkscape:connector-curvature="0" id="path8430" d="M 406.04958,437.86003 H 404.6091" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.06700003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.067;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> @@ -1985,9 +2065,9 @@ inkscape:connector-curvature="0" id="path8434" d="M 406.04958,442.34471 H 404.6091" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.06700003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.067;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> @@ -1995,14 +2075,14 @@ inkscape:connector-curvature="0" id="path8438" d="M 406.04958,446.82944 H 404.6091" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.06700003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.067;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.067;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> @@ -2012,14 +2092,14 @@ id="g8892" style="display:inline;shape-rendering:crispEdges;enable-background:new"> @@ -2029,17 +2109,17 @@ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1"> + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.973;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.308598;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.308598;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.308598;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.308598;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.41103;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.41103;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.41103;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.41103;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.41103;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> 64b + sodipodi:role="line">64 + 256b + d="m -75.365667,828.98681 -1.703605,3.40721 -0.678571,1.35714 -2.617824,5.23565" + style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + sodipodi:nodetypes="cccc" /> 16b + V0A + + + 16b + V1A + + + 16b + V7A + + + 16b + V0B + + + 16b + V1B + + + 16b + V7B + + ... diff --git a/docs/projects/ad7616_sdz/ad7616_serial_hdl.svg b/docs/projects/ad7616_sdz/ad7616_serial_hdl.svg index 8e1795d221..048191d280 100644 --- a/docs/projects/ad7616_sdz/ad7616_serial_hdl.svg +++ b/docs/projects/ad7616_sdz/ad7616_serial_hdl.svg @@ -1,7 +1,7 @@ + type="xygrid" + spacingy="1" + spacingx="1" + units="px" + visible="true" /> @@ -1362,21 +1366,12 @@ - + style="display:inline;opacity:1;fill:none;fill-opacity:1;stroke:#3f4b55;stroke-width:1.90762;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:1.90762, 5.72286;stroke-dashoffset:0;stroke-opacity:1;shape-rendering:crispEdges;enable-background:new" /> sys_clk = 100MHz + id="tspan673"> sys_clk = 100MHz AXI PWM GEN - - AXI CLKGEN - spi_clk = 100MHz - - - - ` IP core +- the serial interface is controlled by the :ref:`SPI_Engine ` + Framework +- data is written into memory by a DMA (:ref:`axi_dmac core `) +- all the control pins of the device are driven by GPIOs Block diagram ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -78,21 +80,21 @@ AD7616_SDZ parallel interface Configuration modes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The SER_PAR_N configuration parameter defines the interface type (Serial or -Parallel). By default it is set to 1. Depending on the required interface mode, +The INTF configuration parameter defines the interface type (Serial or +Parallel). By default it is set to Parallel (0). Depending on the required interface mode, some hardware modifications need to be done on the board and/or make command: In case of the **PARALLEL** interface: .. shell:: bash - $make SER_PAR_N=0 + $make INTF=0 In case of the **SERIAL** interface: .. shell:: bash - $make SER_PAR_N=1 + $make INTF=1 .. note:: @@ -129,7 +131,6 @@ added to the base address from HDL(see more at :ref:`architecture cpu-intercon-a Instance Zynq ======================== =========== axi_ad7616_dma 0x44A3_0000 -spi_clkgen 0x44A7_0000 ad7616_pwm_gen 0x44B0_0000 spi_ad7616_axi_regmap ** 0x44A0_0000 axi_ad7616 * 0x44A8_0000 @@ -138,8 +139,8 @@ axi_ad7616 * 0x44A8_0000 .. admonition:: Legend :class: note - - ``*`` instantiated only for SER_PAR_N=0 (parallel interface) - - ``**`` instantiated only for SER_PAR_N=1 (serial interface) + - ``*`` instantiated only for INTF=0 (parallel interface) + - ``**`` instantiated only for INTF=1 (serial interface) I2C connections ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -231,7 +232,7 @@ The Software GPIO number is calculated as follows: .. admonition:: Legend :class: note - - ``**`` instantiated only for SER_PAR_N=1 (serial interface) + - ``**`` instantiated only for INTF=1 (serial interface) Interrupts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -249,8 +250,8 @@ axi_ad7616 * 10 54 87 .. admonition:: Legend :class: note - - ``*`` instantiated only for SER_PAR_N=0 (parallel interface) - - ``**`` instantiated only for SER_PAR_N=1 (serial interface) + - ``*`` instantiated only for INTF=0 (parallel interface) + - ``**`` instantiated only for INTF=1 (serial interface) Building the HDL project ------------------------------------------------------------------------------- @@ -268,18 +269,20 @@ the HDL repository, and then build the project as follows:. .. shell:: $cd hdl/projects/ad7616_sdz/zed - $make SER_PAR_N=0 + $make INTF=0 + +The default configuration is Parallel Mode (0). The result of the build, if parameters were used, will be in a folder named by the configuration used: if the following command was run -``make SER_PAR_N=0`` +``make INTF=0`` then the folder name will be: -``SERPARN0`` +``INTF0`` A more comprehensive build guide can be found in the :ref:`build_hdl` user guide. @@ -291,7 +294,7 @@ Connections and hardware changes **The following hardware changes are required:** (**Please note:** Because of the **SDP-I-FMC** the level of the **VADJ** in - the carrier board needs to be set to **3.3V**. + the carrier board needs to be set to **3.3V**.) Depending on the required interface mode, some hardware modifications need to be done. @@ -326,12 +329,12 @@ HDL related * - AXI_AD7616 - :git-hdl:`library/axi_ad7616` * - :ref:`axi_ad7616` - * - AXI_CLKGEN - - :git-hdl:`library/axi_clkgen` - - :ref:`axi_clkgen` * - AXI_DMAC - :git-hdl:`library/axi_dmac` - :ref:`axi_dmac` + * - AXI_CLKGEN + - :git-hdl:`library/axi_clkgen` + - :ref:`axi_clkgen` * - AXI_HDMI_TX - :git-hdl:`library/axi_hdmi_tx` - :ref:`axi_hdmi_tx` @@ -364,13 +367,16 @@ HDL related - --- * - SYSID_ROM - :git-hdl:`library/sysid_rom` - - :ref:`axi_sysid` + - :ref:`here ` + * - UTIL_CPACK2 + - :git-hdl:`library/util_pack/util_cpack2` * + - :ref:`here ` .. admonition:: Legend :class: note - - ``*`` instantiated only for SER_PAR_N=0 (parallel interface) - - ``**`` instantiated only for SER_PAR_N=1 (serial interface) + - ``*`` instantiated only for INTF=0 (parallel interface) + - ``**`` instantiated only for INTF=1 (serial interface) - :ref:`SPI Engine Framework documentation `