1 /****************************************************************************
2 * Copyright 1991,1992,1993,1998,1999 Integrated Device Technology Corp.
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.
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.
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.
20 * File Name : idt71v416s10.v
21 * Function : 256Kx16-bit Asynchronous Static RAM
22 * Simulation Tool/Version : Verilog-XL 2.5
24 ***************************************************************************/
26 /*******************************************************************************
27 * Module Name: idt71v416s10
28 * Description: 256Kx16 10ns Asynchronous Static RAM
31 * Notes : This model is believed to be functionally
32 * accurate. Please direct any inquiries to
33 * IDT SRAM Applications at: sramhelp@idt.com
35 *******************************************************************************/
38 module idt71v416s10(data
, addr
, we_
, oe_
, cs_
, ble_
, bhe_
);
41 input we_
, oe_
, cs_
, bhe_
, ble_
;
43 //Read Cycle Parameters
44 parameter Taa
= 10; // address access time
45 parameter Tacs
= 10; // cs_ access time
46 parameter Tclz
= 4; // cs_ to output low Z time
47 parameter Tchz
= 5; // cs_ to output high Z time
48 parameter Toe
= 5; // oe_ to output time
49 parameter Tohz
= 5; // oe_ to output Z time
50 parameter Toh
= 4; // data hold from adr change time
51 parameter Tbe
= 5; // we_ to output valid time
53 //Write Cycle Parameters
54 parameter Taw
= 8; // adr valid to end of write time
55 parameter Tcw
= 8; // cs_ to end of write time
56 parameter Tbw
= 8; // ble_/bhe_ to end of write time
57 parameter Tas
= 0; // address set up time
58 parameter Twp
= 8; // write pulse width min
59 parameter Tdw
= 5; // data valid to end of writ time
60 parameter Tow
= 3; // data act from end of writ time
61 parameter Twhz
= 6; // we_ to output in high Z time
64 reg [7:0] mem1
[0:262143];
65 reg [7:0] mem2
[0:262143];
67 time adr_chng
,da_chng
,we_fall
,we_rise
,cs_fall
,cs_rise
;
68 time oe_fall
,oe_rise
,ble_fall
,ble_rise
,bhe_fall
,bhe_rise
;
72 reg [15:0] temp1
,temp2
,temp3
;
73 reg outen
, out_en
, in_en
;
78 /* Begin Tommy's hack. */
79 for (ii
= 0; ii
<= 262143; ii
= ii
+ 1) begin
83 /* End Tommy's hack. */
89 // input/output control logic
90 //---------------------------
91 assign data
= out_en ? data_out
: 'hzzzz
;
92 assign data_in
= in_en ? data
: 'hzzzz
;
95 // $display("%5d SRAM addr %x data_in %x data %x we_ %x bhe_ %x ble_ %x",
96 // $time, addr, data_in, data, we_, bhe_, ble_);
102 if (cs_
==0 & we_
==1) begin //read
105 #Taa data_out
[7:0] = mem1
[addr
];
106 else #Taa data_out
[7:0] = 'hzz
;
108 #Taa data_out
[15:8] = mem2
[addr
];
109 else #Taa data_out
[15:8] = 'hzz
;
119 //---------------------------------------------
120 if (cs_
==0 & we_
==1) //read
128 //---------------------------------------------
129 if (cs_
==0 & we_
==0) //write
138 #Tdw mem1
[addr
] = temp1
[7:0];
140 #Tdw mem2
[addr
] = temp1
[15:8];
150 #
(Tdw
-Toh
) mem1
[addr
] = temp1
[7:0];
152 #
(Tdw
-Toh
) mem2
[addr
] = temp1
[15:8];
157 data_out
[7:0] = mem1
[addr
];
158 else data_out
[7:0] = 'hzz
;
160 data_out
[15:8] = mem2
[addr
];
161 else data_out
[15:8] = 'hzz
;
165 always @(negedge cs_
)
169 if (cs_fall
- adr_chng
< Tas
)
170 $display($time, " Adr setup time is not enough Tas");
174 #Tclz out_en
= outen
;
179 #
(Tacs
-Tclz
) data_out
[7:0] = mem1
[addr
];
180 else #
(Tacs
-Tclz
) data_out
[7:0] = 'hzz
;
182 #
(Tacs
-Tclz
) data_out
[15:8] = mem2
[addr
];
183 else #
(Tacs
-Tclz
) data_out
[15:8] = 'hzz
;
194 #Tdw mem1
[addr
] = temp2
[7:0];
196 #Tdw mem2
[addr
] = temp2
[15:8];
201 always @(posedge cs_
)
207 if (cs_rise
- adr_chng
< Taw
)
213 $display($time, " Adr valid to end of write is not enough Taw");
216 if (cs_rise
- cs_fall
< Tcw
)
222 $display($time, " cs_ to end of write is not enough Tcw");
225 if (cs_rise
- da_chng
< Tdw
)
231 $display($time, " Data setup is not enough_1");
236 #Tchz out_en
= outen
;
240 always @(negedge oe_
)
245 data_out
[7:0] = mem1
[addr
];
246 else data_out
[7:0] = 'hzz
;
248 data_out
[15:8] = mem2
[addr
];
249 else data_out
[15:8] = 'hzz
;
256 always @(posedge oe_
)
261 #Tohz out_en
= outen
;
266 always @(negedge we_
)
270 if (we_fall
- adr_chng
< Tas
)
271 $display($time, " Address set-up to WE low is not enough");
276 #Twhz out_en
= outen
;
280 #Tdw mem1
[addr
] = temp3
[7:0];
282 #Tdw mem2
[addr
] = temp3
[15:8];
286 data_out
[7:0] = mem1
[addr
];
287 else data_out
[7:0] = 'hzz
;
289 data_out
[15:8] = mem2
[addr
];
290 else data_out
[15:8] = 'hzz
;
300 #Tdw mem1
[addr
] = temp3
[7:0];
302 #Tdw mem2
[addr
] = temp3
[15:8];
306 data_out
[7:0] = mem1
[addr
];
307 else data_out
[7:0] = 'hzz
;
309 data_out
[15:8] = mem2
[addr
];
310 else data_out
[15:8] = 'hzz
;
314 always @(posedge we_
)
320 if (we_rise
- da_chng
< Tdw
)
326 $display($time, " Data setup is not enough_2");
328 if (we_rise
- adr_chng
< Taw
)
334 $display($time, " Addr setup is not enough");
339 if (we_rise
- we_fall
< (Twhz
+Tdw
) )
345 $display($time, " WE pulse width needs to be Twhz+Tdw");
353 if (we_rise
- we_fall
< Twp
)
359 $display($time, " WE pulse width needs to be Twp");
364 always @(negedge ble_
)
368 if (ble_fall
- adr_chng
< Tas
)
369 $display($time, " Address set-up to BLE low is not enough");
377 #Tdw mem1
[addr
] = temp3
[7:0];
380 data_out
[7:0] = mem1
[addr
];
381 else data_out
[7:0] = 'hzz
;
383 data_out
[15:8] = mem2
[addr
];
384 else data_out
[15:8] = 'hzz
;
388 always @(negedge bhe_
)
392 if (bhe_fall
- adr_chng
< Tas
)
393 $display($time, " Address set-up to BHE low is not enough");
401 #Tdw mem2
[addr
] = temp3
[15:8];
404 data_out
[7:0] = mem1
[addr
];
405 else data_out
[7:0] = 'hzz
;
407 data_out
[15:8] = mem2
[addr
];
408 else data_out
[15:8] = 'hzz
;
412 always @(posedge ble_
)
419 if (ble_rise
- ble_fall
< Tbw
)
422 $display($time, " ble_ to end of write is not enough Tbw");
428 always @(posedge bhe_
)
435 if (bhe_rise
- bhe_fall
< Tbw
)
438 $display($time, " bhe_ to end of write is not enough Tbw");
452 #Tdw mem1
[addr
] = data_in
[7:0];
454 #Tdw mem2
[addr
] = data_in
[15:8];
458 data_out
[7:0] = mem1
[addr
];
459 else data_out
[7:0] = 'hzz
;
461 data_out
[15:8] = mem2
[addr
];
462 else data_out
[15:8] = 'hzz
;