aboutsummaryrefslogtreecommitdiffstats
path: root/fpga/usrp2/top/N2x0/capture_ddrlvds.v
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-06-14 17:29:21 -0700
committerJosh Blum <josh@joshknows.com>2011-06-14 17:29:21 -0700
commitdd157937466f3ee18b08712625eba84582a913f3 (patch)
tree6a4eadb148a2c8141032b78d3c521d56c1f34910 /fpga/usrp2/top/N2x0/capture_ddrlvds.v
parenta1f36ebf436fccbb6cc81bb5f32a790d444772c2 (diff)
parentc0fadece89314f3a00892122c28caf187ce1a717 (diff)
downloaduhd-dd157937466f3ee18b08712625eba84582a913f3.tar.gz
uhd-dd157937466f3ee18b08712625eba84582a913f3.tar.bz2
uhd-dd157937466f3ee18b08712625eba84582a913f3.zip
Merge branch 'fpga_next' into uhd_next
Diffstat (limited to 'fpga/usrp2/top/N2x0/capture_ddrlvds.v')
-rw-r--r--fpga/usrp2/top/N2x0/capture_ddrlvds.v55
1 files changed, 55 insertions, 0 deletions
diff --git a/fpga/usrp2/top/N2x0/capture_ddrlvds.v b/fpga/usrp2/top/N2x0/capture_ddrlvds.v
new file mode 100644
index 000000000..e261dcbe8
--- /dev/null
+++ b/fpga/usrp2/top/N2x0/capture_ddrlvds.v
@@ -0,0 +1,55 @@
+//
+// Copyright 2011 Ettus Research LLC
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+
+
+module capture_ddrlvds
+ #(parameter WIDTH=7)
+ (input clk,
+ input ssclk_p,
+ input ssclk_n,
+ input [WIDTH-1:0] in_p,
+ input [WIDTH-1:0] in_n,
+ output reg [(2*WIDTH)-1:0] out);
+
+ wire [WIDTH-1:0] ddr_dat;
+ wire ssclk;
+ wire [(2*WIDTH)-1:0] out_pre1;
+ reg [(2*WIDTH)-1:0] out_pre2;
+
+ IBUFGDS #(.IOSTANDARD("LVDS_33"), .DIFF_TERM("TRUE"))
+ clkbuf (.O(ssclk), .I(ssclk_p), .IB(ssclk_n));
+
+ genvar i;
+ generate
+ for(i = 0; i < WIDTH; i = i + 1)
+ begin : gen_lvds_pins
+ IBUFDS #(.IOSTANDARD("LVDS_33"),.DIFF_TERM("FALSE")) ibufds
+ (.O(ddr_dat[i]), .I(in_p[i]), .IB(in_n[i]) );
+ IDDR2 #(.DDR_ALIGNMENT("C1")) iddr2
+ (.Q0(out_pre1[2*i]), .Q1(out_pre1[(2*i)+1]), .C0(ssclk), .C1(~ssclk),
+ .CE(1'b1), .D(ddr_dat[i]), .R(1'b0), .S(1'b0));
+ end
+ endgenerate
+
+ always @(posedge clk)
+ out_pre2 <= out_pre1;
+
+ always @(posedge clk)
+ out <= out_pre2;
+
+endmodule // capture_ddrlvds