2015-06-26 09:04:19 +00:00
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
2023-07-06 13:54:40 +00:00
|
|
|
// Copyright (C) 2015-2023 Analog Devices, Inc. All rights reserved.
|
2016-09-21 12:23:08 +00:00
|
|
|
//
|
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
|
2018-03-14 14:45:47 +00:00
|
|
|
// freedoms and responsibilities that he or she has by using this source/core.
|
2017-05-31 15:15:24 +00:00
|
|
|
//
|
|
|
|
// 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.
|
2016-09-21 12:23:08 +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:
|
2016-09-21 12:23:08 +00:00
|
|
|
//
|
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
|
|
|
//
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
// This is the dac physical interface (drives samples from the low speed clock to the
|
|
|
|
// dac clock domain.
|
|
|
|
|
|
|
|
`timescale 1ns/100ps
|
|
|
|
|
2017-04-13 08:45:54 +00:00
|
|
|
module axi_ad9739a_if #(
|
2015-06-26 09:04:19 +00:00
|
|
|
|
2022-04-08 10:21:52 +00:00
|
|
|
parameter FPGA_TECHNOLOGY = 0
|
|
|
|
) (
|
2015-06-26 09:04:19 +00:00
|
|
|
|
|
|
|
// dac interface
|
|
|
|
|
2017-04-13 08:45:54 +00:00
|
|
|
input dac_clk_in_p,
|
|
|
|
input dac_clk_in_n,
|
|
|
|
output dac_clk_out_p,
|
|
|
|
output dac_clk_out_n,
|
|
|
|
output [13:0] dac_data_out_a_p,
|
|
|
|
output [13:0] dac_data_out_a_n,
|
|
|
|
output [13:0] dac_data_out_b_p,
|
|
|
|
output [13:0] dac_data_out_b_n,
|
2015-06-26 09:04:19 +00:00
|
|
|
|
|
|
|
// internal resets and clocks
|
|
|
|
|
2017-04-13 08:45:54 +00:00
|
|
|
input dac_rst,
|
|
|
|
output dac_clk,
|
|
|
|
output dac_div_clk,
|
|
|
|
output reg dac_status,
|
2015-06-26 09:04:19 +00:00
|
|
|
|
|
|
|
// data interface
|
|
|
|
|
2017-04-13 08:45:54 +00:00
|
|
|
input [15:0] dac_data_00,
|
|
|
|
input [15:0] dac_data_01,
|
|
|
|
input [15:0] dac_data_02,
|
|
|
|
input [15:0] dac_data_03,
|
|
|
|
input [15:0] dac_data_04,
|
|
|
|
input [15:0] dac_data_05,
|
|
|
|
input [15:0] dac_data_06,
|
|
|
|
input [15:0] dac_data_07,
|
|
|
|
input [15:0] dac_data_08,
|
|
|
|
input [15:0] dac_data_09,
|
|
|
|
input [15:0] dac_data_10,
|
|
|
|
input [15:0] dac_data_11,
|
|
|
|
input [15:0] dac_data_12,
|
|
|
|
input [15:0] dac_data_13,
|
|
|
|
input [15:0] dac_data_14,
|
2022-04-08 10:21:52 +00:00
|
|
|
input [15:0] dac_data_15
|
|
|
|
);
|
2015-06-26 09:04:19 +00:00
|
|
|
|
2017-04-13 08:45:54 +00:00
|
|
|
// internal registers
|
2015-06-26 09:04:19 +00:00
|
|
|
|
|
|
|
// internal signals
|
|
|
|
|
|
|
|
wire dac_clk_in_s;
|
|
|
|
wire dac_div_clk_s;
|
|
|
|
|
|
|
|
// dac status
|
|
|
|
|
|
|
|
always @(posedge dac_div_clk) begin
|
|
|
|
if (dac_rst == 1'b1) begin
|
|
|
|
dac_status <= 1'd0;
|
|
|
|
end else begin
|
|
|
|
dac_status <= 1'd1;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
// dac data output serdes(s) & buffers
|
|
|
|
|
|
|
|
ad_serdes_out #(
|
2016-09-21 12:23:08 +00:00
|
|
|
.DDR_OR_SDR_N(1),
|
2015-06-26 09:04:19 +00:00
|
|
|
.DATA_WIDTH(14),
|
2017-05-16 13:20:51 +00:00
|
|
|
.SERDES_FACTOR(8),
|
2022-04-08 10:21:52 +00:00
|
|
|
.FPGA_TECHNOLOGY (FPGA_TECHNOLOGY)
|
|
|
|
) i_serdes_out_data_a (
|
2015-06-26 09:04:19 +00:00
|
|
|
.rst (dac_rst),
|
|
|
|
.clk (dac_clk),
|
|
|
|
.div_clk (dac_div_clk),
|
2019-07-19 09:15:06 +00:00
|
|
|
.data_oe (1'b1),
|
2015-06-26 09:04:19 +00:00
|
|
|
.data_s0 (dac_data_00[15:2]),
|
|
|
|
.data_s1 (dac_data_02[15:2]),
|
|
|
|
.data_s2 (dac_data_04[15:2]),
|
|
|
|
.data_s3 (dac_data_06[15:2]),
|
|
|
|
.data_s4 (dac_data_08[15:2]),
|
|
|
|
.data_s5 (dac_data_10[15:2]),
|
|
|
|
.data_s6 (dac_data_12[15:2]),
|
|
|
|
.data_s7 (dac_data_14[15:2]),
|
2017-05-16 13:20:51 +00:00
|
|
|
.data_out_se (),
|
2015-06-26 09:04:19 +00:00
|
|
|
.data_out_p (dac_data_out_a_p),
|
|
|
|
.data_out_n (dac_data_out_a_n));
|
|
|
|
|
|
|
|
// dac data output serdes(s) & buffers
|
2016-09-21 12:23:08 +00:00
|
|
|
|
2015-06-26 09:04:19 +00:00
|
|
|
ad_serdes_out #(
|
2016-09-21 12:23:08 +00:00
|
|
|
.DDR_OR_SDR_N(1),
|
2015-06-26 09:04:19 +00:00
|
|
|
.DATA_WIDTH(14),
|
2017-05-16 13:20:51 +00:00
|
|
|
.SERDES_FACTOR(8),
|
2022-04-08 10:21:52 +00:00
|
|
|
.FPGA_TECHNOLOGY (FPGA_TECHNOLOGY)
|
|
|
|
) i_serdes_out_data_b (
|
2015-06-26 09:04:19 +00:00
|
|
|
.rst (dac_rst),
|
|
|
|
.clk (dac_clk),
|
|
|
|
.div_clk (dac_div_clk),
|
2019-07-19 09:15:06 +00:00
|
|
|
.data_oe (1'b1),
|
2015-06-26 09:04:19 +00:00
|
|
|
.data_s0 (dac_data_01[15:2]),
|
|
|
|
.data_s1 (dac_data_03[15:2]),
|
|
|
|
.data_s2 (dac_data_05[15:2]),
|
|
|
|
.data_s3 (dac_data_07[15:2]),
|
|
|
|
.data_s4 (dac_data_09[15:2]),
|
|
|
|
.data_s5 (dac_data_11[15:2]),
|
|
|
|
.data_s6 (dac_data_13[15:2]),
|
|
|
|
.data_s7 (dac_data_15[15:2]),
|
2017-05-16 13:20:51 +00:00
|
|
|
.data_out_se (),
|
2015-06-26 09:04:19 +00:00
|
|
|
.data_out_p (dac_data_out_b_p),
|
|
|
|
.data_out_n (dac_data_out_b_n));
|
|
|
|
|
|
|
|
// dac clock output serdes & buffer
|
2016-09-21 12:23:08 +00:00
|
|
|
|
2015-06-26 09:04:19 +00:00
|
|
|
ad_serdes_out #(
|
2016-09-21 12:23:08 +00:00
|
|
|
.DDR_OR_SDR_N(1),
|
2015-06-26 09:04:19 +00:00
|
|
|
.DATA_WIDTH(1),
|
2017-05-16 13:20:51 +00:00
|
|
|
.SERDES_FACTOR(8),
|
2022-04-08 10:21:52 +00:00
|
|
|
.FPGA_TECHNOLOGY (FPGA_TECHNOLOGY)
|
|
|
|
) i_serdes_out_clk (
|
2015-06-26 09:04:19 +00:00
|
|
|
.rst (dac_rst),
|
|
|
|
.clk (dac_clk),
|
|
|
|
.div_clk (dac_div_clk),
|
2019-07-19 09:15:06 +00:00
|
|
|
.data_oe (1'b1),
|
2015-06-26 09:04:19 +00:00
|
|
|
.data_s0 (1'b1),
|
|
|
|
.data_s1 (1'b0),
|
|
|
|
.data_s2 (1'b1),
|
|
|
|
.data_s3 (1'b0),
|
|
|
|
.data_s4 (1'b1),
|
|
|
|
.data_s5 (1'b0),
|
|
|
|
.data_s6 (1'b1),
|
|
|
|
.data_s7 (1'b0),
|
2017-05-16 13:20:51 +00:00
|
|
|
.data_out_se (),
|
2015-06-26 09:04:19 +00:00
|
|
|
.data_out_p (dac_clk_out_p),
|
|
|
|
.data_out_n (dac_clk_out_n));
|
|
|
|
|
|
|
|
// dac clock input buffers
|
|
|
|
|
|
|
|
IBUFGDS i_dac_clk_in_ibuf (
|
|
|
|
.I (dac_clk_in_p),
|
|
|
|
.IB (dac_clk_in_n),
|
|
|
|
.O (dac_clk_in_s));
|
|
|
|
|
|
|
|
BUFG i_dac_clk_in_gbuf (
|
|
|
|
.I (dac_clk_in_s),
|
|
|
|
.O (dac_clk));
|
|
|
|
|
2022-04-08 10:21:52 +00:00
|
|
|
BUFR #(
|
|
|
|
.BUFR_DIVIDE("4")
|
|
|
|
) i_dac_div_clk_rbuf (
|
2015-06-26 09:04:19 +00:00
|
|
|
.CLR (1'b0),
|
|
|
|
.CE (1'b1),
|
|
|
|
.I (dac_clk_in_s),
|
|
|
|
.O (dac_div_clk_s));
|
|
|
|
|
|
|
|
BUFG i_dac_div_clk_gbuf (
|
|
|
|
.I (dac_div_clk_s),
|
|
|
|
.O (dac_div_clk));
|
|
|
|
|
|
|
|
endmodule
|