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

Subversion Repositories or1200_soc

[/] [or1200_soc/] [trunk/] [boards/] [de1_board/] [sim/] [models/] [sram/] [IS61LV25616AL.v] - Blame information for rev 22

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 22 qaztronic
// IS61LV25616 Asynchronous SRAM, 256K x 16 = 4M; speed: 10ns.
2
// Note; 1) Please include "+define+ OEb" in running script if you want to check
3
//          timing in the case of OE_ being set.
4
//       2) Please specify access time by defining tAC_10 or tAC_12.
5
 
6
// `define OEb
7
`define tAC_10
8
`timescale 1ns/10ps
9
 
10
module IS61LV25616 (A, IO, CE_, OE_, WE_, LB_, UB_);
11
 
12
parameter dqbits = 16;
13
parameter memdepth = 262143;
14
parameter addbits = 18;
15
parameter Toha  = 2;
16
 
17
parameter Tsa   = 2;
18
 
19
`ifdef tAC_10
20
  parameter Taa   = 10,
21
            Thzce = 3,
22
            Thzwe = 5;
23
`endif
24
 
25
`ifdef tAC_12
26
  parameter Taa   = 12,
27
            Thzce = 5,
28
            Thzwe = 6;
29
`endif
30
 
31
input CE_, OE_, WE_, LB_, UB_;
32
input [(addbits - 1) : 0] A;
33
inout [(dqbits - 1) : 0] IO;
34
 
35
wire [(dqbits - 1) : 0] dout;
36
reg  [(dqbits/2 - 1) : 0] bank0 [0 : memdepth];
37
reg  [(dqbits/2 - 1) : 0] bank1 [0 : memdepth];
38
// wire [(dqbits - 1) : 0] memprobe = {bank1[A], bank0[A]};
39
 
40
wire r_en = WE_ & (~CE_) & (~OE_);
41
wire w_en = (~WE_) & (~CE_) & ((~LB_) | (~UB_));
42
assign #(r_en ? Taa : Thzce) IO = r_en ? dout : 16'bz;
43
 
44
initial
45
  $timeformat (-9, 0.1, " ns", 10);
46
 
47
assign dout [(dqbits/2 - 1) : 0]        = LB_ ? 8'bz : bank0[A];
48
assign dout [(dqbits - 1) : (dqbits/2)] = UB_ ? 8'bz : bank1[A];
49
 
50
always @(A or w_en)
51
  begin
52
    #Tsa
53
    if (w_en)
54
      #Thzwe
55
      begin
56
        bank0[A] = LB_ ? bank0[A] : IO [(dqbits/2 - 1) : 0];
57
        bank1[A] = UB_ ? bank1[A] : IO [(dqbits - 1)   : (dqbits/2)];
58
      end
59
  end
60
 
61
// Timing Check
62
`ifdef tAC_10
63
  specify
64
    specparam
65
      tSA   = 0,
66
      tAW   = 8,
67
      tSCE  = 8,
68
      tSD   = 6,
69
      tPWE2 = 10,
70
      tPWE1 = 8,
71
      tPBW  = 8;
72
`else
73
 
74
`ifdef tAC_10
75
  specify
76
    specparam
77
      tSA   = 0,
78
      tAW   = 8,
79
      tSCE  = 8,
80
      tSD   = 6,
81
      tPWE2 = 12,
82
      tPWE1 = 8,
83
      tPBW  = 8;
84
`endif
85
`endif
86
 
87
    $setup (A, negedge CE_, tSA);
88
//     $setup (A, posedge CE_, tAW);
89
//     $setup (IO, posedge CE_, tSD);
90
    $setup (A, negedge WE_, tSA);
91
//     $setup (IO, posedge WE_, tSD);
92
    $setup (A, negedge LB_, tSA);
93
    $setup (A, negedge UB_, tSA);
94
 
95
    $width (negedge CE_, tSCE);
96
    $width (negedge LB_, tPBW);
97
    $width (negedge UB_, tPBW);
98
    `ifdef OEb
99
    $width (negedge WE_, tPWE1);
100
    `else
101
    $width (negedge WE_, tPWE2);
102
    `endif
103
 
104
  endspecify
105
 
106
endmodule
107
 

powered by: WebSVN 2.1.0

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