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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [mp3/] [lib/] [xilinx/] [unisims/] [RAMB16_S18_S18.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_S18_S18.v,v 1.1.1.1 2001-11-04 18:59:51 lampret Exp $
2
 
3
/*
4
 
5
FUNCTION        : 16x18x18 Block RAM with synchronous write capability
6
 
7
*/
8
 
9
`timescale  100 ps / 10 ps
10
 
11
`celldefine
12
 
13
module RAMB16_S18_S18 (DOA, DOPA, DOB, DOPB, ADDRA, CLKA, DIA, DIPA, ENA, SSRA, WEA, ADDRB, CLKB, DIB, DIPB, ENB, SSRB, WEB);
14
    parameter cds_action = "ignore";
15
    parameter INIT_A = 18'h0;
16
    parameter INIT_B = 18'h0;
17
    parameter SRVAL_A = 18'h0;
18
    parameter SRVAL_B = 18'h0;
19
    parameter WRITE_MODE_A = "WRITE_FIRST";
20
    parameter WRITE_MODE_B = "WRITE_FIRST";
21
 
22
    parameter INIT_00 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
23
    parameter INIT_01 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
24
    parameter INIT_02 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
25
    parameter INIT_03 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
26
    parameter INIT_04 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
27
    parameter INIT_05 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
28
    parameter INIT_06 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
29
    parameter INIT_07 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
30
    parameter INIT_08 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
31
    parameter INIT_09 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
32
    parameter INIT_0A = 256'h0000000000000000000000000000000000000000000000000000000000000000;
33
    parameter INIT_0B = 256'h0000000000000000000000000000000000000000000000000000000000000000;
34
    parameter INIT_0C = 256'h0000000000000000000000000000000000000000000000000000000000000000;
35
    parameter INIT_0D = 256'h0000000000000000000000000000000000000000000000000000000000000000;
36
    parameter INIT_0E = 256'h0000000000000000000000000000000000000000000000000000000000000000;
37
    parameter INIT_0F = 256'h0000000000000000000000000000000000000000000000000000000000000000;
38
    parameter INIT_10 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
39
    parameter INIT_11 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
40
    parameter INIT_12 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
41
    parameter INIT_13 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
42
    parameter INIT_14 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
43
    parameter INIT_15 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
44
    parameter INIT_16 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
45
    parameter INIT_17 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
46
    parameter INIT_18 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
47
    parameter INIT_19 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
48
    parameter INIT_1A = 256'h0000000000000000000000000000000000000000000000000000000000000000;
49
    parameter INIT_1B = 256'h0000000000000000000000000000000000000000000000000000000000000000;
50
    parameter INIT_1C = 256'h0000000000000000000000000000000000000000000000000000000000000000;
51
    parameter INIT_1D = 256'h0000000000000000000000000000000000000000000000000000000000000000;
52
    parameter INIT_1E = 256'h0000000000000000000000000000000000000000000000000000000000000000;
53
    parameter INIT_1F = 256'h0000000000000000000000000000000000000000000000000000000000000000;
54
    parameter INIT_20 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
55
    parameter INIT_21 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
56
    parameter INIT_22 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
57
    parameter INIT_23 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
58
    parameter INIT_24 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
59
    parameter INIT_25 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
60
    parameter INIT_26 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
61
    parameter INIT_27 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
62
    parameter INIT_28 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
63
    parameter INIT_29 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
64
    parameter INIT_2A = 256'h0000000000000000000000000000000000000000000000000000000000000000;
65
    parameter INIT_2B = 256'h0000000000000000000000000000000000000000000000000000000000000000;
66
    parameter INIT_2C = 256'h0000000000000000000000000000000000000000000000000000000000000000;
67
    parameter INIT_2D = 256'h0000000000000000000000000000000000000000000000000000000000000000;
68
    parameter INIT_2E = 256'h0000000000000000000000000000000000000000000000000000000000000000;
69
    parameter INIT_2F = 256'h0000000000000000000000000000000000000000000000000000000000000000;
70
    parameter INIT_30 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
71
    parameter INIT_31 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
72
    parameter INIT_32 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
73
    parameter INIT_33 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
74
    parameter INIT_34 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
75
    parameter INIT_35 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
76
    parameter INIT_36 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
77
    parameter INIT_37 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
78
    parameter INIT_38 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
79
    parameter INIT_39 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
80
    parameter INIT_3A = 256'h0000000000000000000000000000000000000000000000000000000000000000;
81
    parameter INIT_3B = 256'h0000000000000000000000000000000000000000000000000000000000000000;
82
    parameter INIT_3C = 256'h0000000000000000000000000000000000000000000000000000000000000000;
83
    parameter INIT_3D = 256'h0000000000000000000000000000000000000000000000000000000000000000;
84
    parameter INIT_3E = 256'h0000000000000000000000000000000000000000000000000000000000000000;
85
    parameter INIT_3F = 256'h0000000000000000000000000000000000000000000000000000000000000000;
86
    parameter INITP_00 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
87
    parameter INITP_01 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
88
    parameter INITP_02 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
89
    parameter INITP_03 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
90
    parameter INITP_04 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
91
    parameter INITP_05 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
92
    parameter INITP_06 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
93
    parameter INITP_07 = 256'h0000000000000000000000000000000000000000000000000000000000000000;
94
 
95
    output [15:0] DOA;
96
    output [1:0] DOPA;
97
    reg [15:0] doa_out;
98
    reg [1:0] dopa_out;
99
    wire doa_out0, doa_out1, doa_out2, doa_out3, doa_out4, doa_out5, doa_out6, doa_out7, doa_out8, doa_out9, doa_out10, doa_out11, doa_out12, doa_out13, doa_out14, doa_out15;
100
    wire dopa0_out, dopa1_out;
101
 
102
    input [9:0] ADDRA;
103
    input [15:0] DIA;
104
    input [1:0] DIPA;
105
    input ENA, CLKA, WEA, SSRA;
106
 
107
    output [15:0] DOB;
108
    output [1:0] DOPB;
109
    reg [15:0] dob_out;
110
    reg [1:0] dopb_out;
111
    wire dob_out0, dob_out1, dob_out2, dob_out3, dob_out4, dob_out5, dob_out6, dob_out7, dob_out8, dob_out9, dob_out10, dob_out11, dob_out12, dob_out13, dob_out14, dob_out15;
112
    wire dopb0_out, dopb1_out;
113
 
114
    input [9:0] ADDRB;
115
    input [15:0] DIB;
116
    input [1:0] DIPB;
117
    input ENB, CLKB, WEB, SSRB;
118
 
119
    reg [18431:0] mem;
120
    reg [8:0] count;
121
    reg [1:0] wr_mode_a, wr_mode_b;
122
 
123
    reg [5:0] ci, cj;
124
    reg [5:0] dmi, dmj, dni, dnj, doi, doj, dai, daj, dbi, dbj, dci, dcj, ddi, ddj;
125
    reg [5:0] pmi, pmj, pni, pnj, poi, poj, pai, paj, pbi, pbj, pci, pcj, pdi, pdj;
126
 
127
    wire [9:0] addra_int;
128
    wire [15:0] dia_int;
129
    wire [1:0] dipa_int;
130
    wire ena_int, clka_int, wea_int, ssra_int;
131
    wire [9:0] addrb_int;
132
    wire [15:0] dib_int;
133
    wire [1:0] dipb_int;
134
    wire enb_int, clkb_int, web_int, ssrb_int;
135
 
136
    reg recovery_a, recovery_b;
137
    reg address_collision;
138
 
139
    wire clka_enable = ena_int && wea_int && enb_int && address_collision;
140
    wire clkb_enable = enb_int && web_int && ena_int && address_collision;
141
    wire collision = clka_enable || clkb_enable;
142
 
143
    tri0 GSR = glbl.GSR;
144
 
145
    always @(GSR)
146
        if (GSR) begin
147
            assign doa_out = INIT_A[15:0];
148
            assign dopa_out = INIT_A[17:16];
149
            assign dob_out = INIT_B[15:0];
150
            assign dopb_out = INIT_B[17:16];
151
        end
152
        else begin
153
            deassign doa_out;
154
            deassign dopa_out;
155
            deassign dob_out;
156
            deassign dopb_out;
157
        end
158
 
159
    buf b_doa_out0 (doa_out0, doa_out[0]);
160
    buf b_doa_out1 (doa_out1, doa_out[1]);
161
    buf b_doa_out2 (doa_out2, doa_out[2]);
162
    buf b_doa_out3 (doa_out3, doa_out[3]);
163
    buf b_doa_out4 (doa_out4, doa_out[4]);
164
    buf b_doa_out5 (doa_out5, doa_out[5]);
165
    buf b_doa_out6 (doa_out6, doa_out[6]);
166
    buf b_doa_out7 (doa_out7, doa_out[7]);
167
    buf b_doa_out8 (doa_out8, doa_out[8]);
168
    buf b_doa_out9 (doa_out9, doa_out[9]);
169
    buf b_doa_out10 (doa_out10, doa_out[10]);
170
    buf b_doa_out11 (doa_out11, doa_out[11]);
171
    buf b_doa_out12 (doa_out12, doa_out[12]);
172
    buf b_doa_out13 (doa_out13, doa_out[13]);
173
    buf b_doa_out14 (doa_out14, doa_out[14]);
174
    buf b_doa_out15 (doa_out15, doa_out[15]);
175
    buf b_dopa_out0 (dopa_out0, dopa_out[0]);
176
    buf b_dopa_out1 (dopa_out1, dopa_out[1]);
177
    buf b_dob_out0 (dob_out0, dob_out[0]);
178
    buf b_dob_out1 (dob_out1, dob_out[1]);
179
    buf b_dob_out2 (dob_out2, dob_out[2]);
180
    buf b_dob_out3 (dob_out3, dob_out[3]);
181
    buf b_dob_out4 (dob_out4, dob_out[4]);
182
    buf b_dob_out5 (dob_out5, dob_out[5]);
183
    buf b_dob_out6 (dob_out6, dob_out[6]);
184
    buf b_dob_out7 (dob_out7, dob_out[7]);
185
    buf b_dob_out8 (dob_out8, dob_out[8]);
186
    buf b_dob_out9 (dob_out9, dob_out[9]);
187
    buf b_dob_out10 (dob_out10, dob_out[10]);
188
    buf b_dob_out11 (dob_out11, dob_out[11]);
189
    buf b_dob_out12 (dob_out12, dob_out[12]);
190
    buf b_dob_out13 (dob_out13, dob_out[13]);
191
    buf b_dob_out14 (dob_out14, dob_out[14]);
192
    buf b_dob_out15 (dob_out15, dob_out[15]);
193
    buf b_dopb_out0 (dopb_out0, dopb_out[0]);
194
    buf b_dopb_out1 (dopb_out1, dopb_out[1]);
195
 
196
    buf b_doa0 (DOA[0], doa_out0);
197
    buf b_doa1 (DOA[1], doa_out1);
198
    buf b_doa2 (DOA[2], doa_out2);
199
    buf b_doa3 (DOA[3], doa_out3);
200
    buf b_doa4 (DOA[4], doa_out4);
201
    buf b_doa5 (DOA[5], doa_out5);
202
    buf b_doa6 (DOA[6], doa_out6);
203
    buf b_doa7 (DOA[7], doa_out7);
204
    buf b_doa8 (DOA[8], doa_out8);
205
    buf b_doa9 (DOA[9], doa_out9);
206
    buf b_doa10 (DOA[10], doa_out10);
207
    buf b_doa11 (DOA[11], doa_out11);
208
    buf b_doa12 (DOA[12], doa_out12);
209
    buf b_doa13 (DOA[13], doa_out13);
210
    buf b_doa14 (DOA[14], doa_out14);
211
    buf b_doa15 (DOA[15], doa_out15);
212
    buf b_dopa0 (DOPA[0], dopa_out0);
213
    buf b_dopa1 (DOPA[1], dopa_out1);
214
    buf b_dob0 (DOB[0], dob_out0);
215
    buf b_dob1 (DOB[1], dob_out1);
216
    buf b_dob2 (DOB[2], dob_out2);
217
    buf b_dob3 (DOB[3], dob_out3);
218
    buf b_dob4 (DOB[4], dob_out4);
219
    buf b_dob5 (DOB[5], dob_out5);
220
    buf b_dob6 (DOB[6], dob_out6);
221
    buf b_dob7 (DOB[7], dob_out7);
222
    buf b_dob8 (DOB[8], dob_out8);
223
    buf b_dob9 (DOB[9], dob_out9);
224
    buf b_dob10 (DOB[10], dob_out10);
225
    buf b_dob11 (DOB[11], dob_out11);
226
    buf b_dob12 (DOB[12], dob_out12);
227
    buf b_dob13 (DOB[13], dob_out13);
228
    buf b_dob14 (DOB[14], dob_out14);
229
    buf b_dob15 (DOB[15], dob_out15);
230
    buf b_dopb0 (DOPB[0], dopb_out0);
231
    buf b_dopb1 (DOPB[1], dopb_out1);
232
 
233
    buf b_addra_0 (addra_int[0], ADDRA[0]);
234
    buf b_addra_1 (addra_int[1], ADDRA[1]);
235
    buf b_addra_2 (addra_int[2], ADDRA[2]);
236
    buf b_addra_3 (addra_int[3], ADDRA[3]);
237
    buf b_addra_4 (addra_int[4], ADDRA[4]);
238
    buf b_addra_5 (addra_int[5], ADDRA[5]);
239
    buf b_addra_6 (addra_int[6], ADDRA[6]);
240
    buf b_addra_7 (addra_int[7], ADDRA[7]);
241
    buf b_addra_8 (addra_int[8], ADDRA[8]);
242
    buf b_addra_9 (addra_int[9], ADDRA[9]);
243
    buf b_dia_0 (dia_int[0], DIA[0]);
244
    buf b_dia_1 (dia_int[1], DIA[1]);
245
    buf b_dia_2 (dia_int[2], DIA[2]);
246
    buf b_dia_3 (dia_int[3], DIA[3]);
247
    buf b_dia_4 (dia_int[4], DIA[4]);
248
    buf b_dia_5 (dia_int[5], DIA[5]);
249
    buf b_dia_6 (dia_int[6], DIA[6]);
250
    buf b_dia_7 (dia_int[7], DIA[7]);
251
    buf b_dia_8 (dia_int[8], DIA[8]);
252
    buf b_dia_9 (dia_int[9], DIA[9]);
253
    buf b_dia_10 (dia_int[10], DIA[10]);
254
    buf b_dia_11 (dia_int[11], DIA[11]);
255
    buf b_dia_12 (dia_int[12], DIA[12]);
256
    buf b_dia_13 (dia_int[13], DIA[13]);
257
    buf b_dia_14 (dia_int[14], DIA[14]);
258
    buf b_dia_15 (dia_int[15], DIA[15]);
259
    buf b_dipa_0 (dipa_int[0], DIPA[0]);
260
    buf b_dipa_1 (dipa_int[1], DIPA[1]);
261
    buf b_ena (ena_int, ENA);
262
    buf b_clka (clka_int, CLKA);
263
    buf b_ssra (ssra_int, SSRA);
264
    buf b_wea (wea_int, WEA);
265
    buf b_addrb_0 (addrb_int[0], ADDRB[0]);
266
    buf b_addrb_1 (addrb_int[1], ADDRB[1]);
267
    buf b_addrb_2 (addrb_int[2], ADDRB[2]);
268
    buf b_addrb_3 (addrb_int[3], ADDRB[3]);
269
    buf b_addrb_4 (addrb_int[4], ADDRB[4]);
270
    buf b_addrb_5 (addrb_int[5], ADDRB[5]);
271
    buf b_addrb_6 (addrb_int[6], ADDRB[6]);
272
    buf b_addrb_7 (addrb_int[7], ADDRB[7]);
273
    buf b_addrb_8 (addrb_int[8], ADDRB[8]);
274
    buf b_addrb_9 (addrb_int[9], ADDRB[9]);
275
    buf b_dib_0 (dib_int[0], DIB[0]);
276
    buf b_dib_1 (dib_int[1], DIB[1]);
277
    buf b_dib_2 (dib_int[2], DIB[2]);
278
    buf b_dib_3 (dib_int[3], DIB[3]);
279
    buf b_dib_4 (dib_int[4], DIB[4]);
280
    buf b_dib_5 (dib_int[5], DIB[5]);
281
    buf b_dib_6 (dib_int[6], DIB[6]);
282
    buf b_dib_7 (dib_int[7], DIB[7]);
283
    buf b_dib_8 (dib_int[8], DIB[8]);
284
    buf b_dib_9 (dib_int[9], DIB[9]);
285
    buf b_dib_10 (dib_int[10], DIB[10]);
286
    buf b_dib_11 (dib_int[11], DIB[11]);
287
    buf b_dib_12 (dib_int[12], DIB[12]);
288
    buf b_dib_13 (dib_int[13], DIB[13]);
289
    buf b_dib_14 (dib_int[14], DIB[14]);
290
    buf b_dib_15 (dib_int[15], DIB[15]);
291
    buf b_dipb_0 (dipb_int[0], DIPB[0]);
292
    buf b_dipb_1 (dipb_int[1], DIPB[1]);
293
    buf b_enb (enb_int, ENB);
294
    buf b_clkb (clkb_int, CLKB);
295
    buf b_ssrb (ssrb_int, SSRB);
296
    buf b_web (web_int, WEB);
297
 
298
    initial begin
299
        for (count = 0; count < 256; count = count + 1) begin
300
            mem[count]            <= INIT_00[count];
301
            mem[256 * 1 + count]  <= INIT_01[count];
302
            mem[256 * 2 + count]  <= INIT_02[count];
303
            mem[256 * 3 + count]  <= INIT_03[count];
304
            mem[256 * 4 + count]  <= INIT_04[count];
305
            mem[256 * 5 + count]  <= INIT_05[count];
306
            mem[256 * 6 + count]  <= INIT_06[count];
307
            mem[256 * 7 + count]  <= INIT_07[count];
308
            mem[256 * 8 + count]  <= INIT_08[count];
309
            mem[256 * 9 + count]  <= INIT_09[count];
310
            mem[256 * 10 + count] <= INIT_0A[count];
311
            mem[256 * 11 + count] <= INIT_0B[count];
312
            mem[256 * 12 + count] <= INIT_0C[count];
313
            mem[256 * 13 + count] <= INIT_0D[count];
314
            mem[256 * 14 + count] <= INIT_0E[count];
315
            mem[256 * 15 + count] <= INIT_0F[count];
316
            mem[256 * 16 + count] <= INIT_10[count];
317
            mem[256 * 17 + count] <= INIT_11[count];
318
            mem[256 * 18 + count] <= INIT_12[count];
319
            mem[256 * 19 + count] <= INIT_13[count];
320
            mem[256 * 20 + count] <= INIT_14[count];
321
            mem[256 * 21 + count] <= INIT_15[count];
322
            mem[256 * 22 + count] <= INIT_16[count];
323
            mem[256 * 23 + count] <= INIT_17[count];
324
            mem[256 * 24 + count] <= INIT_18[count];
325
            mem[256 * 25 + count] <= INIT_19[count];
326
            mem[256 * 26 + count] <= INIT_1A[count];
327
            mem[256 * 27 + count] <= INIT_1B[count];
328
            mem[256 * 28 + count] <= INIT_1C[count];
329
            mem[256 * 29 + count] <= INIT_1D[count];
330
            mem[256 * 30 + count] <= INIT_1E[count];
331
            mem[256 * 31 + count] <= INIT_1F[count];
332
            mem[256 * 32 + count] <= INIT_20[count];
333
            mem[256 * 33 + count] <= INIT_21[count];
334
            mem[256 * 34 + count] <= INIT_22[count];
335
            mem[256 * 35 + count] <= INIT_23[count];
336
            mem[256 * 36 + count] <= INIT_24[count];
337
            mem[256 * 37 + count] <= INIT_25[count];
338
            mem[256 * 38 + count] <= INIT_26[count];
339
            mem[256 * 39 + count] <= INIT_27[count];
340
            mem[256 * 40 + count] <= INIT_28[count];
341
            mem[256 * 41 + count] <= INIT_29[count];
342
            mem[256 * 42 + count] <= INIT_2A[count];
343
            mem[256 * 43 + count] <= INIT_2B[count];
344
            mem[256 * 44 + count] <= INIT_2C[count];
345
            mem[256 * 45 + count] <= INIT_2D[count];
346
            mem[256 * 46 + count] <= INIT_2E[count];
347
            mem[256 * 47 + count] <= INIT_2F[count];
348
            mem[256 * 48 + count] <= INIT_30[count];
349
            mem[256 * 49 + count] <= INIT_31[count];
350
            mem[256 * 50 + count] <= INIT_32[count];
351
            mem[256 * 51 + count] <= INIT_33[count];
352
            mem[256 * 52 + count] <= INIT_34[count];
353
            mem[256 * 53 + count] <= INIT_35[count];
354
            mem[256 * 54 + count] <= INIT_36[count];
355
            mem[256 * 55 + count] <= INIT_37[count];
356
            mem[256 * 56 + count] <= INIT_38[count];
357
            mem[256 * 57 + count] <= INIT_39[count];
358
            mem[256 * 58 + count] <= INIT_3A[count];
359
            mem[256 * 59 + count] <= INIT_3B[count];
360
            mem[256 * 60 + count] <= INIT_3C[count];
361
            mem[256 * 61 + count] <= INIT_3D[count];
362
            mem[256 * 62 + count] <= INIT_3E[count];
363
            mem[256 * 63 + count] <= INIT_3F[count];
364
            mem[256 * 64 + count] <= INITP_00[count];
365
            mem[256 * 65 + count] <= INITP_01[count];
366
            mem[256 * 66 + count] <= INITP_02[count];
367
            mem[256 * 67 + count] <= INITP_03[count];
368
            mem[256 * 68 + count] <= INITP_04[count];
369
            mem[256 * 69 + count] <= INITP_05[count];
370
            mem[256 * 70 + count] <= INITP_06[count];
371
            mem[256 * 71 + count] <= INITP_07[count];
372
        end
373
    end
374
 
375
    always @(addra_int or addrb_int) begin
376
        address_collision <= 1'b0;
377
        for (ci = 0; ci < 16; ci = ci + 1) begin
378
            for (cj = 0; cj < 16; cj = cj + 1) begin
379
                if ((addra_int * 16 + ci) == (addrb_int * 16 + cj)) begin
380
                    address_collision <= 1'b1;
381
                end
382
            end
383
        end
384
    end
385
 
386
    // Data
387
    always @(posedge recovery_a or posedge recovery_b) begin
388
        if (((wr_mode_a == 2'b01) && (wr_mode_b == 2'b01)) ||
389
            ((wr_mode_a != 2'b01) && (wr_mode_b != 2'b01))) begin
390
            if (wea_int == 1 && web_int == 1) begin
391
                for (dmi = 0; dmi < 16; dmi = dmi + 1) begin
392
                    for (dmj = 0; dmj < 16; dmj = dmj + 1) begin
393
                        if ((addra_int * 16 + dmi) == (addrb_int * 16 + dmj)) begin
394
                            mem[addra_int * 16 + dmi] <= 1'bX;
395
                        end
396
                    end
397
                end
398
            end
399
        end
400
        recovery_a <= 0;
401
        recovery_b <= 0;
402
    end
403
 
404
    always @(posedge recovery_a or posedge recovery_b) begin
405
        if ((wr_mode_a == 2'b01) && (wr_mode_b != 2'b01)) begin
406
            if (wea_int == 1 && web_int == 1) begin
407
                for (dni = 0; dni < 16; dni = dni + 1) begin
408
                    for (dnj = 0; dnj < 16; dnj = dnj + 1) begin
409
                        if ((addra_int * 16 + dni) == (addrb_int * 16 + dnj)) begin
410
                            mem[addra_int * 16 + dni] <= dia_int[dni];
411
                        end
412
                    end
413
                end
414
            end
415
        end
416
    end
417
 
418
    always @(posedge recovery_a or posedge recovery_b) begin
419
        if ((wr_mode_a != 2'b01) && (wr_mode_b == 2'b01)) begin
420
            if (wea_int == 1 && web_int == 1) begin
421
                for (doi = 0; doi < 16; doi = doi + 1) begin
422
                    for (doj = 0; doj < 16; doj = doj + 1) begin
423
                        if ((addra_int * 16 + doi) == (addrb_int * 16 + doj)) begin
424
                            mem[addrb_int * 16 + doj] <= dib_int[doj];
425
                        end
426
                    end
427
                end
428
            end
429
        end
430
    end
431
 
432
    always @(posedge recovery_a or posedge recovery_b) begin
433
        if ((wr_mode_b == 2'b00) || (wr_mode_b == 2'b10)) begin
434
            if ((wea_int == 0) && (web_int == 1) && (ssra_int == 0)) begin
435
                for (dai = 0; dai < 16; dai = dai + 1) begin
436
                    for (daj = 0; daj < 16; daj = daj + 1) begin
437
                        if ((addra_int * 16 + dai) == (addrb_int * 16 + daj)) begin
438
                            doa_out[dai] <= 1'bX;
439
                        end
440
                    end
441
                end
442
            end
443
        end
444
    end
445
 
446
    always @(posedge recovery_a or posedge recovery_b) begin
447
        if ((wr_mode_a == 2'b00) || (wr_mode_a == 2'b10)) begin
448
            if ((wea_int == 1) && (web_int == 0) && (ssrb_int == 0)) begin
449
                for (dbi = 0; dbi < 16; dbi = dbi + 1) begin
450
                    for (dbj = 0; dbj < 16; dbj = dbj + 1) begin
451
                        if ((addra_int * 16 + dbi) == (addrb_int * 16 + dbj)) begin
452
                            dob_out[dbj] <= 1'bX;
453
                        end
454
                    end
455
                end
456
            end
457
        end
458
    end
459
 
460
    always @(posedge recovery_a or posedge recovery_b) begin
461
        if (((wr_mode_a == 2'b00) && (wr_mode_b == 2'b00)) ||
462
            (wr_mode_b == 2'b10) ||
463
            ((wr_mode_a == 2'b01) && (wr_mode_b == 2'b00))) begin
464
            if ((wea_int == 1) && (web_int == 1) && (ssra_int == 0)) begin
465
                for (dci = 0; dci < 16; dci = dci + 1) begin
466
                    for (dcj = 0; dcj < 16; dcj = dcj + 1) begin
467
                        if ((addra_int * 16 + dci) == (addrb_int * 16 + dcj)) begin
468
                            doa_out[dci] <= 1'bX;
469
                        end
470
                    end
471
                end
472
            end
473
        end
474
    end
475
 
476
    always @(posedge recovery_a or posedge recovery_b) begin
477
        if (((wr_mode_a == 2'b00) && (wr_mode_b == 2'b00)) ||
478
            (wr_mode_a == 2'b10) ||
479
            ((wr_mode_a == 2'b00) && (wr_mode_b == 2'b01))) begin
480
            if ((wea_int == 1) && (web_int == 1) && (ssrb_int == 0)) begin
481
                for (ddi = 0; ddi < 16; ddi = ddi + 1) begin
482
                    for (ddj = 0; ddj < 16; ddj = ddj + 1) begin
483
                        if ((addra_int * 16 + ddi) == (addrb_int * 16 + ddj)) begin
484
                            dob_out[ddj] <= 1'bX;
485
                        end
486
                    end
487
                end
488
            end
489
        end
490
    end
491
 
492
    // Parity
493
    always @(posedge recovery_a or posedge recovery_b) begin
494
        if (((wr_mode_a == 2'b01) && (wr_mode_b == 2'b01)) ||
495
            ((wr_mode_a != 2'b01) && (wr_mode_b != 2'b01))) begin
496
            if (wea_int == 1 && web_int == 1) begin
497
                for (pmi = 0; pmi < 2; pmi = pmi + 1) begin
498
                    for (pmj = 0; pmj < 2; pmj = pmj + 1) begin
499
                        if ((addra_int * 2 + pmi) == (addrb_int * 2 + pmj)) begin
500
                            mem[16384 + addra_int * 2 + pmi] <= 1'bX;
501
                        end
502
                    end
503
                end
504
            end
505
        end
506
        recovery_a <= 0;
507
        recovery_b <= 0;
508
    end
509
 
510
    always @(posedge recovery_a or posedge recovery_b) begin
511
        if ((wr_mode_a == 2'b01) && (wr_mode_b != 2'b01)) begin
512
            if (wea_int == 1 && web_int == 1) begin
513
                for (pni = 0; pni < 2; pni = pni + 1) begin
514
                    for (pnj = 0; pnj < 2; pnj = pnj + 1) begin
515
                        if ((addra_int * 2 + pni) == (addrb_int * 2 + pnj)) begin
516
                            mem[16384 + addra_int * 2 + pni] <= dipa_int[pni];
517
                        end
518
                    end
519
                end
520
            end
521
        end
522
    end
523
 
524
    always @(posedge recovery_a or posedge recovery_b) begin
525
        if ((wr_mode_a != 2'b01) && (wr_mode_b == 2'b01)) begin
526
            if (wea_int == 1 && web_int == 1) begin
527
                for (poi = 0; poi < 2; poi = poi + 1) begin
528
                    for (poj = 0; poj < 2; poj = poj + 1) begin
529
                        if ((addra_int * 2 + poi) == (addrb_int * 2 + poj)) begin
530
                            mem[16384 + addrb_int * 2 + poj] <= dipb_int[poj];
531
                        end
532
                    end
533
                end
534
            end
535
        end
536
    end
537
 
538
    always @(posedge recovery_a or posedge recovery_b) begin
539
        if ((wr_mode_b == 2'b00) || (wr_mode_b == 2'b10)) begin
540
            if ((wea_int == 0) && (web_int == 1) && (ssra_int == 0)) begin
541
                for (pai = 0; pai < 2; pai = pai + 1) begin
542
                    for (paj = 0; paj < 2; paj = paj + 1) begin
543
                        if ((addra_int * 2 + pai) == (addrb_int * 2 + paj)) begin
544
                            dopa_out[pai] <= 1'bX;
545
                        end
546
                    end
547
                end
548
            end
549
        end
550
    end
551
 
552
    always @(posedge recovery_a or posedge recovery_b) begin
553
        if ((wr_mode_a == 2'b00) || (wr_mode_a == 2'b10)) begin
554
            if ((wea_int == 1) && (web_int == 0) && (ssrb_int == 0)) begin
555
                for (pbi = 0; pbi < 2; pbi = pbi + 1) begin
556
                    for (pbj = 0; pbj < 2; pbj = pbj + 1) begin
557
                        if ((addra_int * 2 + pbi) == (addrb_int * 2 + pbj)) begin
558
                            dopb_out[pbj] <= 1'bX;
559
                        end
560
                    end
561
                end
562
            end
563
        end
564
    end
565
 
566
    always @(posedge recovery_a or posedge recovery_b) begin
567
        if (((wr_mode_a == 2'b00) && (wr_mode_b == 2'b00)) ||
568
            (wr_mode_b == 2'b10) ||
569
            ((wr_mode_a == 2'b01) && (wr_mode_b == 2'b00))) begin
570
            if ((wea_int == 1) && (web_int == 1) && (ssra_int == 0)) begin
571
                for (pci = 0; pci < 2; pci = pci + 1) begin
572
                    for (pcj = 0; pcj < 2; pcj = pcj + 1) begin
573
                        if ((addra_int * 2 + pci) == (addrb_int * 2 + pcj)) begin
574
                            dopa_out[pci] <= 1'bX;
575
                        end
576
                    end
577
                end
578
            end
579
        end
580
    end
581
 
582
    always @(posedge recovery_a or posedge recovery_b) begin
583
        if (((wr_mode_a == 2'b00) && (wr_mode_b == 2'b00)) ||
584
            (wr_mode_a == 2'b10) ||
585
            ((wr_mode_a == 2'b00) && (wr_mode_b == 2'b01))) begin
586
            if ((wea_int == 1) && (web_int == 1) && (ssrb_int == 0)) begin
587
                for (pdi = 0; pdi < 2; pdi = pdi + 1) begin
588
                    for (pdj = 0; pdj < 2; pdj = pdj + 1) begin
589
                        if ((addra_int * 2 + pdi) == (addrb_int * 2 + pdj)) begin
590
                            dopb_out[pdj] <= 1'bX;
591
                        end
592
                    end
593
                end
594
            end
595
        end
596
    end
597
 
598
    initial begin
599
        case (WRITE_MODE_A)
600
            "WRITE_FIRST" : wr_mode_a <= 2'b00;
601
            "READ_FIRST"  : wr_mode_a <= 2'b01;
602
            "NO_CHANGE"   : wr_mode_a <= 2'b10;
603
            default       : begin
604
                                $display("Error : WRITE_MODE_A = %s is not WRITE_FIRST, READ_FIRST or NO_CHANGE.", WRITE_MODE_A);
605
                                $finish;
606
                            end
607
        endcase
608
    end
609
 
610
    initial begin
611
        case (WRITE_MODE_B)
612
            "WRITE_FIRST" : wr_mode_b <= 2'b00;
613
            "READ_FIRST"  : wr_mode_b <= 2'b01;
614
            "NO_CHANGE"   : wr_mode_b <= 2'b10;
615
            default       : begin
616
                                $display("Error : WRITE_MODE_B = %s is not WRITE_FIRST, READ_FIRST or NO_CHANGE.", WRITE_MODE_B);
617
                                $finish;
618
                            end
619
        endcase
620
    end
621
 
622
    // Port A
623
    always @(posedge clka_int) begin
624
        if (ena_int == 1'b1) begin
625
            if (ssra_int == 1'b1) begin
626
                doa_out[0] <= SRVAL_A[0];
627
                doa_out[1] <= SRVAL_A[1];
628
                doa_out[2] <= SRVAL_A[2];
629
                doa_out[3] <= SRVAL_A[3];
630
                doa_out[4] <= SRVAL_A[4];
631
                doa_out[5] <= SRVAL_A[5];
632
                doa_out[6] <= SRVAL_A[6];
633
                doa_out[7] <= SRVAL_A[7];
634
                doa_out[8] <= SRVAL_A[8];
635
                doa_out[9] <= SRVAL_A[9];
636
                doa_out[10] <= SRVAL_A[10];
637
                doa_out[11] <= SRVAL_A[11];
638
                doa_out[12] <= SRVAL_A[12];
639
                doa_out[13] <= SRVAL_A[13];
640
                doa_out[14] <= SRVAL_A[14];
641
                doa_out[15] <= SRVAL_A[15];
642
                dopa_out[0] <= SRVAL_A[16];
643
                dopa_out[1] <= SRVAL_A[17];
644
            end
645
            else begin
646
                if (wea_int == 1'b1) begin
647
                    if (wr_mode_a == 2'b00) begin
648
                        doa_out[0] <= dia_int[0];
649
                        doa_out[1] <= dia_int[1];
650
                        doa_out[2] <= dia_int[2];
651
                        doa_out[3] <= dia_int[3];
652
                        doa_out[4] <= dia_int[4];
653
                        doa_out[5] <= dia_int[5];
654
                        doa_out[6] <= dia_int[6];
655
                        doa_out[7] <= dia_int[7];
656
                        doa_out[8] <= dia_int[8];
657
                        doa_out[9] <= dia_int[9];
658
                        doa_out[10] <= dia_int[10];
659
                        doa_out[11] <= dia_int[11];
660
                        doa_out[12] <= dia_int[12];
661
                        doa_out[13] <= dia_int[13];
662
                        doa_out[14] <= dia_int[14];
663
                        doa_out[15] <= dia_int[15];
664
                        dopa_out[0] <= dipa_int[0];
665
                        dopa_out[1] <= dipa_int[1];
666
                    end
667
                    else if (wr_mode_a == 2'b01) begin
668
                        doa_out[0] <= mem[addra_int * 16 + 0];
669
                        doa_out[1] <= mem[addra_int * 16 + 1];
670
                        doa_out[2] <= mem[addra_int * 16 + 2];
671
                        doa_out[3] <= mem[addra_int * 16 + 3];
672
                        doa_out[4] <= mem[addra_int * 16 + 4];
673
                        doa_out[5] <= mem[addra_int * 16 + 5];
674
                        doa_out[6] <= mem[addra_int * 16 + 6];
675
                        doa_out[7] <= mem[addra_int * 16 + 7];
676
                        doa_out[8] <= mem[addra_int * 16 + 8];
677
                        doa_out[9] <= mem[addra_int * 16 + 9];
678
                        doa_out[10] <= mem[addra_int * 16 + 10];
679
                        doa_out[11] <= mem[addra_int * 16 + 11];
680
                        doa_out[12] <= mem[addra_int * 16 + 12];
681
                        doa_out[13] <= mem[addra_int * 16 + 13];
682
                        doa_out[14] <= mem[addra_int * 16 + 14];
683
                        doa_out[15] <= mem[addra_int * 16 + 15];
684
                        dopa_out[0] <= mem[16384 + addra_int * 2 + 0];
685
                        dopa_out[1] <= mem[16384 + addra_int * 2 + 1];
686
                    end
687
                    else begin
688
                        doa_out[0] <= doa_out[0];
689
                        doa_out[1] <= doa_out[1];
690
                        doa_out[2] <= doa_out[2];
691
                        doa_out[3] <= doa_out[3];
692
                        doa_out[4] <= doa_out[4];
693
                        doa_out[5] <= doa_out[5];
694
                        doa_out[6] <= doa_out[6];
695
                        doa_out[7] <= doa_out[7];
696
                        doa_out[8] <= doa_out[8];
697
                        doa_out[9] <= doa_out[9];
698
                        doa_out[10] <= doa_out[10];
699
                        doa_out[11] <= doa_out[11];
700
                        doa_out[12] <= doa_out[12];
701
                        doa_out[13] <= doa_out[13];
702
                        doa_out[14] <= doa_out[14];
703
                        doa_out[15] <= doa_out[15];
704
                        dopa_out[0] <= dopa_out[0];
705
                        dopa_out[1] <= dopa_out[1];
706
                    end
707
                end
708
                else begin
709
                    doa_out[0] <= mem[addra_int * 16 + 0];
710
                    doa_out[1] <= mem[addra_int * 16 + 1];
711
                    doa_out[2] <= mem[addra_int * 16 + 2];
712
                    doa_out[3] <= mem[addra_int * 16 + 3];
713
                    doa_out[4] <= mem[addra_int * 16 + 4];
714
                    doa_out[5] <= mem[addra_int * 16 + 5];
715
                    doa_out[6] <= mem[addra_int * 16 + 6];
716
                    doa_out[7] <= mem[addra_int * 16 + 7];
717
                    doa_out[8] <= mem[addra_int * 16 + 8];
718
                    doa_out[9] <= mem[addra_int * 16 + 9];
719
                    doa_out[10] <= mem[addra_int * 16 + 10];
720
                    doa_out[11] <= mem[addra_int * 16 + 11];
721
                    doa_out[12] <= mem[addra_int * 16 + 12];
722
                    doa_out[13] <= mem[addra_int * 16 + 13];
723
                    doa_out[14] <= mem[addra_int * 16 + 14];
724
                    doa_out[15] <= mem[addra_int * 16 + 15];
725
                    dopa_out[0] <= mem[16384 + addra_int * 2 + 0];
726
                    dopa_out[1] <= mem[16384 + addra_int * 2 + 1];
727
                end
728
            end
729
        end
730
    end
731
 
732
    always @(posedge clka_int) begin
733
        if (ena_int == 1'b1 && wea_int == 1'b1) begin
734
            mem[addra_int * 16 + 0] <= dia_int[0];
735
            mem[addra_int * 16 + 1] <= dia_int[1];
736
            mem[addra_int * 16 + 2] <= dia_int[2];
737
            mem[addra_int * 16 + 3] <= dia_int[3];
738
            mem[addra_int * 16 + 4] <= dia_int[4];
739
            mem[addra_int * 16 + 5] <= dia_int[5];
740
            mem[addra_int * 16 + 6] <= dia_int[6];
741
            mem[addra_int * 16 + 7] <= dia_int[7];
742
            mem[addra_int * 16 + 8] <= dia_int[8];
743
            mem[addra_int * 16 + 9] <= dia_int[9];
744
            mem[addra_int * 16 + 10] <= dia_int[10];
745
            mem[addra_int * 16 + 11] <= dia_int[11];
746
            mem[addra_int * 16 + 12] <= dia_int[12];
747
            mem[addra_int * 16 + 13] <= dia_int[13];
748
            mem[addra_int * 16 + 14] <= dia_int[14];
749
            mem[addra_int * 16 + 15] <= dia_int[15];
750
            mem[16384 + addra_int * 2 + 0] <= dipa_int[0];
751
            mem[16384 + addra_int * 2 + 1] <= dipa_int[1];
752
        end
753
    end
754
 
755
    // Port B
756
    always @(posedge clkb_int) begin
757
        if (enb_int == 1'b1) begin
758
            if (ssrb_int == 1'b1) begin
759
                dob_out[0] <= SRVAL_B[0];
760
                dob_out[1] <= SRVAL_B[1];
761
                dob_out[2] <= SRVAL_B[2];
762
                dob_out[3] <= SRVAL_B[3];
763
                dob_out[4] <= SRVAL_B[4];
764
                dob_out[5] <= SRVAL_B[5];
765
                dob_out[6] <= SRVAL_B[6];
766
                dob_out[7] <= SRVAL_B[7];
767
                dob_out[8] <= SRVAL_B[8];
768
                dob_out[9] <= SRVAL_B[9];
769
                dob_out[10] <= SRVAL_B[10];
770
                dob_out[11] <= SRVAL_B[11];
771
                dob_out[12] <= SRVAL_B[12];
772
                dob_out[13] <= SRVAL_B[13];
773
                dob_out[14] <= SRVAL_B[14];
774
                dob_out[15] <= SRVAL_B[15];
775
                dopb_out[0] <= SRVAL_B[16];
776
                dopb_out[1] <= SRVAL_B[17];
777
            end
778
            else begin
779
                if (web_int == 1'b1) begin
780
                    if (wr_mode_b == 2'b00) begin
781
                        dob_out[0] <= dib_int[0];
782
                        dob_out[1] <= dib_int[1];
783
                        dob_out[2] <= dib_int[2];
784
                        dob_out[3] <= dib_int[3];
785
                        dob_out[4] <= dib_int[4];
786
                        dob_out[5] <= dib_int[5];
787
                        dob_out[6] <= dib_int[6];
788
                        dob_out[7] <= dib_int[7];
789
                        dob_out[8] <= dib_int[8];
790
                        dob_out[9] <= dib_int[9];
791
                        dob_out[10] <= dib_int[10];
792
                        dob_out[11] <= dib_int[11];
793
                        dob_out[12] <= dib_int[12];
794
                        dob_out[13] <= dib_int[13];
795
                        dob_out[14] <= dib_int[14];
796
                        dob_out[15] <= dib_int[15];
797
                        dopb_out[0] <= dipb_int[0];
798
                        dopb_out[1] <= dipb_int[1];
799
                    end
800
                    else if (wr_mode_b == 2'b01) begin
801
                        dob_out[0] <= mem[addrb_int * 16 + 0];
802
                        dob_out[1] <= mem[addrb_int * 16 + 1];
803
                        dob_out[2] <= mem[addrb_int * 16 + 2];
804
                        dob_out[3] <= mem[addrb_int * 16 + 3];
805
                        dob_out[4] <= mem[addrb_int * 16 + 4];
806
                        dob_out[5] <= mem[addrb_int * 16 + 5];
807
                        dob_out[6] <= mem[addrb_int * 16 + 6];
808
                        dob_out[7] <= mem[addrb_int * 16 + 7];
809
                        dob_out[8] <= mem[addrb_int * 16 + 8];
810
                        dob_out[9] <= mem[addrb_int * 16 + 9];
811
                        dob_out[10] <= mem[addrb_int * 16 + 10];
812
                        dob_out[11] <= mem[addrb_int * 16 + 11];
813
                        dob_out[12] <= mem[addrb_int * 16 + 12];
814
                        dob_out[13] <= mem[addrb_int * 16 + 13];
815
                        dob_out[14] <= mem[addrb_int * 16 + 14];
816
                        dob_out[15] <= mem[addrb_int * 16 + 15];
817
                        dopb_out[0] <= mem[16384 + addrb_int * 2 + 0];
818
                        dopb_out[1] <= mem[16384 + addrb_int * 2 + 1];
819
                    end
820
                    else begin
821
                        dob_out[0] <= dob_out[0];
822
                        dob_out[1] <= dob_out[1];
823
                        dob_out[2] <= dob_out[2];
824
                        dob_out[3] <= dob_out[3];
825
                        dob_out[4] <= dob_out[4];
826
                        dob_out[5] <= dob_out[5];
827
                        dob_out[6] <= dob_out[6];
828
                        dob_out[7] <= dob_out[7];
829
                        dob_out[8] <= dob_out[8];
830
                        dob_out[9] <= dob_out[9];
831
                        dob_out[10] <= dob_out[10];
832
                        dob_out[11] <= dob_out[11];
833
                        dob_out[12] <= dob_out[12];
834
                        dob_out[13] <= dob_out[13];
835
                        dob_out[14] <= dob_out[14];
836
                        dob_out[15] <= dob_out[15];
837
                        dopb_out[0] <= dopb_out[0];
838
                        dopb_out[1] <= dopb_out[1];
839
                    end
840
                end
841
                else begin
842
                    dob_out[0] <= mem[addrb_int * 16 + 0];
843
                    dob_out[1] <= mem[addrb_int * 16 + 1];
844
                    dob_out[2] <= mem[addrb_int * 16 + 2];
845
                    dob_out[3] <= mem[addrb_int * 16 + 3];
846
                    dob_out[4] <= mem[addrb_int * 16 + 4];
847
                    dob_out[5] <= mem[addrb_int * 16 + 5];
848
                    dob_out[6] <= mem[addrb_int * 16 + 6];
849
                    dob_out[7] <= mem[addrb_int * 16 + 7];
850
                    dob_out[8] <= mem[addrb_int * 16 + 8];
851
                    dob_out[9] <= mem[addrb_int * 16 + 9];
852
                    dob_out[10] <= mem[addrb_int * 16 + 10];
853
                    dob_out[11] <= mem[addrb_int * 16 + 11];
854
                    dob_out[12] <= mem[addrb_int * 16 + 12];
855
                    dob_out[13] <= mem[addrb_int * 16 + 13];
856
                    dob_out[14] <= mem[addrb_int * 16 + 14];
857
                    dob_out[15] <= mem[addrb_int * 16 + 15];
858
                    dopb_out[0] <= mem[16384 + addrb_int * 2 + 0];
859
                    dopb_out[1] <= mem[16384 + addrb_int * 2 + 1];
860
                end
861
            end
862
        end
863
    end
864
 
865
    always @(posedge clkb_int) begin
866
        if (enb_int == 1'b1 && web_int == 1'b1) begin
867
            mem[addrb_int * 16 + 0] <= dib_int[0];
868
            mem[addrb_int * 16 + 1] <= dib_int[1];
869
            mem[addrb_int * 16 + 2] <= dib_int[2];
870
            mem[addrb_int * 16 + 3] <= dib_int[3];
871
            mem[addrb_int * 16 + 4] <= dib_int[4];
872
            mem[addrb_int * 16 + 5] <= dib_int[5];
873
            mem[addrb_int * 16 + 6] <= dib_int[6];
874
            mem[addrb_int * 16 + 7] <= dib_int[7];
875
            mem[addrb_int * 16 + 8] <= dib_int[8];
876
            mem[addrb_int * 16 + 9] <= dib_int[9];
877
            mem[addrb_int * 16 + 10] <= dib_int[10];
878
            mem[addrb_int * 16 + 11] <= dib_int[11];
879
            mem[addrb_int * 16 + 12] <= dib_int[12];
880
            mem[addrb_int * 16 + 13] <= dib_int[13];
881
            mem[addrb_int * 16 + 14] <= dib_int[14];
882
            mem[addrb_int * 16 + 15] <= dib_int[15];
883
            mem[16384 + addrb_int * 2 + 0] <= dipb_int[0];
884
            mem[16384 + addrb_int * 2 + 1] <= dipb_int[1];
885
        end
886
    end
887
 
888
    specify
889
        (CLKA *> DOA) = (1, 1);
890
        (CLKA *> DOPA) = (1, 1);
891
        (CLKB *> DOB) = (1, 1);
892
        (CLKB *> DOPB) = (1, 1);
893
        $recovery (posedge CLKB, posedge CLKA &&& collision, 1, recovery_b);
894
        $recovery (posedge CLKA, posedge CLKB &&& collision, 1, recovery_a);
895
    endspecify
896
 
897
endmodule
898
 
899
`endcelldefine

powered by: WebSVN 2.1.0

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