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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [mp3/] [lib/] [xilinx/] [unisims/] [RAMB16_S2.v] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 266 lampret
// $Header: /home/marcus/revision_ctrl_test/oc_cvs/cvs/or1k/mp3/lib/xilinx/unisims/RAMB16_S2.v,v 1.1.1.1 2001-11-04 18:59:53 lampret Exp $
2
 
3
/*
4
 
5
FUNCTION        : 16x2 Block RAM with synchronous write capability
6
 
7
*/
8
 
9
`timescale  100 ps / 10 ps
10
 
11
`celldefine
12
 
13
module RAMB16_S2 (DO, ADDR, DI, EN, CLK, WE, SSR);
14
 
15
    parameter cds_action = "ignore";
16
    parameter INIT = 2'h0;
17
    parameter SRVAL = 2'h0;
18
    parameter WRITE_MODE = "WRITE_FIRST";
19
 
20
    parameter INIT_00 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
21
    parameter INIT_01 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
22
    parameter INIT_02 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
23
    parameter INIT_03 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
24
    parameter INIT_04 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
25
    parameter INIT_05 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
26
    parameter INIT_06 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
27
    parameter INIT_07 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
28
    parameter INIT_08 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
29
    parameter INIT_09 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
30
    parameter INIT_0A = 256'h0000000000000000000000000000000000000000000000000000000000000000;
31
    parameter INIT_0B = 256'h0000000000000000000000000000000000000000000000000000000000000000;
32
    parameter INIT_0C = 256'h0000000000000000000000000000000000000000000000000000000000000000;
33
    parameter INIT_0D = 256'h0000000000000000000000000000000000000000000000000000000000000000;
34
    parameter INIT_0E = 256'h0000000000000000000000000000000000000000000000000000000000000000;
35
    parameter INIT_0F = 256'h0000000000000000000000000000000000000000000000000000000000000000;
36
    parameter INIT_10 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
37
    parameter INIT_11 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
38
    parameter INIT_12 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
39
    parameter INIT_13 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
40
    parameter INIT_14 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
41
    parameter INIT_15 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
42
    parameter INIT_16 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
43
    parameter INIT_17 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
44
    parameter INIT_18 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
45
    parameter INIT_19 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
46
    parameter INIT_1A = 256'h0000000000000000000000000000000000000000000000000000000000000000;
47
    parameter INIT_1B = 256'h0000000000000000000000000000000000000000000000000000000000000000;
48
    parameter INIT_1C = 256'h0000000000000000000000000000000000000000000000000000000000000000;
49
    parameter INIT_1D = 256'h0000000000000000000000000000000000000000000000000000000000000000;
50
    parameter INIT_1E = 256'h0000000000000000000000000000000000000000000000000000000000000000;
51
    parameter INIT_1F = 256'h0000000000000000000000000000000000000000000000000000000000000000;
52
    parameter INIT_20 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
53
    parameter INIT_21 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
54
    parameter INIT_22 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
55
    parameter INIT_23 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
56
    parameter INIT_24 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
57
    parameter INIT_25 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
58
    parameter INIT_26 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
59
    parameter INIT_27 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
60
    parameter INIT_28 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
61
    parameter INIT_29 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
62
    parameter INIT_2A = 256'h0000000000000000000000000000000000000000000000000000000000000000;
63
    parameter INIT_2B = 256'h0000000000000000000000000000000000000000000000000000000000000000;
64
    parameter INIT_2C = 256'h0000000000000000000000000000000000000000000000000000000000000000;
65
    parameter INIT_2D = 256'h0000000000000000000000000000000000000000000000000000000000000000;
66
    parameter INIT_2E = 256'h0000000000000000000000000000000000000000000000000000000000000000;
67
    parameter INIT_2F = 256'h0000000000000000000000000000000000000000000000000000000000000000;
68
    parameter INIT_30 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
69
    parameter INIT_31 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
70
    parameter INIT_32 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
71
    parameter INIT_33 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
72
    parameter INIT_34 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
73
    parameter INIT_35 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
74
    parameter INIT_36 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
75
    parameter INIT_37 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
76
    parameter INIT_38 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
77
    parameter INIT_39 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
78
    parameter INIT_3A = 256'h0000000000000000000000000000000000000000000000000000000000000000;
79
    parameter INIT_3B = 256'h0000000000000000000000000000000000000000000000000000000000000000;
80
    parameter INIT_3C = 256'h0000000000000000000000000000000000000000000000000000000000000000;
