1 |
4 |
rudi |
/****************************************************************************************
|
2 |
|
|
*
|
3 |
|
|
* File Name: MT58L1MY18D.V
|
4 |
|
|
* Version: 1.3
|
5 |
|
|
* Date: March 8th, 1999
|
6 |
|
|
* Model: BUS Functional
|
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 #: MT58L1MY18D (1Mb x 18)
|
16 |
|
|
*
|
17 |
|
|
* Description: This is Micron's Syncburst SRAM (Pipelined DCD)
|
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 Date Changes
|
30 |
|
|
* --- ---------------------------- ---------- ---------------------------------------
|
31 |
|
|
* 1.3 Son P. Huynh 208-368-3825 03/08/1999 Improve model functionality
|
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 mt58l1my18d (Dq, Addr, Mode, Adv_n, Clk, Adsc_n, Adsp_n, Bwa_n, Bwb_n, Bwe_n, Gw_n, Ce_n, Ce2, Ce2_n, Oe_n, Zz);
|
41 |
|
|
|
42 |
|
|
parameter addr_bits = 20; // 20 bits
|
43 |
|
|
parameter data_bits = 18; // 18 bits
|
44 |
|
|
parameter mem_sizes = 1048575; // 1 Mb
|
45 |
|
|
parameter reg_delay = 0.1; // 100 ps
|
46 |
|
|
parameter out_delay = 0.1; // 100 ps
|
47 |
|
|
parameter tKQHZ = 3.5; // -6 device
|
48 |
|
|
|
49 |
|
|
inout [(data_bits - 1) : 0] Dq; // Data IO
|
50 |
|
|
input [(addr_bits - 1) : 0] Addr; // Address
|
51 |
|
|
input Mode; // Burst Mode
|
52 |
|
|
input Adv_n; // Synchronous Address Advance
|
53 |
|
|
input Clk; // Clock
|
54 |
|
|
input Adsc_n; // Synchronous Address Status Controller
|
55 |
|
|
input Adsp_n; // Synchronous Address Status Processor
|
56 |
|
|
input Bwa_n; // Synchronous Byte Write Enables
|
57 |
|
|
input Bwb_n; // Synchronous Byte Write Enables
|
58 |
|
|
input Bwe_n; // Byte Write Enable
|
59 |
|
|
input Gw_n; // Global Write
|
60 |
|
|
input Ce_n; // Synchronous Chip Enable
|
61 |
|
|
input Ce2; // Synchronous Chip Enable
|
62 |
|
|
input Ce2_n; // Synchronous Chip Enable
|
63 |
|
|
input Oe_n; // Output Enable
|
64 |
|
|
input Zz; // Snooze Mode
|
65 |
|
|
|
66 |
|
|
reg [((data_bits / 2) - 1) : 0] bank0 [0 : mem_sizes]; // Memory Bank 0
|
67 |
|
|
reg [((data_bits / 2) - 1) : 0] bank1 [0 : mem_sizes]; // Memory Bank 1
|
68 |
|
|
|
69 |
|
|
reg [(data_bits - 1) : 0] din; // Input Registers
|
70 |
|
|
reg [(data_bits - 1) : 0] dout; // Output Registers
|
71 |
|
|
reg [(addr_bits - 1) : 0] addr_reg_in; // Address Register In
|
72 |
|
|
reg [(addr_bits - 1) : 0] addr_reg_read; // Address Register for Read Operation
|
73 |
|
|
reg [1 : 0] bcount; // 2-bit Burst Counter
|
74 |
|
|
|
75 |
|
|
reg ce_reg;
|
76 |
|
|
reg pipe_reg;
|
77 |
|
|
reg bwa_reg;
|
78 |
|
|
reg bwb_reg;
|
79 |
|
|
reg sys_clk;
|
80 |
|
|
|
81 |
|
|
wire ce = (~Ce_n & ~Ce2_n & Ce2);
|
82 |
|
|
wire bwa_n = (((Bwa_n | Bwe_n) & Gw_n) | (~Ce_n & ~Adsp_n));
|
83 |
|
|
wire bwb_n = (((Bwb_n | Bwe_n) & Gw_n) | (~Ce_n & ~Adsp_n));
|
84 |
|
|
wire clr = (~Adsc_n | (~Adsp_n & ~Ce_n));
|
85 |
|
|
|
86 |
|
|
wire [(addr_bits - 1) : 0] addr_reg_write; // Address Register for Write Operation
|
87 |
|
|
wire baddr1; // Burst Address 1
|
88 |
|
|
wire baddr0; // Burst Address 0
|
89 |
|
|
|
90 |
|
|
// Initialize
|
91 |
|
|
initial begin
|
92 |
|
|
ce_reg = 1'b0;
|
93 |
|
|
sys_clk = 1'b0;
|
94 |
|
|
pipe_reg = 1'b0;
|
95 |
|
|
$timeformat (-9, 1, " ns", 10); // Format time unit
|
96 |
|
|
end
|
97 |
|
|
|
98 |
|
|
|
99 |
|
|
task mem_fill;
|
100 |
|
|
input x;
|
101 |
|
|
|
102 |
|
|
integer a, n, x;
|
103 |
23 |
rudi |
reg [15:0] data;
|
104 |
4 |
rudi |
begin
|
105 |
|
|
|
106 |
|
|
a=0;
|
107 |
|
|
for(n=0;n<x;n=n+1)
|
108 |
|
|
begin
|
109 |
23 |
rudi |
data = a;
|
110 |
|
|
bank0[n] = { ^data[15:8], data[15:8], ^data[7:0], data[7:0]};
|
111 |
|
|
data = a+1;
|
112 |
|
|
bank1[n] = { ^data[15:8], data[15:8], ^data[7:0], data[7:0]};
|
113 |
4 |
rudi |
a=a+2;
|
114 |
|
|
end
|
115 |
|
|
|
116 |
|
|
end
|
117 |
|
|
endtask
|
118 |
|
|
|
119 |
|
|
// System Clock
|
120 |
|
|
always begin
|
121 |
|
|
@ (posedge Clk) begin
|
122 |
|
|
sys_clk = ~Zz;
|
123 |
|
|
end
|
124 |
|
|
@ (negedge Clk) begin
|
125 |
|
|
sys_clk = 1'b0;
|
126 |
|
|
end
|
127 |
|
|
end
|
128 |
|
|
|
129 |
|
|
always @ (posedge sys_clk) begin
|
130 |
|
|
// Address Register
|
131 |
|
|
if (clr) addr_reg_in <= Addr;
|
132 |
|
|
addr_reg_read <= {addr_reg_in [(addr_bits - 1) : 2], baddr1, baddr0};
|
133 |
|
|
|
134 |
|
|
// Binary Counter and Logic
|
135 |
|
|
if ( Mode & clr) bcount <= 0; // Interleaved Burst
|
136 |
|
|
else if (~Mode & clr) bcount <= Addr [1 : 0]; // Linear Burst
|
137 |
|
|
else if (~Adv_n & ~clr) bcount <= (bcount + 1); // Advance Counter
|
138 |
|
|
|
139 |
|
|
// Byte Write Register
|
140 |
|
|
bwa_reg <= ~bwa_n;
|
141 |
|
|
bwb_reg <= ~bwb_n;
|
142 |
|
|
|
143 |
|
|
// Enable Register
|
144 |
|
|
if (clr) ce_reg <= ce;
|
145 |
|
|
|
146 |
|
|
// Pipelined Enable
|
147 |
|
|
pipe_reg <= ce_reg;
|
148 |
|
|
end
|
149 |
|
|
|
150 |
|
|
// Burst Address Decode
|
151 |
|
|
assign addr_reg_write = {addr_reg_in [(addr_bits - 1) : 2], baddr1, baddr0};
|
152 |
|
|
assign baddr1 = Mode ? (bcount [1] ^ addr_reg_in [1]) : bcount [1];
|
153 |
|
|
assign baddr0 = Mode ? (bcount [0] ^ addr_reg_in [0]) : bcount [0];
|
154 |
|
|
|
155 |
|
|
// Write Driver
|
156 |
|
|
always @ (posedge Clk) begin
|
157 |
|
|
#reg_delay;
|
158 |
|
|
if (ce_reg & bwa_reg) begin
|
159 |
|
|
din [data_bits / 2 - 1 : 0] <= Dq [data_bits / 2 - 1 : 0];
|
160 |
|
|
bank0 [addr_reg_write] <= Dq [data_bits / 2 - 1 : 0];
|
161 |
|
|
end
|
162 |
|
|
if (ce_reg & bwb_reg) begin
|
163 |
|
|
din [data_bits - 1 : data_bits / 2] <= Dq [data_bits - 1 : data_bits / 2];
|
164 |
|
|
bank1 [addr_reg_write] <= Dq [data_bits - 1 : data_bits / 2];
|
165 |
|
|
end
|
166 |
|
|
end
|
167 |
|
|
|
168 |
|
|
// Output Registers
|
169 |
|
|
always @ (posedge Clk) begin
|
170 |
|
|
#out_delay;
|
171 |
|
|
if (~(bwa_reg | bwb_reg)) begin
|
172 |
|
|
dout [data_bits / 2 - 1 : 0] <= bank0 [addr_reg_read];
|
173 |
|
|
dout [data_bits - 1 : data_bits / 2] <= bank1 [addr_reg_read];
|
174 |
|
|
end else begin
|
175 |
|
|
dout [data_bits - 1 : 0] <= {data_bits{1'bz}};
|
176 |
|
|
end
|
177 |
|
|
end
|
178 |
|
|
|
179 |
|
|
// Output Buffers
|
180 |
|
|
assign #(tKQHZ) Dq = (~Oe_n & ~Zz & pipe_reg & ~(bwa_reg | bwb_reg)) ? dout : {data_bits{1'bz}};
|
181 |
|
|
|
182 |
|
|
// Timing Check (6 ns clock cycle / 166 MHz)
|
183 |
|
|
// Please download latest datasheet from our Web site:
|
184 |
|
|
// http://www.micron.com/mti
|
185 |
|
|
specify
|
186 |
|
|
specparam tKC = 6.0, // Clock - Clock cycle time
|
187 |
|
|
tKH = 2.3, // Clock HIGH time
|
188 |
|
|
tKL = 2.3, // Clock LOW time
|
189 |
|
|
tAS = 1.5, // Setup Times - Address
|
190 |
|
|
tADSS = 1.5, // Address Status
|
191 |
|
|
tAAS = 1.5, // Address Advance
|
192 |
|
|
tWS = 1.5, // Byte Write Enables
|
193 |
|
|
tDS = 1.5, // Data-in
|
194 |
|
|
tCES = 1.5, // Chip Enable
|
195 |
|
|
tAH = 0.5, // Hold Times - Address
|
196 |
|
|
tADSH = 0.5, // Address Status
|
197 |
|
|
tAAH = 0.5, // Address Advance
|
198 |
|
|
tWH = 0.5, // Byte Write Enables
|
199 |
|
|
tDH = 0.5, // Data-in
|
200 |
|
|
tCEH = 0.5; // Chip Enable
|
201 |
|
|
|
202 |
|
|
$width (negedge Clk, tKL);
|
203 |
|
|
$width (posedge Clk, tKH);
|
204 |
|
|
$period (negedge Clk, tKC);
|
205 |
|
|
$period (posedge Clk, tKC);
|
206 |
|
|
$setuphold (posedge Clk, Adsp_n, tADSS, tADSH);
|
207 |
|
|
$setuphold (posedge Clk, Adsc_n, tADSS, tADSH);
|
208 |
|
|
$setuphold (posedge Clk, Addr, tAS, tAH);
|
209 |
|
|
$setuphold (posedge Clk, Bwa_n, tWS, tWH);
|
210 |
|
|
$setuphold (posedge Clk, Bwb_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 |
|
|
|