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

Subversion Repositories mem_ctrl

[/] [mem_ctrl/] [trunk/] [bench/] [verilog/] [sram_models/] [IDT71T67802/] [idt71t67802s133.v] - Blame information for rev 28

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 rudi
/*******************************************************************************
2
 *   Copyright 1999 Integrated Device Technology, Inc.
3
 *   All right reserved.
4
 *
5
 *   This program is proprietary and confidential information of
6
 *   IDT Corp. and may be used and disclosed only as authorized
7
 *   in a license agreement controlling such use and disclosure.
8
 *
9
 *   IDT reserves the right to make any changes to
10
 *   the product herein to improve function or design.
11
 *   IDT does not assume any liability arising out of
12
 *   the application or use of the product herein.
13
 *
14
 *   WARNING: The unlicensed shipping, mailing, or carring of this
15
 *   technical data outside the United States, or the unlicensed
16
 *   disclosure, by whatever means, through visits abroad, or the
17
 *   unlicensed disclosure to foreign national in the United States,
18
 *   may violate the United States criminal law.
19
 *
20
 *   File Name                 : idt71t67802s133.v
21
 *   Product                   : IDT71T67802
22
 *   Function                  : 512Kx18 pipeline burst Static RAM
23
 *   Simulation Tool/Version   : Verilog-XL 2.5
24
 *   Revision                  : rev00
25
 *   Date                      : 23/03/00
26
 *
27
 ******************************************************************************/
28
 
29
/*******************************************************************************
30
 * Module Name: idt71t67802s133
31
 *
32
 * Notes                     : This model is believed to be functionally
33
 *                             accurate.  Please direct any inquiries to
34
 *                             IDT SRAM Applications at: sramhelp@idt.com
35
 *
36
 *******************************************************************************/
