1 |
3 |
dinesha |
// Author: Hugues CREUSY modified by Xue feng
|
2 |
|
|
// June 2004
|
3 |
|
|
// Verilog model
|
4 |
|
|
// project: M25P16 50 MHz,
|
5 |
|
|
// release: 1.2
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
// These Verilog HDL models are provided "as is" without warranty
|
10 |
|
|
// of any kind, included but not limited to, implied warranty
|
11 |
|
|
// of merchantability and fitness for a particular purpose.
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
`timescale 1ns/1ns
|
18 |
|
|
|
19 |
|
|
`define SIZE 4194304*4 // 16 Mbit
|
20 |
|
|
`define PLENGTH 256 // page length 256 bytes
|
21 |
|
|
`define SSIZE 524288 // Sector size 512 kbits
|
22 |
|
|
`define NB_BPI 3 // number of BPi bits
|
23 |
|
|
`define SIGNATURE 8'h14 // electronic signature 14h
|
24 |
|
|
`define manufacturerID 8'h20 // Manufacturer ID
|
25 |
|
|
`define memtype 8'h20 // memorytype
|
26 |
|
|
`define density 8'h15 // memory density 16mbits
|
27 |
|
|
`define BIT_TO_CODE_MEM 21 // number of bit to code a 16Mbits memory
|
28 |
|
|
`define LSB_TO_CODE_PAGE 8 // number of bit to code a PLENGTH page
|
29 |
|
|
|
30 |
|
|
`define NB_BIT_ADD_MEM 24
|
31 |
|
|
`define NB_BIT_ADD 8
|
32 |
|
|
`define NB_BIT_DATA 8
|
33 |
|
|
`define TOP_MEM (`SIZE/`NB_BIT_DATA)-1
|
34 |
|
|
|
35 |
|
|
`define MASK_SECTOR 24'hFF0000 // anded with address to find first sector adress to erase
|
36 |
|
|
|
37 |
|
|
`define TRUE 1'b1
|
38 |
|
|
`define FALSE 1'b0
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
`define TC 20 // Minimum Clock period
|
42 |
|
|
`define TR 50 // Minimum Clock period for read instruction
|
43 |
|
|
`define TSLCH 5 // notS active setup time (relative to C)
|
44 |
|
|
`define TCHSL 5 // notS not active hold time
|
45 |
|
|
`define TCH 9 // Clock high time
|
46 |
|
|
`define TCL 9 // Clock low time
|
47 |
|
|
`define TDVCH 2 // Data in Setup Time
|
48 |
|
|
`define TCHDX 5 // Data in Hold Time
|
49 |
|
|
`define TCHSH 5 // notS active hold time (relative to C)
|
50 |
|
|
`define TSHCH 5 // notS not active setup time (relative to C)
|
51 |
|
|
`define TSHSL 100 // /S deselect time
|
52 |
|
|
`define TSHQZ 8 // Output disable Time
|
53 |
|
|
`define TCLQV 8 // clock low to output valid
|
54 |
|
|
`define THLCH 5 // NotHold active setup time
|
55 |
|
|
`define TCHHH 5 // NotHold not active hold time
|
56 |
|
|
`define THHCH 5 // NotHold not active setup time
|
57 |
|
|
`define TCHHL 5 // NotHold active hold time
|
58 |
|
|
`define THHQX 8 // NotHold high to Output Low-Z
|
59 |
|
|
`define THLQZ 8 // NotHold low to Output High-Z
|
60 |
|
|
`define TWHSL 20 // Write protect setup time (SRWD=1)
|
61 |
|
|
`define TSHWL 100 // Write protect hold time (SRWD=1)
|
62 |
|
|
`define TDP 3000 // notS high to deep power down mode
|
63 |
|
|
`define TRES1 30000 // notS high to Stand-By power mode w-o ID Read
|
64 |
|
|
`define TRES2 30000 // notS high to Stand-By power mode with ID Read
|
65 |
|
|
`define TW 15000000 // write status register cycle time (15ms)
|
66 |
|
|
`define TPP 5000000 // page program cycle time (5ms)
|
67 |
|
|
`define TSE 3 // sector erase cycle time (3s)
|
68 |
|
|
`define TBE 40 // bulk erase cycle time (40s)
|
69 |
|
|
`define Tbase 1000000000 // time base for Bulk and Sector ERASE, delay function limited to signed 32bits values
|