1 |
4 |
rudi |
/****************************************************************************************
|
2 |
|
|
*
|
3 |
|
|
* File Name: MT58L64L32P.V
|
4 |
|
|
* Version: 1.5
|
5 |
|
|
* Date: June 29th, 2001
|
6 |
|
|
* Model: Behavioral
|
7 |
|
|
* Simulator: Model Technology
|
8 |
|
|
*
|
9 |
|
|
* Dependencies: None
|
10 |
|
|
*
|
11 |
|
|
* Author: Son P. Huynh
|
12 |
|
|
* Email: sphuynh@micron.com
|
13 |
|
|
* Phone: (208) 368-3825
|
14 |
|
|
* Company: Micron Technology, Inc.
|
15 |
|
|
* Part #: MT58L64L32P (64K x 32)
|
16 |
|
|
*
|
17 |
|
|
* Description: This is Micron's Synburst SRAM (Pipelined SCD)
|
18 |
|
|
*
|
19 |
|
|
* Limitation:
|
20 |
|
|
*
|
21 |
|
|
* Disclaimer: THESE DESIGNS ARE PROVIDED "AS IS" WITH NO WARRANTY
|
22 |
|
|
* WHATSOEVER AND MICRON SPECIFICALLY DISCLAIMS ANY
|
23 |
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
|
24 |
|
|
* A PARTICULAR PURPOSE, OR AGAINST INFRINGEMENT.
|
25 |
|
|
*
|
26 |
|
|
* Copyright (c) 1997 Micron Semiconductor Products, Inc.
|
27 |
|
|
* All rights researved
|
28 |
|
|
*
|
29 |
|
|
* Rev Author Phone Date Changes
|
30 |
|
|
* --- -------------- -------------- ---------- --------------------------------------
|
31 |
|
|
* 1.5 Son P. Huynh (208) 368-3825 04/30/1999 Update timing parameters
|
32 |
|
|
* Micron Technology, Inc.
|
33 |
|
|
*
|
34 |
|
|
****************************************************************************************/
|
35 |
|
|
|
36 |
|
|
// DO NOT CHANGE THE TIMESCALE
|
37 |
|
|
// MAKE SURE YOUR SIMULATOR USE "PS" RESOLUTION
|
38 |
|
|
`timescale 1ns / 100ps
|
39 |
|
|
|
40 |
|
|
module mt58l64l32p (Dq, Addr, Mode, Adv_n, Clk, Adsc_n, Adsp_n, Bwa_n, Bwb_n, Bwc_n, Bwd_n, Bwe_n, Gw_n, Ce_n, Ce2, Ce2_n, Oe_n, Zz);
|
41 |
|
|
|
42 |
|
|
// Constant Parameters
|
43 |
|
|
parameter addr_bits = 16; // 16 bits
|
44 |
|
|
parameter data_bits = 32; // 32 bits
|
45 |
|
|
parameter mem_sizes = 65535; // 64 K
|
46 |
|
|
|
47 |
|
|
// Timing Parameters for -5 (200 Mhz)
|
48 |
|
|
parameter tKQHZ = 2.5; // Clock to output HiZ
|
49 |
|
|
|
50 |
|
|
// Port Delcarations
|
51 |
|
|
inout [(data_bits - 1) : 0] Dq; // Data IO
|
52 |
|
|
input [(addr_bits - 1) : 0] Addr; // Address
|
53 |
|
|
input Mode; // Burst Mode
|
54 |
|
|
input Adv_n; // Synchronous Address Advance
|
55 |
|
|
input Clk; // Clock
|
56 |
|
|
input Adsc_n; // Synchronous Address Status Controller
|
57 |
|
|
input Adsp_n; // Synchronous Address Status Processor
|
58 |
|
|
input Bwa_n; // Synchronous Byte Write Enables
|
59 |
|
|
input Bwb_n; // Synchronous Byte Write Enables
|
60 |
|
|
input Bwc_n; // Synchronous Byte Write Enables
|
61 |
|
|
input Bwd_n; // Synchronous Byte Write Enables
|
62 |
|
|
input Bwe_n; // Byte Write Enable
|
63 |
|
|
input Gw_n; // Global Write
|
64 |
|
|
input Ce_n; // Synchronous Chip Enable
|
65 |
|
|
input Ce2; // Synchronous Chip Enable
|
66 |
|
|
input Ce2_n; // Synchronous Chip Enable
|
67 |
|
|
input Oe_n; // Output Enable
|
68 |
|
|
input Zz; // Snooze Mode
|
69 |
|
|
|
70 |
|
|
// Memory Arrays
|
71 |
|
|
reg [((data_bits / 4) - 1) : 0] bank0 [0 : mem_sizes]; // Memory Bank 0
|
72 |
|
|
reg [((data_bits / 4) - 1) : 0] bank1 [0 : mem_sizes]; // Memory Bank 1
|
73 |
|
|
reg [((data_bits / 4) - 1) : 0] bank2 [0 : mem_sizes]; // Memory Bank 2
|
74 |
|
|
reg [((data_bits / 4) - 1) : 0] bank3 [0 : mem_sizes]; // Memory Bank 3
|
75 |
|
|
|
76 |
|
|
// Declare Connection Variables
|
77 |
|
|
reg [(data_bits - 1) : 0] dout; // Output Registers
|
78 |
|
|
reg [(addr_bits - 1) : 0] addr_reg_in; // Address Register In
|
79 |
|
|
reg [(addr_bits - 1) : 0] addr_reg_read; // Address Register for Read Operation
|
80 |
|
|
reg [1 : 0] bcount; // 2-bit Burst Counter
|
81 |
|
|
|
82 |
|
|
reg ce_reg;
|
83 |
|
|
reg pipe_reg;
|
84 |
|
|
reg bwa_reg;
|
85 |
|
|
reg bwb_reg;
|
86 |
|
|
reg bwc_reg;
|
87 |
|
|
reg bwd_reg;
|
88 |
|
|
reg sys_clk;
|
89 |
|
|
|
90 |
|
|
wire ce = (~Ce_n & Ce2 & ~Ce2_n);
|
91 |
|
|
wire bwa_n = ((Bwa_n | Bwe_n) & Gw_n | (~Ce_n & ~Adsp_n));
|
92 |
|
|
wire bwb_n = ((Bwb_n | Bwe_n) & Gw_n | (~Ce_n & ~Adsp_n));
|
93 |
|
|
wire bwc_n = ((Bwc_n | Bwe_n) & Gw_n | (~Ce_n & ~Adsp_n));
|
94 |
|
|
wire bwd_n = ((Bwd_n | Bwe_n) & Gw_n | (~Ce_n & ~Adsp_n));
|
95 |
|
|
wire clr = (~Adsc_n | (~Adsp_n & ~Ce_n));
|
96 |
|
|
|
97 |
|
|
wire [(addr_bits - 1) : 0] addr_reg_write; // Address Register for Write Operation
|
98 |
|
|
wire baddr1; // Burst Address 1
|
99 |
|
|
wire baddr0; // Burst Address 0
|
100 |
|
|
|
101 |
|
|
// Initial Conditions
|
102 |
|
|
initial begin
|
103 |
|
|
ce_reg = 1'b0;
|
104 |
|
|
sys_clk = 1'b0;
|
105 |
|
|
pipe_reg = 1'b0;
|
106 |
|
|
$timeformat (-9, 1, " ns", 10); // Format time unit
|
107 |
|
|
end
|
108 |
|
|
|
109 |
|
|
// System Clock
|
110 |
|
|
always begin
|
111 |
|
|
@ (posedge Clk) begin
|
112 |
|
|
sys_clk = ~Zz;
|
113 |
|
|
end
|
114 |
|
|
@ (negedge Clk) begin
|
115 |
|
|
sys_clk = 1'b0;
|
116 |
|
|
end
|
117 |
|
|
end
|
118 |
|
|
|
119 |
|
|
always @ (posedge sys_clk) begin
|
120 |
|
|
// Address Register
|
121 |
|
|
if (clr) addr_reg_in <= Addr;
|
122 |
|
|
addr_reg_read <= {addr_reg_in[addr_bits - 1 : 2], baddr1, baddr0};
|
123 |
|
|
|
124 |
|
|
// Binary Counter and Logic
|
125 |
|
|
if ( Mode & clr) bcount <= 0; // Interleaved Burst
|
126 |
|
|
else if (~Mode & clr) bcount <= Addr [1 : 0]; // Linear Burst
|
127 |
|
|
else if (~Adv_n & ~clr) bcount <= (bcount + 1); // Advance Counter
|
128 |
|
|
|
129 |
|
|
// Byte Write Register
|
130 |
|
|
bwa_reg <= ~bwa_n;
|
131 |
|
|
bwb_reg <= ~bwb_n;
|
132 |
|
|
bwc_reg <= ~bwc_n;
|
133 |
|
|
bwd_reg <= ~bwd_n;
|
134 |
|
|
|
135 |
|
|
// Enable Register
|
136 |
|
|
if (clr) ce_reg <= ce;
|
137 |
|
|
|
138 |
|
|
// Pipelined Enable
|
139 |
|
|
pipe_reg <= ce_reg;
|
140 |
|
|
|
141 |
|
|
end
|
142 |
|
|
|
143 |
|
|
// Burst Address Decode
|
144 |
|
|
assign addr_reg_write = {addr_reg_in [(addr_bits - 1) : 2], baddr1, baddr0};
|
145 |
|
|
assign baddr1 = Mode ? (bcount [1] ^ addr_reg_in [1]) : bcount [1];
|
146 |
|
|
assign baddr0 = Mode ? (bcount [0] ^ addr_reg_in [0]) : bcount [0];
|
147 |
|
|
|
148 |
|
|
// Write Driver
|
149 |
|
|
always @ (posedge Clk) begin
|
150 |
|
|
#0.1;
|
151 |
|
|
if (ce_reg & bwa_reg) begin
|
152 |
|
|
bank0 [addr_reg_write] <= Dq [((data_bits / 4) - 1) : 0];
|
153 |
|
|
end
|
154 |
|
|
if (ce_reg & bwb_reg) begin
|
155 |
|
|
bank1 [addr_reg_write] <= Dq [((data_bits / 2) - 1) : (data_bits / 4)];
|
156 |
|
|
end
|
157 |
|
|
if (ce_reg & bwc_reg) begin
|
158 |
|
|
bank2 [addr_reg_write] <= Dq [(((data_bits / 4) * 3) - 1) : (data_bits / 2)];
|
159 |
|
|
end
|
160 |
|
|
if (ce_reg & bwd_reg) begin
|
161 |
|
|
bank3 [addr_reg_write] <= Dq [(data_bits - 1) : ((data_bits / 4) * 3)];
|
162 |
|
|
end
|
163 |
|
|
end
|
164 |
|
|
|
165 |
|
|
// Output Register
|
166 |
|
|
always @ (posedge Clk) begin
|
167 |
|
|
#0.1;
|
168 |
|
|
if (~(bwa_reg | bwb_reg | bwc_reg | bwd_reg)) begin
|
169 |
|
|
dout [((data_bits / 4) - 1) : 0] <= bank0 [addr_reg_read];
|
170 |
|
|
dout [((data_bits / 2) - 1) : (data_bits / 4)] <= bank1 [addr_reg_read];
|
171 |
|
|
dout [(((data_bits / 4) * 3) - 1) : (data_bits / 2)] <= bank2 [addr_reg_read];
|
172 |
|
|
dout [(data_bits - 1) : ((data_bits / 4) * 3)] <= bank3 [addr_reg_read];
|
173 |
|
|
end
|
174 |
|
|
end
|
175 |
|
|
|
176 |
|
|
// Output Buffer
|
177 |
|
|
assign #tKQHZ Dq = (~Oe_n & ~Zz & ce_reg & pipe_reg & ~(bwa_reg | bwb_reg | bwc_reg | bwd_reg)) ? dout : {data_bits{1'bz}};
|
178 |
|
|
|
179 |
|
|
// Timing Check for -5 (200 Mhz)
|
180 |
|
|
specify
|
181 |
|
|
specparam // Clock
|
182 |
|
|
tKC = 5.0,
|
183 |
|
|
tKH = 1.6,
|
184 |
|
|
tKL = 1.6,
|
185 |
|
|
// Setup Times
|
186 |
|
|
tAS = 1.5,
|
187 |
|
|
tADSS = 1.5,
|
188 |
|
|
tAAS = 1.5,
|
189 |
|
|
tWS = 1.5,
|
190 |
|
|
tDS = 1.5,
|
191 |
|
|
tCES = 1.5,
|
192 |
|
|
// Hold Times
|
193 |
|
|
tAH = 0.5,
|
194 |
|
|
tADSH = 0.5,
|
195 |
|
|
tAAH = 0.5,
|
196 |
|
|
tWH = 0.5,
|
197 |
|
|
tDH = 0.5,
|
198 |
|
|
tCEH = 0.5;
|
199 |
|
|
|
200 |
|
|
$width (negedge Clk, tKL);
|
201 |
|
|
$width (posedge Clk, tKH);
|
202 |
|
|
$period (negedge Clk, tKC);
|
203 |
|
|
$period (posedge Clk, tKC);
|
204 |
|
|
$setuphold (posedge Clk, Adsp_n, tADSS, tADSH);
|
205 |
|
|
$setuphold (posedge Clk, Adsc_n, tADSS, tADSH);
|
206 |
|
|
$setuphold (posedge Clk, Addr, tAS, tAH);
|
207 |
|
|
$setuphold (posedge Clk, Bwa_n, tWS, tWH);
|
208 |
|
|
$setuphold (posedge Clk, Bwb_n, tWS, tWH);
|
209 |
|
|
$setuphold (posedge Clk, Bwc_n, tWS, tWH);
|
210 |
|
|
$setuphold (posedge Clk, Bwd_n, tWS, tWH);
|
211 |
|
|
$setuphold (posedge Clk, Bwe_n, tWS, tWH);
|
212 |
|
|
$setuphold (posedge Clk, Gw_n, tWS, tWH);
|
213 |
|
|
$setuphold (posedge Clk, Ce_n, tCES, tCEH);
|
214 |
|
|
$setuphold (posedge Clk, Ce2, tCES, tCEH);
|
215 |
|
|
$setuphold (posedge Clk, Ce2_n, tCES, tCEH);
|
216 |
|
|
$setuphold (posedge Clk, Adv_n, tAAS, tAAH);
|
217 |
|
|
endspecify
|
218 |
|
|
|
219 |
|
|
endmodule
|
220 |
|
|
|