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

Subversion Repositories embedded_risc

[/] [embedded_risc/] [trunk/] [Verilog/] [sdram_cntrl.v] - Blame information for rev 27

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 hosseinami
/*********************************************************
2
 MODULE:                Sub Level Controller, SDRAM control signals
3
 
4
 FILE NAME:     sdram_cntrl.v
5
 VERSION:       1.0
6
 DATE:          April 28th, 2002
7
 AUTHOR:                Hossein Amidi
8
 COMPANY:
9
 CODE TYPE:     Register Transfer Level
10
 
11
 DESCRIPTION:   This module is the sub level RTL code of SDRAM Controller ASIC verilog
12
 code. It is the SDRAM control signals block.
13
 
14
 
15
 Hossein Amidi
16
 (C) April 2002
17
 
18
*********************************************************/
19
 
20
// DEFINES
21
`timescale 1ns / 10ps
22
 
23
module sdram_cntrl(// Input
24
                                                        reset,
25
                                                        clk0,
26
                                                        wsadd,
27
                                                        wba,
28
                                                        wcs,
29
                                                        wcke,
30
                                                        wras,
31
                                                        wcas,
32
                                                        wwe,
33
                                                        sdram_in,
34
                                                        // Output
35
                                                        add,
36
                                                        ba,
37
                                                        cs,
38
                                                        cke,
39
                                                        ras,
40
                                                        cas,
41
                                                        we,
42
                                                        dataout
43
                                                        );
44
 
45
// Parameter
46
`include        "parameter.v"
47
 
48
// Input
49
input reset;
50
input clk0;
51
input [add_size - 1 : 0]wsadd;
52
input [ba_size - 1 : 0]wba;
53
input [cs_size - 1 : 0]wcs;
54
input wcke;
55
input wras;
56
input wcas;
57
input wwe;
58
input [data_size - 1 : 0]sdram_in;
59
 
60
// Output
61
output [add_size - 1 : 0]add;
62
output [ba_size - 1 : 0]ba;
63
output [cs_size - 1 : 0]cs;
64
output cke;
65
output ras;
66
output cas;
67
output we;
68
output [data_size - 1 : 0]dataout;
69
 
70
 
71
// Internal wires and reg
72
wire reset;
73
wire clk0;
74
wire [add_size - 1 : 0]wsadd;
75
wire [ba_size - 1 : 0]wba;
76
wire [cs_size - 1 : 0]wcs;
77
wire wcke;
78
wire wras;
79
wire wcas;
80
wire wwe;
81
wire [data_size - 1 : 0]sdram_in;
82
 
83
reg [add_size - 1 : 0]add;
84
reg [ba_size - 1 : 0]ba;
85
reg [cs_size - 1 : 0]cs;
86
reg cke;
87
reg ras;
88
reg cas;
89
reg we;
90
reg [data_size - 1 : 0]dataout;
91
 
92
 
93
// Assignment
94
 
95
 
96
 
97
// SDRAM Memory Control Signals
98
always @(posedge reset or posedge clk0)
99
begin
100
        if(reset == 1'b1)
101
        begin
102
                add <= 12'h0;
103
                ba <= 2'b00;
104
                cs <= 2'b00;
105
                cke <= 1'b0;
106
                ras <= 1'b0;
107
                cas <= 1'b0;
108
                we <= 1'b0;
109
                dataout <= 32'h0000_0000;
110
        end
111
        else
112
        begin
113
                add <= wsadd;
114
                ba <= wba;
115
                cs <= wcs;
116
                cke <= wcke;
117
                ras <= wras;
118
                cas <= wcas;
119
                we <= wwe;
120
                dataout <= sdram_in;
121
        end
122
end
123
 
124
endmodule

powered by: WebSVN 2.1.0

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