1 |
24 |
dgisselq |
////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
//
|
3 |
|
|
// Filename: xoddrserdes.v
|
4 |
|
|
//
|
5 |
|
|
// Project: A wishbone controlled DDR3 SDRAM memory controller.
|
6 |
|
|
//
|
7 |
|
|
// Purpose: Provide DDR outputs at 8x the clock rate (with a 4x clock given)
|
8 |
|
|
// for such things as the memory clock output, and the data strobe
|
9 |
|
|
// output (DQS) which needs to be synchronous with the memory clock output.
|
10 |
|
|
//
|
11 |
|
|
// Creator: Dan Gisselquist, Ph.D.
|
12 |
|
|
// Gisselquist Technology, LLC
|
13 |
|
|
//
|
14 |
|
|
////////////////////////////////////////////////////////////////////////////////
|
15 |
|
|
//
|
16 |
|
|
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
|
17 |
|
|
//
|
18 |
|
|
// This program is free software (firmware): you can redistribute it and/or
|
19 |
|
|
// modify it under the terms of the GNU General Public License as published
|
20 |
|
|
// by the Free Software Foundation, either version 3 of the License, or (at
|
21 |
|
|
// your option) any later version.
|
22 |
|
|
//
|
23 |
|
|
// This program is distributed in the hope that it will be useful, but WITHOUT
|
24 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
25 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
26 |
|
|
// for more details.
|
27 |
|
|
//
|
28 |
|
|
// You should have received a copy of the GNU General Public License along
|
29 |
|
|
// with this program. (It's in the $(ROOT)/doc directory, run make with no
|
30 |
|
|
// target there if the PDF file isn't present.) If not, see
|
31 |
|
|
// <http://www.gnu.org/licenses/> for a copy.
|
32 |
|
|
//
|
33 |
|
|
// License: GPL, v3, as defined and found on www.gnu.org,
|
34 |
|
|
// http://www.gnu.org/licenses/gpl.html
|
35 |
|
|
//
|
36 |
|
|
//
|
37 |
|
|
////////////////////////////////////////////////////////////////////////////////
|
38 |
|
|
//
|
39 |
|
|
//
|
40 |
|
|
module xoddrserdes(i_clk_fast, i_clk_slow, i_reset, i_data, o_pin);
|
41 |
|
|
input i_clk_fast, i_clk_slow, i_reset;
|
42 |
|
|
input [7:0] i_data;
|
43 |
|
|
output o_pin;
|
44 |
|
|
|
45 |
|
|
wire local_monitor_pin__unconnected;
|
46 |
|
|
wire oe_for_fabric__unconnected;
|
47 |
|
|
wire [1:0] local_shiftout__unconnected;
|
48 |
|
|
wire local_tbyte_out__unconnected;
|
49 |
|
|
wire send_to_iob;
|
50 |
|
|
wire oe_for_iob;
|
51 |
|
|
|
52 |
|
|
OSERDESE2 #(
|
53 |
|
|
.DATA_RATE_OQ("DDR"),
|
54 |
|
|
.DATA_RATE_TQ("BUF"),
|
55 |
|
|
.DATA_WIDTH(8), // 8 data wires sent per clkdiv
|
56 |
|
|
.INIT_OQ(1'b1),
|
57 |
|
|
.SERDES_MODE("MASTER"),
|
58 |
|
|
//
|
59 |
|
|
.TRISTATE_WIDTH(1),
|
60 |
|
|
.INIT_TQ(1'b1),
|
61 |
|
|
.TBYTE_CTL("FALSE"),
|
62 |
|
|
.TBYTE_SRC("FALSE")
|
63 |
|
|
) oserdes_i(
|
64 |
|
|
.CLK(i_clk_fast),
|
65 |
|
|
.CLKDIV(i_clk_slow),
|
66 |
|
|
.OCE(1'b1),
|
67 |
|
|
.OFB(local_monitor_pin__unconnected),
|
68 |
|
|
.OQ(send_to_iob),
|
69 |
|
|
.RST(i_reset),
|
70 |
|
|
//
|
71 |
|
|
.TCE(1'b1),
|
72 |
|
|
.TQ(oe_for_iob),
|
73 |
|
|
.TFB(oe_for_fabric__unconnected),
|
74 |
|
|
.T1(1'b0), .T2(1'b0), .T3(1'b0), .T4(1'b0),
|
75 |
|
|
//
|
76 |
|
|
.SHIFTOUT1(local_shiftout__unconnected[0]),
|
77 |
|
|
.SHIFTOUT2(local_shiftout__unconnected[1]),
|
78 |
|
|
.SHIFTIN1(1'b0),
|
79 |
|
|
.SHIFTIN2(1'b0),
|
80 |
|
|
.TBYTEIN(1'b0),
|
81 |
|
|
.TBYTEOUT(local_tbyte_out__unconnected),
|
82 |
|
|
//
|
83 |
|
|
// And now for the actual data we wish to send
|
84 |
|
|
//
|
85 |
|
|
.D1(i_data[0]), .D2(i_data[1]),
|
86 |
|
|
.D3(i_data[2]), .D4(i_data[3]),
|
87 |
|
|
.D5(i_data[4]), .D6(i_data[5]),
|
88 |
|
|
.D7(i_data[6]), .D8(i_data[7])
|
89 |
|
|
);
|
90 |
|
|
|
91 |
|
|
OBUF iobuf_i(.I(send_to_iob), .O(o_pin));
|
92 |
|
|
|
93 |
|
|
endmodule
|
94 |
|
|
|