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

Subversion Repositories mem_ctrl

[/] [mem_ctrl/] [trunk/] [bench/] [verilog/] [sram_models/] [IDT71T67802/] [idt71t67802s166.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                 : idt71t67802s166.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: idt71t67802s166
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  idt71t67802s166(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("   idt71t67802s166                                        \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
 
83
specify
84
specparam
85
 
86
//Clock Parameters
87
   tCYC  = 6.0,  //clock cycle time
88
   tCH   = 2.4,   //clock high time
89
   tCL   = 2.4,   //clock low time
90
//Output Parameters
91
   tCD   = 3.5,   //clk to data
92
   tCDC  = 1.5, //output hold from clock
93
   tCLZ  = 0,   //CLK to output Low-Z
94
   tCHZ  = 3.5,   //CLK to output Hi-Z
95
   tOE   = 3.5,   //OE to output valid
96
   tOLZ  = 0,   //OE to output Hi-Z
97
   tOHZ  = 3.5,   //OE to output Hi-Z
98
//Set up times   
99
   tSA   = 1.5, //address set-up
100
   tSS   = 1.5, //address status set-up
101
   tSD   = 1.5, //data set-up
102
   tSW   = 1.5, //write set-up
103
   tSAV  = 1.5, //address advance set-up
104
   tSC   = 1.5, //chip enable and chip select set-up
105
//Hold times
106
   tHA   = 0.5, //Address hold
107
   tHS   = 0.5, //address status hold
108
   tHD   = 0.5, //data hold
109
   tHW   = 0.5, //write hold
110
   tHAV  = 0.5, //address advance hold
111
   tHC   = 0.5; //chip enable and chip select hold
112
 
113
   (oe_ *> D) = (tOE,tOE,tOHZ,tOLZ,tOHZ,tOLZ); //(01,10,0z,z1,1z,z0)
114
   (clk *> D) = (tCD,tCD,tCHZ,tCLZ,tCHZ,tCLZ); //(01,10,0z,z1,1z,z0)
115
 
116
   (oe_ *> DP) = (tOE,tOE,tOHZ,tOLZ,tOHZ,tOLZ); //(01,10,0z,z1,1z,z0)
117
   (clk *> DP) = (tCD,tCD,tCHZ,tCLZ,tCHZ,tCLZ); //(01,10,0z,z1,1z,z0)
118
 
119
//timing checks
120
 
121
   $period(posedge clk, tCYC );
122
   $width (posedge clk, tCH );
123
   $width (negedge clk, tCL );
124
 
125
   $setuphold(posedge clk, adsp_, tSS, tHS);
126
   $setuphold(posedge clk, adsc_, tSS, tHS);
127
   $setuphold(posedge clk, adv_, tSAV, tHAV);
128
   $setuphold(posedge clk, gw_, tSW, tHW);
129
   $setuphold(posedge clk, bwe_, tSW, tHW);
130
   $setuphold(posedge clk, bw1_, tSW, tHW);
131
   $setuphold(posedge clk, bw2_, tSW, tHW);
132
   $setuphold(posedge clk, ce_, tSC, tHC);
133
   $setuphold(posedge clk, cs0, tSC, tHC);
134
   $setuphold(posedge clk, cs1_, tSC, tHC);
135
 
136
   $setuphold(posedge clk &&& check_addr, A, tSA, tHA);
137
   $setuphold(posedge clk &&& check_data, D, tSD, tHD);
138
   $setuphold(posedge clk &&& check_data, DP, tSD, tHD);
139
 
140
endspecify
141
 
142
//////////////memory array//////////////////////////////////////////////
143
 
144
reg [7:0] memb1[0:mem_top], memb2[0:mem_top];
145
 
146
reg memb1p[0:mem_top], memb2p[0:mem_top];
147
 
148
 
149
wire doe, baddr1, baddr0, dsel;
150
 
151
/////////////////////////////////////////////////////////////////////////
152
//
153
//Output buffers: using a bufif1 has the same effect as...
154
//
155
//      assign D = doe ? data_out : 32'hz;
156
//      
157
//It was coded this way to support SPECIFY delays in the specparam section.
158
//
159
/////////////////////////////////////////////////////////////////////////
160
 
161
bufif1 (D[0],data_out[0],doe);
162
bufif1 (D[1],data_out[1],doe);
163
bufif1 (D[2],data_out[2],doe);
164
bufif1 (D[3],data_out[3],doe);
165
bufif1 (D[4],data_out[4],doe);
166
bufif1 (D[5],data_out[5],doe);
167
bufif1 (D[6],data_out[6],doe);
168
bufif1 (D[7],data_out[7],doe);
169
bufif1 (DP[0], dp_out[0],doe);
170
 
171
bufif1 (D[8],data_out[8],doe);
172
bufif1 (D[9],data_out[9],doe);
173
bufif1 (D[10],data_out[10],doe);
174
bufif1 (D[11],data_out[11],doe);
175
bufif1 (D[12],data_out[12],doe);
176
bufif1 (D[13],data_out[13],doe);
177
bufif1 (D[14],data_out[14],doe);
178
bufif1 (D[15],data_out[15],doe);
179
bufif1 (DP[1], dp_out[1],doe);
180
 
181
assign doe = ~deselr & ~deselrr & ~oe_ & wr_b1_ & wr_b2_ ;
182
 
183
assign dsel = (ce_ | ~cs0 | cs1_);
184
 
185
always @(posedge clk)
186
begin
187
   if ( ~adsc_ || ( ~adsp_ && ~ce_ ))
188
     deselr <=  dsel;
189
end
190
 
191
always @(posedge clk)
192
begin
193
   deselrr <= deselr;
194
end
195
 
196
/////////////////////////////////////////////////////////////////////////
197
//
198
//write enable generation
199
//
200
/////////////////////////////////////////////////////////////////////////
201
 
202
always @(posedge clk)
203
begin
204
   if (  (~adsc_ & adsp_ & ~ce_ & cs0 & ~cs1_ & (~gw_ | ~bwe_ & ~bw1_))
205
       | (~deselr & adsc_ & (adsp_ | ce_) & (~gw_ | ~bwe_ & ~bw1_)))
206
      wr_b1_ <= 0;
207
   else wr_b1_ <= 1;
208
   if (  (~adsc_ & adsp_ & ~ce_ & cs0 & ~cs1_ & (~gw_ | ~bwe_ & ~bw2_))
209
       | (~deselr & adsc_ & (adsp_ | ce_) & (~gw_ | ~bwe_ & ~bw2_)))
210
      wr_b2_ <= 0;
211
   else wr_b2_ <= 1;
212
end
213
 
214
/////////////////////////////////////////////////////////////////////////
215
//
216
//input address register
217
//
218
/////////////////////////////////////////////////////////////////////////
219
 
220
always @(posedge clk)
221
begin
222
   if (  (~adsp_ & ~ce_ & cs0 & ~cs1_)
223
       | ( adsp_ & ~adsc_ & ~ce_ & cs0 & ~cs1_)) reg_addr[addr_msb:0] <= A[addr_msb:0];
224
end
225
 
226
/////////////////////////////////////////////////////////////////////////
227
//
228
// burst counter
229
//
230
/////////////////////////////////////////////////////////////////////////
231
 
232
always @(posedge clk)
233
begin
234
   if (lbo_ & (  (~adsp_ & ~ce_ & cs0 & ~cs1_)
235
               | ( adsp_ & ~adsc_ & ~ce_ & cs0 & ~cs1_))) brst_cnt <= 0;
236
   else if (~lbo_ & (  (~adsp_ & ~ce_ & cs0 & ~cs1_)
237
                     | ( adsp_ & ~adsc_ & ~ce_ & cs0 & ~cs1_))) brst_cnt <= A[1:0];
238
   else if ((adsp_ | ce_) & adsc_ & ~adv_) brst_cnt <= brst_cnt + 1;
239
end
240
 
241
//////////////////////////////////////////////////////////////////////////
242
//
243
//determine the memory address
244
//
245
//////////////////////////////////////////////////////////////////////////
246
 
247
assign baddr1 = lbo_ ? (brst_cnt[1] ^ reg_addr[1]) : brst_cnt[1];
248
assign baddr0 = lbo_ ? (brst_cnt[0] ^ reg_addr[0]) : brst_cnt[0];
249
 
250
assign #regdelay m_ad[addr_msb:0] = {reg_addr[addr_msb:2], baddr1, baddr0};
251
 
252
//////////////////////////////////////////////////////////////////////////
253
//
254
//data output register
255
//
256
//////////////////////////////////////////////////////////////////////////
257
 
258
always @(posedge clk)
259
begin
260
    dout[15:8]  <= memb2[m_ad];
261
    dpout[1]   <= memb2p[m_ad];
262
 
263
    dout[7:0]   <= memb1[m_ad];
264
    dpout[0]   <= memb1p[m_ad];
265
end
266
 
267
assign data_out = dout;
268
assign dp_out = dpout;
269
 
270
//////////////////////////////////////////////////////////////////////////
271
//
272
//data input register
273
//
274
//////////////////////////////////////////////////////////////////////////
275
 
276
always @(posedge clk)
277
begin
278
   din <= #regdelay D;
279
   dpin <= #regdelay DP;
280
end
281
 
282
//////////////////////////////////////////////////////////////////////////
283
//
284
// write to ram
285
//
286
//////////////////////////////////////////////////////////////////////////
287
 
288
wire #1 wrb1 = ~wr_b1_ & ~clk;
289
wire #1 wrb2 = ~wr_b2_ & ~clk;
290
 
291
always @(clk)
292
begin
293
   if (wrb1) begin
294
      memb1[m_ad] = din[7:0];
295
      memb1p[m_ad] = dpin[0];
296
   end
297
   if (wrb2) begin
298
      memb2[m_ad] = din[15:8];
299
      memb2p[m_ad] = dpin[1];
300
   end
301
end
302
 
303
endmodule

powered by: WebSVN 2.1.0

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