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

Subversion Repositories embedded_risc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 hosseinami
/*********************************************************
2
 MODULE:                Sub Level SDRAM Controller Command Interface
3
 
4
 FILE NAME:     command_if.v
5
 VERSION:       1.0
6
 DATE:          April 8nd, 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 will decode the uProcessor command, its a command interface block.
13
 
14
 It will instantiate the following blocks in the ASIC:
15
 
16
 1)     Command Decoder
17
 2)     Internal Register
18
 3)   Command Acknowledge
19
 4)     Refresh Timer
20
 
21
 Hossein Amidi
22
 (C) April 2002
23
 
24
*********************************************************/
25
 
26
// DEFINES
27
`timescale 1ns / 10ps
28
 
29
module command_if (// Input
30
                                                reset,
31
                                                clk0,
32
                                                paddr,
33
                                                cmd,
34
                                                cmack,
35
                                                ref_ack,
36
                                                // Output
37
                                                cmdack,
38
                                                caddr,
39
                                                nop,
40
                                                reada,
41
                                                writea,
42
                                                refresh,
43
                                                preacharge,
44
                                                load_mod,
45
                                                cas_lat,
46
                                                ras_cas,
47
                                                ref_dur,
48
                                                page_mod,
49
                                                bur_len,
50
                                                ref_req
51
                                                );
52
 
53
// Parameter
54
`include        "parameter.v"
55
 
56
// Input
57
input reset;
58
input clk0;
59
input [padd_size - 1 : 0]paddr;
60
input [cmd_size  - 1 : 0]cmd;
61
input cmack;
62
input ref_ack;
63
 
64
// Output
65
output cmdack;
66
output [padd_size - 1 : 0]caddr;
67
output nop;
68
output reada;
69
output writea;
70
output refresh;
71
output preacharge;
72
output load_mod;
73
output [cas_size - 1 : 0]cas_lat;
74
output [rc_size - 1 : 0]ras_cas;
75
output [ref_dur_size - 1 : 0]ref_dur;
76
output page_mod;
77
output [burst_size - 1 : 0]bur_len;
78
output ref_req;
79
 
80
// Internal wire and reg signals
81
 
82
 
83
wire reset;
84
wire clk0;
85
wire [padd_size - 1 : 0]paddr;
86
wire [cmd_size  - 1 : 0]cmd;
87
 
88
wire nop;
89
wire reada;
90
wire writea;
91
wire refresh;
92
wire preacharge;
93
wire load_mod;
94
wire load_time;
95
wire load_rfcnt;
96
wire [padd_size - 1 : 0]caddr;
97
 
98
wire [cas_size - 1 : 0]cas_lat;
99
wire [rc_size - 1 : 0]ras_cas;
100
wire [ref_dur_size - 1 : 0]ref_dur;
101
wire page_mod;
102
wire [burst_size - 1 : 0]bur_len;
103
wire [15:0]refresh_count;
104
 
105
wire cmack;
106
wire cmdack;
107
wire ref_ack;
108
wire ref_req;
109
 
110
// Assignment
111
 
112
 
113
/************************************ Sub-Level Instantiation *****************************/
114
 
115
cmd_decoder cmd_decoder0(       // Input
116
                                                                        .reset(reset),
117
                                                                        .clk0(clk0),
118
                                                                        .paddr(paddr),
119
                                                                        .cmd(cmd),
120
                                                                        .cmdack(cmdack),
121
                                                                        // Output
122
                                                                        .nop(nop),
123
                                                                        .reada(reada),
124
                                                                        .writea(writea),
125
                                                                        .refresh(refresh),
126
                                                                        .preacharge(preacharge),
127
                                                                        .load_mod(load_mod),
128
                                                                        .load_time(load_time),
129
                                                                        .load_rfcnt(load_rfcnt),
130
                                                                        .caddr(caddr)
131
                                                                        );
132
 
133
 
134
internal_reg internal_reg0(     // Input
135
                                                                                .reset(reset),
136
                                                                                .clk0(clk0),
137
                                                                                .load_time(load_time),
138
                                                                                .load_rfcnt(load_rfcnt),
139
                                                                                .caddr(caddr),
140
                                                                                // Output
141
                                                                                .cas_lat(cas_lat),
142
                                                                                .ras_cas(ras_cas),
143
                                                                                .ref_dur(ref_dur),
144
                                                                                .page_mod(page_mod),
145
                                                                                .bur_len(bur_len),
146
                                                                                .refresh_count(refresh_count)
147
                                                                                );
148
 
149
cmd_ack cmd_ack0(// Input
150
                                                .reset(reset),
151
                                                .clk0(clk0),
152
                                                .cmack(cmack),
153
                                                .load_time(load_time),
154
                                                .load_rfcnt(load_rfcnt),
155
                                                // Output
156
                                                .cmdack(cmdack)
157
                                                );
158
 
159
 
160
ref_timer       ref_timer0(// Input
161
                                                                .reset(reset),
162
                                                                .clk0(clk0),
163
                                                                .refresh_count(refresh_count),
164
                                                                .bur_len(bur_len),
165
                                                                .ref_ack(ref_ack),
166
                                                                // Output
167
                                                                .ref_req(ref_req)
168
                                                                );
169
 
170
 
171
endmodule

powered by: WebSVN 2.1.0

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