OpenCores
URL https://opencores.org/ocsvn/hpdmc/hpdmc/trunk

Subversion Repositories hpdmc

[/] [hpdmc/] [trunk/] [hpdmc_ddr32/] [rtl/] [spartan6/] [hpdmc_ddrio.v] - Blame information for rev 21

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 21 lekernel
/*
2
 * Milkymist VJ SoC
3
 * Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, version 3 of the License.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 */
17
 
18
module hpdmc_ddrio(
19
        input sys_clk,
20
        input sys_clk_n,
21
        input dqs_clk,
22
        input dqs_clk_n,
23
 
24
        input direction,
25
        input direction_r,
26
        input [7:0] mo,
27
        input [63:0] do,
28
        output [63:0] di,
29
 
30
        output [3:0] sdram_dm,
31
        inout [31:0] sdram_dq,
32
        inout [3:0] sdram_dqs,
33
 
34
        input idelay_rst,
35
        input idelay_ce,
36
        input idelay_inc
37
);
38
 
39
/******/
40
/* DQ */
41
/******/
42
 
43
wire [31:0] sdram_dq_t;
44
wire [31:0] sdram_dq_out;
45
wire [31:0] sdram_dq_in;
46
 
47
hpdmc_iobuf32 iobuf_dq(
48
        .T(sdram_dq_t),
49
        .I(sdram_dq_out),
50
        .O(sdram_dq_in),
51
        .IO(sdram_dq)
52
);
53
 
54
hpdmc_oddr32 oddr_dq_t(
55
        .Q(sdram_dq_t),
56
        .C0(sys_clk),
57
        .C1(sys_clk_n),
58
        .CE(1'b1),
59
        .D0({32{~direction_r}}),
60
        .D1({32{~direction_r}}),
61
        .R(1'b0),
62
        .S(1'b0)
63
);
64
 
65
hpdmc_oddr32 oddr_dq(
66
        .Q(sdram_dq_out),
67
        .C0(sys_clk),
68
        .C1(sys_clk_n),
69
        .CE(1'b1),
70
        .D0(do[63:32]),
71
        .D1(do[31:0]),
72
        .R(1'b0),
73
        .S(1'b0)
74
);
75
 
76
hpdmc_iddr32 iddr_dq(
77
        .Q0(di[31:0]),
78
        .Q1(di[63:32]),
79
        .C0(sys_clk),
80
        .C1(sys_clk_n),
81
        .CE(1'b1),
82
        .D(sdram_dq_in),
83
        .R(1'b0),
84
        .S(1'b0)
85
);
86
 
87
/*******/
88
/* DM */
89
/*******/
90
 
91
hpdmc_oddr4 oddr_dm(
92
        .Q(sdram_dm),
93
        .C0(sys_clk),
94
        .C1(sys_clk_n),
95
        .CE(1'b1),
96
        .D0(mo[7:4]),
97
        .D1(mo[3:0]),
98
        .R(1'b0),
99
        .S(1'b0)
100
);
101
 
102
/*******/
103
/* DQS */
104
/*******/
105
 
106
wire [3:0] sdram_dqs_t;
107
wire [3:0] sdram_dqs_out;
108
 
109
hpdmc_obuft4 obuft_dqs(
110
        .T(sdram_dqs_t),
111
        .I(sdram_dqs_out),
112
        .O(sdram_dqs)
113
);
114
 
115
hpdmc_oddr4 oddr_dqs_t(
116
        .Q(sdram_dqs_t),
117
        .C0(dqs_clk),
118
        .C1(dqs_clk_n),
119
        .CE(1'b1),
120
        .D0({4{~direction_r}}),
121
        .D1({4{~direction_r}}),
122
        .R(1'b0),
123
        .S(1'b0)
124
);
125
 
126
hpdmc_oddr4 oddr_dqs(
127
        .Q(sdram_dqs_out),
128
        .C0(dqs_clk),
129
        .C1(dqs_clk_n),
130
        .CE(1'b1),
131
        .D0(4'hf),
132
        .D1(4'h0),
133
        .R(1'b0),
134
        .S(1'b0)
135
);
136
 
137
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.