3 // USRP - Universal Software Radio Peripheral
5 // Copyright (C) 2007 Corgan Enterprises LLC
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA
22 `include "../top/config.vh"
24 module dac_interface(clk_i,rst_i,ena_i,strobe_i,tx_i_i,tx_q_i,tx_data_o,tx_sync_o);
33 output [15:0] tx_data_o;
41 // Create a 128 MHz clock
42 dacpll pll128(.areset(rst_i),.inclk0(clk_i),.c0(clk128));
44 // Register the clk64 clock in the clk128 domain
45 always @(posedge clk128)
48 // Register the tx data in the clk128 domain
49 always @(posedge clk128)
50 tx_data_o <= clk64_d ? tx_i_i : tx_q_i;
52 assign tx_sync_o = clk64_d;
55 `else // !`ifdef TX_RATE_MAX
56 assign tx_data_o = strobe_i ? tx_q_i : tx_i_i;
57 assign tx_sync_o = strobe_i;
58 `endif // !`ifdef TX_RATE_MAX
60 endmodule // dac_interface