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