81
    parameter INIT_3D = 256'h0000000000000000000000000000000000000000000000000000000000000000;
82
    parameter INIT_3E = 256'h0000000000000000000000000000000000000000000000000000000000000000;
83
    parameter INIT_3F = 256'h0000000000000000000000000000000000000000000000000000000000000000;
84
 
85
    output [1:0] DO;
86
    reg do0_out, do1_out;
87
 
88
    input [12:0] ADDR;
89
    input [1:0] DI;
90
    input EN, CLK, WE, SSR;
91
 
92
    reg [18431:0] mem;
93
    reg [8:0] count;
94
    reg [1:0] wr_mode;
95
 
96
    wire [12:0] addr_int;
97
    wire [1:0] di_int;
98
    wire en_int, clk_int, we_int, ssr_int;
99
 
100
    tri0 GSR = glbl.GSR;
101
 
102
    always @(GSR)
103
        if (GSR) begin
104
            assign do0_out = INIT[0];
105
            assign do1_out = INIT[1];
106
        end
107
        else begin
108
            deassign do0_out;
109
            deassign do1_out;
110
        end
111
 
112
    buf b_do_out0 (DO[0], do0_out);
113
    buf b_do_out1 (DO[1], do1_out);
114
    buf b_addr_0 (addr_int[0], ADDR[0]);
115
    buf b_addr_1 (addr_int[1], ADDR[1]);
116
    buf b_addr_2 (addr_int[2], ADDR[2]);
117
    buf b_addr_3 (addr_int[3], ADDR[3]);
118
    buf b_addr_4 (addr_int[4], ADDR[4]);
119
    buf b_addr_5 (addr_int[5], ADDR[5]);
120
    buf b_addr_6 (addr_int[6], ADDR[6]);
121
    buf b_addr_7 (addr_int[7], ADDR[7]);
122
    buf b_addr_8 (addr_int[8], ADDR[8]);
123
    buf b_addr_9 (addr_int[9], ADDR[9]);
124
    buf b_addr_10 (addr_int[10], ADDR[10]);
125
    buf b_addr_11 (addr_int[11], ADDR[11]);
126
    buf b_addr_12 (addr_int[12], ADDR[12]);
127
    buf b_di_0 (di_int[0], DI[0]);
128
    buf b_di_1 (di_int[1], DI[1]);
129
    buf b_en (en_int, EN);
130
    buf b_clk (clk_int, CLK);
131
    buf b_we (we_int, WE);
132
    buf b_ssr (ssr_int, SSR);
133
 
134
    initial begin
135
        for (count = 0; count < 256; count = count + 1) begin
136
            mem[count]            <= INIT_00[count];
137
            mem[256 * 1 + count]  <= INIT_01[count];
138
            mem[256 * 2 + count]  <= INIT_02[count];
139
            mem[256 * 3 + count]  <= INIT_03[count];
140
            mem[256 * 4 + count]  <= INIT_04[count];
141
            mem[256 * 5 + count]  <= INIT_05[count];
142
            mem[256 * 6 + count]  <= INIT_06[count];
143
            mem[256 * 7 + count]  <= INIT_07[count];
144
            mem[256 * 8 + count]  <= INIT_08[count];
145
            mem[256 * 9 + count]  <= INIT_09[count];
146
            mem[256 * 10 + count] <= INIT_0A[count];
147
            mem[256 * 11 + count] <= INIT_0B[count];
148
            mem[256 * 12 + count] <= INIT_0C[count];
149
            mem[256 * 13 + count] <= INIT_0D[count];
150
            mem[256 * 14 + count] <= INIT_0E[count];
151
            mem[256 * 15 + count] <= INIT_0F[count];
152
            mem[256 * 16 + count] <= INIT_10[count];
153
            mem[256 * 17 + count] <= INIT_11[count];
154
            mem[256 * 18 + count] <= INIT_12[count];
155
            mem[256 * 19 + count] <= INIT_13[count];
156
            mem[256 * 20 + count] <= INIT_14[count];
157
            mem[256 * 21 + count] <= INIT_15[count];
158
            mem[256 * 22 + count] <= INIT_16[count];
159
            mem[256 * 23 + count] <= INIT_17[count];
160
            mem[256 * 24 + count] <= INIT_18[count];
161
            mem[256 * 25 + count] <= INIT_19[count];
162
            mem[256 * 26 + count] <= INIT_1A[count];
163
            mem[256 * 27 + count] <= INIT_1B[count];