37
`timescale 1ns/10ps
38
 
39
module  idt71t67802s133(A, D, DP, oe_, ce_, cs0, cs1_, lbo_,
40
                      gw_, bwe_, bw2_, bw1_, adsp_, adsc_, adv_, clk);
41
initial
42
begin
43
   $write("\n********************************************************\n");
44
   $write("   idt71t67802s133                                        \n");
45
   $write("   Rev: 01    July '99                                    \n");
46
   $write("   copyright 1997,1998,1999 by IDT, Inc.                  \n");
47
   $write("**********************************************************\n");
48
end
49
 
50
parameter addr_msb = 18;
51
parameter mem_top = 524287;
52
 
53
parameter regdelay = 1;
54
 
55
inout [15:0] D;
56
inout [1:0] DP;
57
input [addr_msb:0] A;
58
input oe_, ce_, cs0, cs1_, lbo_, gw_, bwe_, bw2_, bw1_,
59
      adsp_, adsc_, adv_, clk;
60
 
61
//internal registers for data, address, burst counter
62
 
63
reg [15:0] din, dout;
64
reg [1:0] dpin, dpout;
65
reg [addr_msb:0] reg_addr;
66
reg [1:0] brst_cnt;
67
 
68
wire[addr_msb:0] m_ad;
69
wire[15:0] data_out;
70
wire[1:0] dp_out;
71
 
72
reg wr_b1_, wr_b2_, deselr, deselrr;
73
 
74
wire check_data =  (~adsc_ & adsp_ & ~ce_ & cs0 & ~cs1_
75
                           & (~gw_ | ~bwe_ & (~bw1_ | ~bw2_)))
76
                 | (~deselr & adsc_ & (adsp_ | ce_)
77
                            & (~gw_ | ~bwe_ & (~bw1_ | ~bw2_)));
78
 
79
wire check_addr =   (~adsp_ & ~ce_ & cs0 & ~cs1_)
80
                  | ( adsp_ & ~adsc_ & ~ce_ & cs0 & ~cs1_);
81
 
82
specify
83
specparam
84
 
85
//Clock Parameters
86
   tCYC  = 7.5, //clock cycle time
87
   tCH   = 3,   //clock high time
88
   tCL   = 3,   //clock low time
89
//Output Parameters
90
   tCD   = 4.2, //clk to data
91
   tCDC  = 1.5, //output hold from clock
92
   tCLZ  = 0,   //CLK to output Low-Z
93
   tCHZ  = 4.2, //CLK to output Hi-Z
94
   tOE   = 4.2, //OE to output valid
95
   tOLZ  = 0,   //OE to output Hi-Z
96
   tOHZ  = 4.2, //OE to output Hi-Z
97
//Set up times   
98
   tSA   = 1.5, //address set-up
99
   tSS   = 1.5, //address status set-up
100
   tSD   = 1.5, //data set-up
101
   tSW   = 1.5, //write set-up
102
   tSAV  = 1.5, //address advance set-up
103
   tSC   = 1.5, //chip enable and chip select set-up
104
//Hold times
105
   tHA   = 0.5, //Address hold
106
   tHS   = 0.5, //address status hold
107
   tHD   = 0.5, //data hold
108
   tHW   = 0.5, //write hold
109
   tHAV  = 0.5, //address advance hold
110
   tHC   = 0.5; //chip enable and chip select hold
111
 
112
   (oe_ *> D) = (tOE,tOE,tOHZ,tOLZ,tOHZ,tOLZ); //(01,10,0z,z1,1z,z0)
113
   (clk *> D) = (tCD,tCD,tCHZ,tCLZ,tCHZ,tCLZ); //(01,10,0z,z1,1z,z0)
114
 
115
   (oe_ *> DP) = (tOE,tOE,tOHZ,tOLZ,tOHZ,tOLZ); //(01,10,0z,z1,1z,z0)
116
   (clk *> DP) = (tCD,tCD,tCHZ,tCLZ,tCHZ,tCLZ); //(01,10,0z,z1,1z,z0)
117
 
118
//timing checks
119
 
120
   $period(posedge clk, tCYC );
121
   $width (posedge clk, tCH );
122
   $width (negedge clk, tCL );
123
 
124
   $setuphold(posedge clk, adsp_, tSS, tHS);
125
   $setuphold(posedge clk, adsc_, tSS, tHS);
126
   $setuphold(posedge clk, adv_, tSAV, tHAV);
127
   $setuphold(posedge clk, gw_, tSW, tHW);
128
   $setuphold(posedge clk, bwe_, tSW, tHW);
129
   $setuphold(posedge clk, bw1_, tSW, tHW);
130
   $setuphold(posedge clk, bw2_, tSW, tHW);
131
   $setuphold(posedge clk, ce_, tSC, tHC);
132
   $setuphold(posedge clk, cs0, tSC, tHC);
133
   $setuphold(posedge clk, cs1_, tSC, tHC);
134
 
135
   $setuphold(posedge clk &&& check_addr, A, tSA, tHA);
136
   $setuphold(posedge clk &&& check_data, D, tSD, tHD);
137
   $setuphold(posedge clk &&& check_data, DP, tSD, tHD);
138
 
139
endspecify
140
 
141
//////////////memory array//////////////////////////////////////////////
142
 
143
reg [7:0] memb1[0:mem_top];
144
reg [7:0] memb2[0:mem_top];
145
 
146
reg memb1p[0:mem_top], memb2p[0:mem_top];
147
 
148
wire doe, baddr1, baddr0, dsel;
149
 
150
task mem_fill;
151
input   x;
152
 
153
integer         a, n, x;
154
 
155
begin
156
 
157
a=0;
158
for(n=0;n<x;n=n+1)
159
   begin
160
        memb1[n] = a[7:0];
161
        a=a+1;
162
        memb2[n] = a[7:0];
163
        a=a+1;
164
   end
165
 
166
end
167
endtask
168
 
169
/////////////////////////////////////////////////////////////////////////
170
//
171
//Output buffers: using a bufif1 has the same effect as...
172
//
173
//      assign D = doe ? data_out : 32'hz;
174
//      
175
//It was coded this way to support SPECIFY delays in the specparam section.
176
//
177
/////////////////////////////////////////////////////////////////////////
178
 
179
bufif1 (D[0],data_out[0],doe);
180
bufif1 (D[1],data_out[1],doe);
181
bufif1 (D[2],data_out[2],doe);
182
bufif1 (D[3],data_out[3],doe);
183
bufif1 (D[4],data_out[4],doe);
184
bufif1 (D[5],data_out[5],doe);
185
bufif1 (D[6],data_out[6],doe);
186
bufif1 (D[7],data_out[7],doe);
187
bufif1 (DP[0], dp_out[0],doe);
188
 
189
bufif1 (D[8],data_out[8],doe);
190
bufif1 (D[9],data_out[9],doe);
191
bufif1 (D[10],data_out[10],doe);
192
bufif1 (D[11],data_out[11],doe);
193
bufif1 (D[12],data_out[12],doe);
194
bufif1 (D[13],data_out[13],doe);
195
bufif1 (D[14],data_out[14],doe);
196
bufif1 (D[15],data_out[15],doe);
197
bufif1 (DP[1], dp_out[1],doe);
198
 
199
assign doe = ~deselr & ~deselrr & ~oe_ & wr_b1_ & wr_b2_ ;
200
 
201
assign dsel = (ce_ | ~cs0 | cs1_);
202
 
203
always @(posedge clk)
204
begin
205
   if ( ~adsc_ || ( ~adsp_ && ~ce_ ))
206
     deselr <=  dsel;
207
end
208
 
209
always @(posedge clk)
210
begin
211
   deselrr <= deselr;
212
end
213
 
214
/////////////////////////////////////////////////////////////////////////
215
//
216
//write enable generation
217
//
218
/////////////////////////////////////////////////////////////////////////
219
 
220
always @(posedge clk)
221
begin
222
   if (  (~adsc_ & adsp_ & ~ce_ & cs0 & ~cs1_ & (~gw_ | ~bwe_ & ~bw1_))
223
       | (~deselr & adsc_ & (adsp_ | ce_) & (~gw_ | ~bwe_ & ~bw1_)))
224
      wr_b1_ <= 0;
225
   else wr_b1_ <= 1;
226
   if (  (~adsc_ & adsp_ & ~ce_ & cs0 & ~cs1_ & (~gw_ | ~bwe_ & ~bw2_))
227
       | (~deselr & adsc_ & (adsp_ | ce_) & (~gw_ | ~bwe_ & ~bw2_)))
228
      wr_b2_ <= 0;
229
   else wr_b2_ <= 1;
230
end
231
 
232
/////////////////////////////////////////////////////////////////////////
233
//
234
//input address register
235
//
236
/////////////////////////////////////////////////////////////////////////
237
 
238
always @(posedge clk)
239
begin
240
   if (  (~adsp_ & ~ce_ & cs0 & ~cs1_)
241
       | ( adsp_ & ~adsc_ & ~ce_ & cs0 & ~cs1_)) reg_addr[addr_msb:0] <= A[addr_msb:0];
242
end
243
 
244
/////////////////////////////////////////////////////////////////////////
245
//
246
// burst counter
247
//
248
/////////////////////////////////////////////////////////////////////////
249
 
250
always @(posedge clk)
251
begin
252
   if (lbo_ & (  (~adsp_ & ~ce_ & cs0 & ~cs1_)
253
               | ( adsp_ & ~adsc_ & ~ce_ & cs0 & ~cs1_))) brst_cnt <= 0;
254
   else if (~lbo_ & (  (~adsp_ & ~ce_ & cs0 & ~cs1_)
255
                     | ( adsp_ & ~adsc_ & ~ce_ & cs0 & ~cs1_))) brst_cnt <= A[1:0];
256
   else if ((adsp_ | ce_) & adsc_ & ~adv_) brst_cnt <= brst_cnt + 1;
257
end
258
 
259
//////////////////////////////////////////////////////////////////////////
260
//
261
//determine the memory address
262
//
263
//////////////////////////////////////////////////////////////////////////
264
 
265
assign baddr1 = lbo_ ? (brst_cnt[1] ^ reg_addr[1]) : brst_cnt[1];
266
assign baddr0 = lbo_ ? (brst_cnt[0] ^ reg_addr[0]) : brst_cnt[0];
267
 
268
assign #regdelay m_ad[addr_msb:0] = {reg_addr[addr_msb:2], baddr1, baddr0};
269
 
270
//////////////////////////////////////////////////////////////////////////
271
//
272
//data output register
273
//
274
//////////////////////////////////////////////////////////////////////////
275
 
276
always @(posedge clk)
277
begin
278
    dout[15:8]  <= memb2[m_ad];
279
    dpout[1]    <= memb2p[m_ad];
280
 
281
    dout[7:0]   <= memb1[m_ad];
282
    dpout[0]    <= memb1p[m_ad];
283
end
284
 
285
assign data_out = dout;
286
assign dp_out = dpout;
287
 
288
//////////////////////////////////////////////////////////////////////////
289
//
290
//data input register
291
//
292
//////////////////////////////////////////////////////////////////////////
293
 
294
always @(posedge clk)
295
begin
296
   din  <= #regdelay D;
297
   dpin <= #regdelay DP;
298
end
299
 
300
//////////////////////////////////////////////////////////////////////////
301
//
302
// write to ram
303
//
304
//////////////////////////////////////////////////////////////////////////
305
 
306
wire #1 wrb1 = ~wr_b1_ & ~clk;
307
wire #1 wrb2 = ~wr_b2_ & ~clk;
308
 
309
always @(clk)
310
begin
311
   if (wrb1) begin
312
      memb1[m_ad]  = din[7:0];
313
      memb1p[m_ad] = dpin[0];
314
   end
315
   if (wrb2) begin
316
      memb2[m_ad]  = din[15:8];
317
      memb2p[m_ad] = dpin[1];
318
   end
319
end
320
 
321
endmodule

powered by: WebSVN 2.1.0

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