2015-06-26 09:04:19 +00:00
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
2017-05-17 08:44:52 +00:00
|
|
|
// Copyright 2014 - 2017 (c) Analog Devices, Inc. All rights reserved.
|
|
|
|
//
|
2017-05-31 15:15:24 +00:00
|
|
|
// 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 responsabilities 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
|
2017-05-29 06:55:41 +00:00
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
// A PARTICULAR PURPOSE.
|
2017-05-17 08:44:52 +00:00
|
|
|
//
|
2017-05-29 06:55:41 +00:00
|
|
|
// 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:
|
2017-05-17 08:44:52 +00:00
|
|
|
//
|
|
|
|
// 1. The GNU General Public License version 2 as published by the
|
2017-05-31 15:15:24 +00:00
|
|
|
// Free Software Foundation, which can be found in the top level directory
|
|
|
|
// of this repository (LICENSE_GPL2), and also online at:
|
|
|
|
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
|
2017-05-17 08:44:52 +00:00
|
|
|
//
|
|
|
|
// OR
|
|
|
|
//
|
2017-05-31 15:15:24 +00:00
|
|
|
// 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:
|
2017-05-29 06:55:41 +00:00
|
|
|
// https://github.com/analogdevicesinc/hdl/blob/master/LICENSE_ADIBSD
|
|
|
|
// This will allow to generate bit files and not release the source code,
|
|
|
|
// as long as it attaches to an ADI device.
|
2015-06-26 09:04:19 +00:00
|
|
|
//
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
// ADC channel-
|
|
|
|
|
|
|
|
`timescale 1ns/100ps
|
|
|
|
|
2017-04-13 08:45:54 +00:00
|
|
|
module axi_ad9652_channel #(
|
2015-06-26 09:04:19 +00:00
|
|
|
|
2017-04-13 08:45:54 +00:00
|
|
|
parameter Q_OR_I_N = 0,
|
|
|
|
parameter CHANNEL_ID = 0,
|
|
|
|
parameter DATAPATH_DISABLE = 0) (
|
2015-06-26 09:04:19 +00:00
|
|
|
|
|
|
|
// adc interface
|
|
|
|
|
2017-04-13 08:45:54 +00:00
|
|
|
input adc_clk,
|
|
|
|
input adc_rst,
|
|
|
|
input [15:0] adc_data,
|
|
|
|
input adc_or,
|
2015-06-26 09:04:19 +00:00
|
|
|
|
|
|
|
// channel interface
|
|
|
|
|
2017-04-13 08:45:54 +00:00
|
|
|
output [15:0] adc_dcfilter_data_out,
|
|
|
|
input [15:0] adc_dcfilter_data_in,
|
|
|
|
output [15:0] adc_iqcor_data,
|
|
|
|
output adc_enable,
|
|
|
|
output up_adc_pn_err,
|
|
|
|
output up_adc_pn_oos,
|
|
|
|
output up_adc_or,
|
2015-06-26 09:04:19 +00:00
|
|
|
|
|
|
|
// processor interface
|
|
|
|
|
2017-04-13 08:45:54 +00:00
|
|
|
input up_rstn,
|
|
|
|
input up_clk,
|
|
|
|
input up_wreq,
|
|
|
|
input [13:0] up_waddr,
|
|
|
|
input [31:0] up_wdata,
|
|
|
|
output up_wack,
|
|
|
|
input up_rreq,
|
|
|
|
input [13:0] up_raddr,
|
|
|
|
output [31:0] up_rdata,
|
|
|
|
output up_rack);
|
|
|
|
|
2015-06-26 09:04:19 +00:00
|
|
|
|
|
|
|
// internal signals
|
|
|
|
|
2015-07-24 12:35:13 +00:00
|
|
|
wire [15:0] adc_dcfilter_data_s;
|
2015-06-26 09:04:19 +00:00
|
|
|
wire adc_iqcor_enb_s;
|
|
|
|
wire adc_dcfilt_enb_s;
|
|
|
|
wire [15:0] adc_dcfilt_offset_s;
|
|
|
|
wire [15:0] adc_dcfilt_coeff_s;
|
|
|
|
wire [15:0] adc_iqcor_coeff_1_s;
|
|
|
|
wire [15:0] adc_iqcor_coeff_2_s;
|
|
|
|
wire [ 3:0] adc_pnseq_sel_s;
|
|
|
|
wire adc_pn_err_s;
|
|
|
|
wire adc_pn_oos_s;
|
|
|
|
|
|
|
|
// iq correction inputs
|
|
|
|
|
|
|
|
axi_ad9652_pnmon i_pnmon (
|
|
|
|
.adc_clk (adc_clk),
|
|
|
|
.adc_data (adc_data),
|
|
|
|
.adc_pn_oos (adc_pn_oos_s),
|
|
|
|
.adc_pn_err (adc_pn_err_s),
|
|
|
|
.adc_pnseq_sel (adc_pnseq_sel_s));
|
|
|
|
|
|
|
|
generate
|
2015-08-19 11:11:47 +00:00
|
|
|
if (DATAPATH_DISABLE == 1) begin
|
2015-06-26 09:04:19 +00:00
|
|
|
assign adc_dcfilter_data_out = adc_data;
|
|
|
|
end else begin
|
|
|
|
ad_dcfilter i_ad_dcfilter (
|
|
|
|
.clk (adc_clk),
|
|
|
|
.valid (1'b1),
|
|
|
|
.data (adc_data),
|
|
|
|
.valid_out (),
|
2015-07-24 12:35:13 +00:00
|
|
|
.data_out (adc_dcfilter_data_s),
|
2015-06-26 09:04:19 +00:00
|
|
|
.dcfilt_enb (adc_dcfilt_enb_s),
|
|
|
|
.dcfilt_coeff (adc_dcfilt_coeff_s),
|
|
|
|
.dcfilt_offset (adc_dcfilt_offset_s));
|
|
|
|
end
|
|
|
|
endgenerate
|
|
|
|
|
2015-07-24 12:35:13 +00:00
|
|
|
assign adc_dcfilter_data_out = adc_dcfilter_data_s;
|
|
|
|
|
2015-06-26 09:04:19 +00:00
|
|
|
generate
|
2015-08-19 11:11:47 +00:00
|
|
|
if (DATAPATH_DISABLE == 1) begin
|
2015-07-24 12:35:13 +00:00
|
|
|
assign adc_iqcor_data = adc_dcfilter_data_s;
|
2015-06-26 09:04:19 +00:00
|
|
|
end else begin
|
2015-08-19 11:11:47 +00:00
|
|
|
ad_iqcor #(.Q_OR_I_N(Q_OR_I_N)) i_ad_iqcor (
|
2015-06-26 09:04:19 +00:00
|
|
|
.clk (adc_clk),
|
|
|
|
.valid (1'b1),
|
2015-07-24 12:35:13 +00:00
|
|
|
.data_in (adc_dcfilter_data_s),
|
|
|
|
.data_iq (adc_dcfilter_data_in),
|
2015-06-26 09:04:19 +00:00
|
|
|
.valid_out (),
|
|
|
|
.data_out (adc_iqcor_data),
|
|
|
|
.iqcor_enable (adc_iqcor_enb_s),
|
|
|
|
.iqcor_coeff_1 (adc_iqcor_coeff_1_s),
|
|
|
|
.iqcor_coeff_2 (adc_iqcor_coeff_2_s));
|
|
|
|
end
|
|
|
|
endgenerate
|
|
|
|
|
2016-09-23 17:44:47 +00:00
|
|
|
up_adc_channel #(.CHANNEL_ID(CHANNEL_ID)) i_up_adc_channel (
|
2015-06-26 09:04:19 +00:00
|
|
|
.adc_clk (adc_clk),
|
|
|
|
.adc_rst (adc_rst),
|
|
|
|
.adc_enable (adc_enable),
|
|
|
|
.adc_iqcor_enb (adc_iqcor_enb_s),
|
|
|
|
.adc_dcfilt_enb (adc_dcfilt_enb_s),
|
|
|
|
.adc_dfmt_se (),
|
|
|
|
.adc_dfmt_type (),
|
|
|
|
.adc_dfmt_enable (),
|
|
|
|
.adc_dcfilt_offset (adc_dcfilt_offset_s),
|
|
|
|
.adc_dcfilt_coeff (adc_dcfilt_coeff_s),
|
|
|
|
.adc_iqcor_coeff_1 (adc_iqcor_coeff_1_s),
|
|
|
|
.adc_iqcor_coeff_2 (adc_iqcor_coeff_2_s),
|
|
|
|
.adc_pnseq_sel (adc_pnseq_sel_s),
|
|
|
|
.adc_data_sel (),
|
|
|
|
.adc_pn_err (adc_pn_err_s),
|
|
|
|
.adc_pn_oos (adc_pn_oos_s),
|
|
|
|
.adc_or (adc_or),
|
|
|
|
.up_adc_pn_err (up_adc_pn_err),
|
|
|
|
.up_adc_pn_oos (up_adc_pn_oos),
|
|
|
|
.up_adc_or (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),
|
|
|
|
.up_waddr (up_waddr),
|
|
|
|
.up_wdata (up_wdata),
|
|
|
|
.up_wack (up_wack),
|
|
|
|
.up_rreq (up_rreq),
|
|
|
|
.up_raddr (up_raddr),
|
|
|
|
.up_rdata (up_rdata),
|
|
|
|
.up_rack (up_rack));
|
|
|
|
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
|