164
            mem[256 * 28 + count] <= INIT_1C[count];
165
            mem[256 * 29 + count] <= INIT_1D[count];
166
            mem[256 * 30 + count] <= INIT_1E[count];
167
            mem[256 * 31 + count] <= INIT_1F[count];
168
            mem[256 * 32 + count] <= INIT_20[count];
169
            mem[256 * 33 + count] <= INIT_21[count];
170
            mem[256 * 34 + count] <= INIT_22[count];
171
            mem[256 * 35 + count] <= INIT_23[count];
172
            mem[256 * 36 + count] <= INIT_24[count];
173
            mem[256 * 37 + count] <= INIT_25[count];
174
            mem[256 * 38 + count] <= INIT_26[count];
175
            mem[256 * 39 + count] <= INIT_27[count];
176
            mem[256 * 40 + count] <= INIT_28[count];
177
            mem[256 * 41 + count] <= INIT_29[count];
178
            mem[256 * 42 + count] <= INIT_2A[count];
179
            mem[256 * 43 + count] <= INIT_2B[count];
180
            mem[256 * 44 + count] <= INIT_2C[count];
181
            mem[256 * 45 + count] <= INIT_2D[count];
182
            mem[256 * 46 + count] <= INIT_2E[count];
183
            mem[256 * 47 + count] <= INIT_2F[count];
184
            mem[256 * 48 + count] <= INIT_30[count];
185
            mem[256 * 49 + count] <= INIT_31[count];
186
            mem[256 * 50 + count] <= INIT_32[count];
187
            mem[256 * 51 + count] <= INIT_33[count];
188
            mem[256 * 52 + count] <= INIT_34[count];
189
            mem[256 * 53 + count] <= INIT_35[count];
190
            mem[256 * 54 + count] <= INIT_36[count];
191
            mem[256 * 55 + count] <= INIT_37[count];
192
            mem[256 * 56 + count] <= INIT_38[count];
193
            mem[256 * 57 + count] <= INIT_39[count];
194
            mem[256 * 58 + count] <= INIT_3A[count];
195
            mem[256 * 59 + count] <= INIT_3B[count];
196
            mem[256 * 60 + count] <= INIT_3C[count];
197
            mem[256 * 61 + count] <= INIT_3D[count];
198
            mem[256 * 62 + count] <= INIT_3E[count];
199
            mem[256 * 63 + count] <= INIT_3F[count];
200
        end
201
    end
202
 
203
    initial begin
204
        case (WRITE_MODE)
205
            "WRITE_FIRST" : wr_mode <= 2'b00;
206
            "READ_FIRST"  : wr_mode <= 2'b01;
207
            "NO_CHANGE"   : wr_mode <= 2'b10;
208
            default       : begin
209
                                $display("Error : WRITE_MODE = %s is not WRITE_FIRST, READ_FIRST or NO_CHANGE.", WRITE_MODE);
210
                                $finish;
211
                            end
212
        endcase
213
    end
214
 
215
    always @(posedge clk_int) begin
216
        if (en_int == 1'b1) begin
217
            if (ssr_int == 1'b1) begin
218
                do0_out <= SRVAL[0];
219
                do1_out <= SRVAL[1];
220
            end
221
            else begin
222
                if (we_int == 1'b1) begin
223
                    if (wr_mode == 2'b00) begin
224
                        do0_out <= di_int[0];
225
                        do1_out <= di_int[1];
226
                    end
227
                    else if (wr_mode == 2'b01) begin
228
                        do0_out <= mem[addr_int * 2 + 0];
229
                        do1_out <= mem[addr_int * 2 + 1];
230
                    end
231
                    else begin
232
                        do0_out <= do0_out;
233
                        do1_out <= do1_out;
234
                    end
235
                end
236
                else begin
237
                    do0_out <= mem[addr_int * 2 + 0];
238
                    do1_out <= mem[addr_int * 2 + 1];
239
                end
240
            end
241
        end
242
    end
243
 
244
    always @(posedge clk_int) begin
245
        if (en_int == 1'b1 && we_int == 1'b1) begin
246
            mem[addr_int * 2 + 0] <= di_int[0];
247
            mem[addr_int * 2 + 1] <= di_int[1];
248
        end
249
    end
250
 
251
    specify
252
        (CLK *> DO) = (1, 1);
253
    endspecify
254
 
255
endmodule
256
 
257
`endcelldefine

powered by: WebSVN 2.1.0

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