source: PlatformSupport/CustomPeripherals/pcores/fmc_bb_4da_bridge_v1_00_a/hdl/verilog/fmc_bb_4da_bridge.v

Last change on this file was 1897, checked in by murphpo, 11 years ago
File size: 3.8 KB
Line 
1module fmc_bb_4da_bridge
2(
3    //Ref clk for IDELAYCTRL
4    input clk200,
5   
6    //Input sampling clocks - User design must provide these clock signals
7   
8    // sys_samp_clk_Tx requirements:
9    //  -Synchronous to and valid for capturing user_RFx_TXD ports
10    //  -Frequency must match AD9963 input data rate configuration (DAC clock / interpolation rate)
11    input sys_samp_clk,
12
13    // sys_samp_clk_Tx_90 must be 90 degree phase shift of sys_samp_clk_Tx (used to generate TXCLK output)
14    input sys_samp_clk_90,
15
16    input [0:11] user_DAC_A,
17    input [0:11] user_DAC_B,
18    input [0:11] user_DAC_C,
19    input [0:11] user_DAC_D,
20   
21    output [0:13] DAC_AB_DB,
22    output [0:13] DAC_CD_DB,
23    output DAC_AB_CLK,
24    output DAC_CD_CLK
25);
26
27parameter C_FAMILY = "virtex6";
28parameter INCLUDE_IDELAYCTRL = 1;
29
30parameter DAC_AB_CLK_ODELAY_TAPS = 31;
31parameter DAC_CD_CLK_ODELAY_TAPS = 31;
32
33generate
34if(INCLUDE_IDELAYCTRL==1) begin
35IDELAYCTRL IDELAYCTRL_inst (
36      .RDY(),       // 1-bit Ready output
37      .REFCLK(clk200), // 1-bit Reference clock input
38      .RST(1'b0)        // 1-bit Reset input
39   );
40end
41endgenerate
42
43/* DAC Clocks are delayed here to give enough separation from clock and data transitions
44   Signal flow is: (OPADs inferred by tools, when user ties DAC_ ports to top-level ports)
45   CLK: sys_samp_clk -> ODDR -> DAC_X_CLK_unDelayed -> ODELAY -> DAC_X_CLK PAD
46   Data: user_DAC_X -> ODDR -> DAC_X_DB PADs
47*/
48ODDR #(
49    .DDR_CLK_EDGE("OPPOSITE_EDGE"), // "OPPOSITE_EDGE" or "SAME_EDGE"
50    .INIT(1'b0),    // Initial value of Q: 1'b0 or 1'b1
51    .SRTYPE("SYNC") // Set/Reset type: "SYNC" or "ASYNC"
52) OBUFDDR_DACCLK_AB (
53    .Q(DAC_AB_CLK),   // 1-bit DDR output
54    .C(sys_samp_clk_90),   // 1-bit clock input
55    .CE(1'b1), // 1-bit clock enable input
56    .D1(1'b1), // 1-bit data input (positive edge)
57    .D2(1'b0), // 1-bit data input (negative edge)
58    .R(1'b0),   // 1-bit reset
59    .S(1'b0)    // 1-bit set
60);
61
62ODDR #(
63    .DDR_CLK_EDGE("OPPOSITE_EDGE"), // "OPPOSITE_EDGE" or "SAME_EDGE"
64    .INIT(1'b0),    // Initial value of Q: 1'b0 or 1'b1
65    .SRTYPE("SYNC") // Set/Reset type: "SYNC" or "ASYNC"
66) OBUFDDR_DACCLK_CD (
67    .Q(DAC_CD_CLK),   // 1-bit DDR output
68    .C(sys_samp_clk_90),   // 1-bit clock input
69    .CE(1'b1), // 1-bit clock enable input
70    .D1(1'b1), // 1-bit data input (positive edge)
71    .D2(1'b0), // 1-bit data input (negative edge)
72    .R(1'b0),   // 1-bit reset
73    .S(1'b0)    // 1-bit set
74);
75
76//Instantiate all the DDR registers for DAC DB outputs
77// User-supplied 12-bit values become 12MSB of 14-bit outputs
78// 2 LSB tied to zero (NC on AD9116)
79genvar ii;
80generate
81    for(ii=0; ii<12; ii=ii+1) begin: DDR_REGS_RFA_RFB
82        ODDR #(
83            .DDR_CLK_EDGE("SAME_EDGE"), // "OPPOSITE_EDGE" or "SAME_EDGE"
84            .INIT(1'b0),    // Initial value of Q: 1'b0 or 1'b1
85            .SRTYPE("SYNC") // Set/Reset type: "SYNC" or "ASYNC"
86        ) ODDR_DAC_AB_DB (
87            .Q(DAC_AB_DB[ii]),   // 1-bit DDR output
88            .C(sys_samp_clk),   // 1-bit clock input
89            .CE(1'b1), // 1-bit clock enable input
90            .D1(user_DAC_A[ii]), // 1-bit data input (positive edge)
91            .D2(user_DAC_B[ii]), // 1-bit data input (negative edge)
92            .R(1'b0),   // 1-bit reset
93            .S(1'b0)    // 1-bit set
94        );
95        ODDR #(
96            .DDR_CLK_EDGE("SAME_EDGE"), // "OPPOSITE_EDGE" or "SAME_EDGE"
97            .INIT(1'b0),    // Initial value of Q: 1'b0 or 1'b1
98            .SRTYPE("SYNC") // Set/Reset type: "SYNC" or "ASYNC"
99        ) ODDR_DAC_CD_DB (
100            .Q(DAC_CD_DB[ii]),   // 1-bit DDR output
101            .C(sys_samp_clk),   // 1-bit clock input
102            .CE(1'b1), // 1-bit clock enable input
103            .D1(user_DAC_C[ii]), // 1-bit data input (positive edge)
104            .D2(user_DAC_D[ii]), // 1-bit data input (negative edge)
105            .R(1'b0),   // 1-bit reset
106            .S(1'b0)    // 1-bit set
107        );
108        end
109endgenerate
110
111//Just in case a 4DA board gets built with the AD9117 (14-bit DACs) in the future, ensure the 2MBS are tied low
112// Actual users for the AD9117 should modify this core to have 14-bit user ports (future feature, maybe)
113assign DAC_AB_DB[12:13] = 2'b0;
114assign DAC_CD_DB[12:13] = 2'b0;
115
116endmodule
Note: See TracBrowser for help on using the repository browser.