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

Subversion Repositories mpmc8

[/] [mpmc8/] [trunk/] [rtl/] [mpmc10/] [mpmc10_wb.sv] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 robfinch
`timescale 1ns / 1ps
2
// ============================================================================
3
//        __
4 11 robfinch
//   \\__/ o\    (C) 2015-2023  Robert Finch, Waterloo
5 5 robfinch
//    \  __ /    All rights reserved.
6
//     \/_//     robfinch@finitron.ca
7
//       ||
8
//
9
// BSD 3-Clause License
10
// Redistribution and use in source and binary forms, with or without
11
// modification, are permitted provided that the following conditions are met:
12
//
13
// 1. Redistributions of source code must retain the above copyright notice, this
14
//    list of conditions and the following disclaimer.
15
//
16
// 2. Redistributions in binary form must reproduce the above copyright notice,
17
//    this list of conditions and the following disclaimer in the documentation
18
//    and/or other materials provided with the distribution.
19
//
20
// 3. Neither the name of the copyright holder nor the names of its
21
//    contributors may be used to endorse or promote products derived from
22
//    this software without specific prior written permission.
23
//
24
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
//
35 11 robfinch
// 26500 LUTs, 130 BRAM (64kB cache)
36
// 21400 LUTs no AMO
37 5 robfinch
//
38
// Read channels always wait until there is valid data in the cache.
39
// ============================================================================
40
//
41
//`define RED_SCREEN    1'b1
42 11 robfinch
`define SUPPORT_AMO     1'b1
43
//`define SUPPORT_AMO_TETRA     1'b1
44
//`define SUPPORT_AMO_OCTA 1'b1
45
//`define SUPPORT_AMO_SHIFT     1'b1
46
//`define SUPPORT_AMO_MULTI_SHIFT       1'b1
47 5 robfinch
 
48
import wishbone_pkg::*;
49
import mpmc10_pkg::*;
50
 
51
module mpmc10_wb(
52
input rst,
53
input clk100MHz,
54
input mem_ui_rst,
55
input mem_ui_clk,
56 7 robfinch
input calib_complete,
57 5 robfinch
output reg rstn,
58
output [31:0] app_waddr,
59
input app_rdy,
60
output app_en,
61
output [2:0] app_cmd,
62
output [28:0] app_addr,
63
input app_rd_data_valid,
64
output [15:0] app_wdf_mask,
65
output reg [127:0] app_wdf_data,
66
input app_wdf_rdy,
67
output app_wdf_wren,
68
output app_wdf_end,
69
input [127:0] app_rd_data,
70
input app_rd_data_end,
71
input ch0clk, ch1clk, ch2clk, ch3clk, ch4clk, ch5clk, ch6clk, ch7clk,
72 11 robfinch
input wb_cmd_request128_t ch0i,
73
output wb_cmd_response128_t ch0o,
74
input wb_cmd_request128_t ch1i,
75
output wb_cmd_response128_t ch1o,
76
input wb_cmd_request128_t ch2i,
77
output wb_cmd_response128_t ch2o,
78
input wb_cmd_request128_t ch3i,
79
output wb_cmd_response128_t ch3o,
80
input wb_cmd_request128_t ch4i,
81
output wb_cmd_response128_t ch4o,
82
input wb_cmd_request128_t ch5i,
83
output wb_cmd_response128_t ch5o,
84
input wb_cmd_request128_t ch6i,
85
output wb_cmd_response128_t ch6o,
86
input wb_cmd_request128_t ch7i,
87
output wb_cmd_response128_t ch7o,
88 7 robfinch
output mpmc10_state_t state
89 5 robfinch
);
90
parameter NAR = 2;                      // Number of address reservations
91
parameter CL = 3'd4;            // Cache read latency
92 11 robfinch
parameter STREAM0 = 1'b1;
93
parameter STREAM1 = 1'b0;
94
parameter STREAM2 = 1'b0;
95
parameter STREAM3 = 1'b0;
96
parameter STREAM4 = 1'b0;
97
parameter STREAM5 = 1'b1;
98
parameter STREAM6 = 1'b0;
99
parameter STREAM7 = 1'b0;
100
parameter RMW0 = 1'b0;
101
parameter RMW1 = 1'b1;
102
parameter RMW2 = 1'b0;
103
parameter RMW3 = 1'b0;
104
parameter RMW4 = 1'b0;
105
parameter RMW5 = 1'b0;
106
parameter RMW6 = 1'b0;
107
parameter RMW7 = 1'b1;
108 5 robfinch
 
109 11 robfinch
wb_cmd_request128_t ch0is;
110
wb_cmd_request128_t ch0is2;
111
wb_cmd_request128_t ch1is;
112
wb_cmd_request128_t ch1is2;
113
wb_cmd_request128_t ch2is;
114
wb_cmd_request128_t ch2is2;
115
wb_cmd_request128_t ch3is;
116
wb_cmd_request128_t ch3is2;
117
wb_cmd_request128_t ch4is;
118
wb_cmd_request128_t ch4is2;
119
wb_cmd_request128_t ch5is;
120
wb_cmd_request128_t ch5is2;
121
wb_cmd_request128_t ch6is;
122
wb_cmd_request128_t ch6is2;
123
wb_cmd_request128_t ch7is;
124
wb_cmd_request128_t ch7is2;
125 5 robfinch
 
126 11 robfinch
wb_cmd_response128_t ch0oa, ch0ob, ch0oc;
127
wb_cmd_response128_t ch1oa, ch1ob, ch1oc;
128
wb_cmd_response128_t ch2oa, ch2ob, ch2oc;
129
wb_cmd_response128_t ch3oa, ch3ob, ch3oc;
130
wb_cmd_response128_t ch4oa, ch4ob, ch4oc;
131
wb_cmd_response128_t ch5oa, ch5ob, ch5oc;
132
wb_cmd_response128_t ch6oa, ch6ob, ch6oc;
133
wb_cmd_response128_t ch7oa, ch7ob, ch7oc;
134 5 robfinch
 
135 11 robfinch
wire rmw0 = ch0is.cmd[4];
136
wire rmw1 = ch1is.cmd[4];
137
wire rmw2 = ch2is.cmd[4];
138
wire rmw3 = ch3is.cmd[4];
139
wire rmw4 = ch4is.cmd[4];
140
wire rmw5 = ch5is.cmd[4];
141
wire rmw6 = ch6is.cmd[4];
142
wire rmw7 = ch7is.cmd[4];
143 5 robfinch
 
144 11 robfinch
assign ch0o = STREAM0 ? ch0ob : rmw0 ? ch0oc : ch0oa;
145
assign ch1o = STREAM1 ? ch1ob : rmw1 ? ch1oc : ch1oa;
146
assign ch2o = STREAM2 ? ch2ob : rmw2 ? ch2oc : ch2oa;
147
assign ch3o = STREAM3 ? ch3ob : rmw3 ? ch3oc : ch3oa;
148
assign ch4o = STREAM4 ? ch4ob : rmw4 ? ch4oc : ch4oa;
149
assign ch5o = STREAM5 ? ch5ob : rmw5 ? ch5oc : ch5oa;
150
assign ch6o = STREAM6 ? ch6ob : rmw6 ? ch6oc : ch6oa;
151
assign ch7o = STREAM7 ? ch7ob : rmw7 ? ch7oc : ch7oa;
152 5 robfinch
 
153 11 robfinch
wb_cmd_request128_t req_fifoi;
154
wb_cmd_request128_t req_fifoo;
155
wb_cmd_request128_t ld;
156
wb_cmd_request128_t fifo_mask;
157
wb_cmd_request128_t fifoo = req_fifoo & fifo_mask;
158
 
159 5 robfinch
genvar g;
160 7 robfinch
integer n1,n2,n3;
161 11 robfinch
wire v;
162
wire full;
163
wire empty;
164 5 robfinch
wire almost_full;
165
wire [4:0] cnt;
166
reg wr_fifo;
167 7 robfinch
mpmc10_state_t prev_state;
168 5 robfinch
wire rd_fifo;   // from state machine
169
reg [5:0] num_strips;   // from fifo
170
wire [5:0] req_strip_cnt;
171
wire [5:0] resp_strip_cnt;
172
wire [15:0] tocnt;
173
reg [31:0] adr;
174
reg [3:0] uch;          // update channel
175
wire [15:0] wmask;
176
wire [15:0] mem_wdf_mask2;
177
reg [127:0] dat128;
178 7 robfinch
wire [127:0] dat256;
179 5 robfinch
wire [3:0] resv_ch [0:NAR-1];
180
wire [31:0] resv_adr [0:NAR-1];
181
wire rb1;
182
reg [7:0] req;
183
reg [127:0] rd_data_r;
184
reg rd_data_valid_r;
185 11 robfinch
reg cas_ok;
186 5 robfinch
 
187
wire ch0_hit_s, ch1_hit_s, ch2_hit_s, ch3_hit_s;
188
wire ch4_hit_s, ch5_hit_s, ch6_hit_s, ch7_hit_s;
189
wire ch0_hit_ne, ch5_hit_ne;
190 11 robfinch
wire hit0, hit1, hit2, hit3, hit4, hit5, hit6, hit7;
191 5 robfinch
 
192
always_ff @(posedge mem_ui_clk)
193 10 robfinch
if (app_rd_data_valid)
194 5 robfinch
        rd_data_r <= app_rd_data;
195
always_ff @(posedge mem_ui_clk)
196
        rd_data_valid_r <= app_rd_data_valid;
197
 
198
reg [19:0] rst_ctr;
199
always @(posedge clk100MHz)
200
if (rst)
201
        rst_ctr <= 24'd0;
202
else begin
203
        if (!rst_ctr[15])
204
                rst_ctr <= rst_ctr + 2'd1;
205
        rstn <= rst_ctr[15];
206
end
207
 
208
reg [7:0] stb [0:7];
209
always_comb stb[0] = ch0is.stb;
210
always_comb stb[1] = ch1is.stb;
211
always_comb stb[2] = ch2is.stb;
212
always_comb stb[3] = ch3is.stb;
213
always_comb stb[4] = ch4is.stb;
214
always_comb stb[5] = ch5is.stb;
215
always_comb stb[6] = ch6is.stb;
216
always_comb stb[7] = ch7is.stb;
217
 
218
reg [2:0] chcnt [0:7];
219
always_ff @(posedge mem_ui_clk)
220
if (rst) begin
221
        for (n2 = 0; n2 < 8; n2 = n2 + 1)
222
                chcnt[n2] <= 'd0;
223
end
224
else begin
225
        for (n2 = 0; n2 < 8; n2 = n2 + 1)
226
                if (stb[n2]) begin
227
                        if (chcnt[n2] < CL)
228
                                chcnt[n2] <= chcnt[n2] + 2'd1;
229
                end
230
                else
231
                        chcnt[n2] <= 'd0;
232
end
233
 
234 7 robfinch
wire [7:0] pe_req;
235 5 robfinch
reg [7:0] chack;
236
always_comb chack[0] = ch0o.ack;
237
always_comb chack[1] = ch1o.ack;
238
always_comb chack[2] = ch2o.ack;
239
always_comb chack[3] = ch3o.ack;
240
always_comb chack[4] = ch4o.ack;
241
always_comb chack[5] = ch5o.ack;
242
always_comb chack[6] = ch6o.ack;
243
always_comb chack[7] = ch7o.ack;
244
 
245 7 robfinch
reg [7:0] reqa;
246
always_comb reqa[1] = (!ch1o.ack && ch1is.stb && !ch1is.we && chcnt[1]==CL) || (ch1is.we && ch1is.stb);
247
always_comb reqa[5] = (!ch5o.ack && ch5is.stb && !ch5is.we && chcnt[5]==CL) || (ch5is.we && ch5is.stb);
248
 
249
wire rste = mem_ui_rst||rst||!calib_complete;
250
 
251 5 robfinch
edge_det edch0 (
252 7 robfinch
        .rst(rste),
253 5 robfinch
        .clk(mem_ui_clk),
254
        .ce(1'b1),
255
        .i((!ch0o.ack && ch0is.stb && !ch0is.we && chcnt[0]==CL) || (ch0is.we && ch0is.stb)),
256
        .pe(pe_req[0]),
257
        .ne(),
258
        .ee()
259
);
260
edge_det edch1 (
261 7 robfinch
        .rst(rste),
262 5 robfinch
        .clk(mem_ui_clk),
263
        .ce(1'b1),
264 7 robfinch
        .i(reqa[1]),
265 5 robfinch
        .pe(pe_req[1]),
266
        .ne(),
267
        .ee()
268
);
269
edge_det edch2 (
270 7 robfinch
        .rst(rste),
271 5 robfinch
        .clk(mem_ui_clk),
272
        .ce(1'b1),
273
        .i((!ch2o.ack && ch2is.stb && !ch2is.we && chcnt[2]==CL) || (ch2is.we && ch2is.stb)),
274
        .pe(pe_req[2]),
275
        .ne(),
276
        .ee()
277
);
278
edge_det edch3 (
279 7 robfinch
        .rst(rste),
280 5 robfinch
        .clk(mem_ui_clk),
281
        .ce(1'b1),
282
        .i((!ch3o.ack && ch3is.stb && !ch3is.we && chcnt[3]==CL) || (ch3is.we && ch3is.stb)),
283
        .pe(pe_req[3]),
284
        .ne(),
285
        .ee()
286
);
287
edge_det edch4 (
288 7 robfinch
        .rst(rste),
289 5 robfinch
        .clk(mem_ui_clk),
290
        .ce(1'b1),
291
        .i((!ch4o.ack && ch4is.stb && !ch4is.we && chcnt[4]==CL) || (ch4is.we && ch4is.stb)),
292
        .pe(pe_req[4]),
293
        .ne(),
294
        .ee()
295
);
296
edge_det edch5 (
297 7 robfinch
        .rst(rste),
298 5 robfinch
        .clk(mem_ui_clk),
299
        .ce(1'b1),
300 7 robfinch
        .i(reqa[5]),
301 5 robfinch
        .pe(pe_req[5]),
302
        .ne(),
303
        .ee()
304
);
305
edge_det edch6 (
306 7 robfinch
        .rst(rste),
307 5 robfinch
        .clk(mem_ui_clk),
308
        .ce(1'b1),
309
        .i((!ch6o.ack && ch6is.stb && !ch6is.we && chcnt[6]==CL) || (ch6is.we && ch6is.stb)),
310
        .pe(pe_req[6]),
311
        .ne(),
312
        .ee()
313
);
314
edge_det edch7 (
315 7 robfinch
        .rst(rste),
316 5 robfinch
        .clk(mem_ui_clk),
317
        .ce(1'b1),
318
        .i((!ch7o.ack && ch7is.stb && !ch7is.we && chcnt[7]==CL) || (ch7is.we && ch7is.stb)),
319
        .pe(pe_req[7]),
320
        .ne(),
321
        .ee()
322
);
323
wire [3:0] req_sel;
324 7 robfinch
always_ff @(posedge mem_ui_clk)
325
        for (n3 = 0; n3 < 8; n3 = n3 + 1)
326
                if (pe_req[n3])
327
                        req[n3] <= 1'b1;
328
                else if ((req_sel==n3[3:0]) || chack[n3])
329
                        req[n3] <= 1'b0;
330 5 robfinch
 
331
// Register signals onto mem_ui_clk domain
332
mpmc10_sync128_wb usyn0
333
(
334
        .clk(mem_ui_clk),
335
        .i(ch0i),
336
        .o(ch0is)
337
);
338
mpmc10_sync128_wb usyn1
339
(
340
        .clk(mem_ui_clk),
341
        .i(ch1i),
342
        .o(ch1is)
343
);
344
mpmc10_sync128_wb usyn2
345
(
346
        .clk(mem_ui_clk),
347
        .i(ch2i),
348
        .o(ch2is)
349
);
350
mpmc10_sync128_wb usyn3
351
(
352
        .clk(mem_ui_clk),
353
        .i(ch3i),
354
        .o(ch3is)
355
);
356
mpmc10_sync128_wb usyn4
357
(
358
        .clk(mem_ui_clk),
359
        .i(ch4i),
360
        .o(ch4is)
361
);
362
mpmc10_sync128_wb usyn5
363
(
364
        .clk(mem_ui_clk),
365
        .i(ch5i),
366
        .o(ch5is)
367
);
368
mpmc10_sync128_wb usyn6
369
(
370
        .clk(mem_ui_clk),
371
        .i(ch6i),
372
        .o(ch6is)
373
);
374
mpmc10_sync128_wb usyn7
375
(
376
        .clk(mem_ui_clk),
377
        .i(ch7i),
378
        .o(ch7is)
379
);
380
 
381
// Streaming channels have a burst length of 64. Round the address to the burst
382
// length.
383
always_comb
384
begin
385
        ch0is2 <= ch0is;
386 11 robfinch
        ch0is2.padr <= {ch0is.padr[31:10],10'b0};
387 5 robfinch
end
388
always_comb
389
begin
390
        ch1is2 <= ch1is;
391 11 robfinch
        ch1is2.padr <= {ch1is.padr[31:10],10'b0};
392 5 robfinch
end
393
always_comb
394
begin
395
        ch2is2 <= ch2is;
396 11 robfinch
        ch2is2.padr <= {ch2is.padr[31:10],10'b0};
397 5 robfinch
end
398
always_comb
399
begin
400
        ch3is2 <= ch3is;
401 11 robfinch
        ch3is2.padr <= {ch3is.padr[31:10],10'b0};
402 5 robfinch
end
403
always_comb
404
begin
405
        ch4is2 <= ch4is;
406 11 robfinch
        ch4is2.padr <= {ch4is.padr[31:10],10'b0};
407 5 robfinch
end
408
always_comb
409
begin
410
        ch5is2 <= ch5is;
411 11 robfinch
        ch5is2.padr <= {ch5is.padr[31:10],10'b0};
412 5 robfinch
end
413
always_comb
414
begin
415
        ch6is2 <= ch6is;
416 11 robfinch
        ch6is2.padr <= {ch6is.padr[31:10],10'b0};
417 5 robfinch
end
418
always_comb
419
begin
420
        ch7is2 <= ch7is;
421 11 robfinch
        ch7is2.padr <= {ch7is.padr[31:10],10'b0};
422 5 robfinch
end
423
 
424
always_comb
425
begin
426
        ld.bte <= wishbone_pkg::LINEAR;
427
        ld.cti <= wishbone_pkg::CLASSIC;
428
        ld.blen <= 'd0;
429 10 robfinch
        ld.cyc <= fifoo.cyc && !fifoo.we && rd_data_valid_r && (uch!=4'd0 && uch!=4'd5 && uch!=4'd15);
430 7 robfinch
        ld.stb <= fifoo.stb && !fifoo.we && rd_data_valid_r && (uch!=4'd0 && uch!=4'd5 && uch!=4'd15);
431 5 robfinch
        ld.we <= 1'b0;
432 11 robfinch
        ld.padr <= {app_waddr[31:4],4'h0};
433
        ld.data1 <= rd_data_r;
434 10 robfinch
        ld.sel <= {16{1'b1}};           // update all bytes
435 5 robfinch
end
436
 
437
reg ch0wack;
438
reg ch1wack;
439
reg ch2wack;
440
reg ch3wack;
441
reg ch4wack;
442
reg ch5wack;
443
reg ch6wack;
444
reg ch7wack;
445
 
446
always_ff @(posedge mem_ui_clk)
447
begin
448
        if (!ch0i.stb)  ch0wack <= 1'b0;
449
        if (!ch1i.stb)  ch1wack <= 1'b0;
450
        if (!ch2i.stb)  ch2wack <= 1'b0;
451
        if (!ch3i.stb)  ch3wack <= 1'b0;
452
        if (!ch4i.stb)  ch4wack <= 1'b0;
453
        if (!ch5i.stb)  ch5wack <= 1'b0;
454
        if (!ch6i.stb)  ch6wack <= 1'b0;
455
        if (!ch7i.stb)  ch7wack <= 1'b0;
456
        if (state==WRITE_DATA3)
457
                case(uch)
458
                4'd0:   ch0wack <= 1'b1;
459
                4'd1: ch1wack <= 1'b1;
460
                4'd2: ch2wack <= 1'b1;
461
                4'd3:   ch3wack <= 1'b1;
462
                4'd4:   ch4wack <= 1'b1;
463
                4'd5:   ch5wack <= 1'b1;
464
                4'd6:   ch6wack <= 1'b1;
465
                4'd7:   ch7wack <= 1'b1;
466
                default:        ;
467
                endcase
468
end
469
 
470
mpmc10_cache_wb ucache1
471
(
472
        .rst(mem_ui_rst),
473
        .wclk(mem_ui_clk),
474 7 robfinch
        .inv(1'b0),
475
        .wchi(fifoo),
476 5 robfinch
        .wcho(),
477
        .ld(ld),
478
        .ch0clk(STREAM0 ? 1'b0 : ch0clk),
479
        .ch1clk(STREAM1 ? 1'b0 : ch1clk),
480
        .ch2clk(STREAM2 ? 1'b0 : ch2clk),
481
        .ch3clk(STREAM3 ? 1'b0 : ch3clk),
482
        .ch4clk(STREAM4 ? 1'b0 : ch4clk),
483
        .ch5clk(STREAM5 ? 1'b0 : ch5clk),
484
        .ch6clk(STREAM6 ? 1'b0 : ch6clk),
485
        .ch7clk(STREAM7 ? 1'b0 : ch7clk),
486
        .ch0i(STREAM0 ? 'd0 : ch0is),
487
        .ch1i(STREAM1 ? 'd0 : ch1is),
488
        .ch2i(STREAM2 ? 'd0 : ch2is),
489
        .ch3i(STREAM3 ? 'd0 : ch3is),
490
        .ch4i(STREAM4 ? 'd0 : ch4is),
491
        .ch5i(STREAM5 ? 'd0 : ch5is),
492
        .ch6i(STREAM6 ? 'd0 : ch6is),
493
        .ch7i(STREAM7 ? 'd0 : ch7is),
494
        .ch0wack(ch0wack),
495
        .ch1wack(ch1wack),
496
        .ch2wack(ch2wack),
497
        .ch3wack(ch3wack),
498
        .ch4wack(ch4wack),
499
        .ch5wack(ch5wack),
500
        .ch6wack(ch6wack),
501
        .ch7wack(ch7wack),
502
        .ch0o(ch0oa),
503
        .ch1o(ch1oa),
504
        .ch2o(ch2oa),
505
        .ch3o(ch3oa),
506
        .ch4o(ch4oa),
507
        .ch5o(ch5oa),
508
        .ch6o(ch6oa),
509 11 robfinch
        .ch7o(ch7oa),
510
        .ch0hit(hit0),
511
        .ch1hit(hit1),
512
        .ch2hit(hit2),
513
        .ch3hit(hit3),
514
        .ch4hit(hit4),
515
        .ch5hit(hit5),
516
        .ch6hit(hit6),
517
        .ch7hit(hit7)
518 5 robfinch
);
519
 
520
mpmc10_strm_read_cache ustrm0
521
(
522
        .rst(rst),
523
        .wclk(mem_ui_clk),
524
        .wr(uch==4'd0 && rd_data_valid_r),
525
        .wadr({app_waddr[31:4],4'h0}),
526
        .wdat(rd_data_r),
527 11 robfinch
        .inv(1'b0),
528 5 robfinch
        .rclk(mem_ui_clk),
529
        .rd(ch0is.stb & ~ch0is.we),
530 11 robfinch
        .radr({ch0is.padr[31:4],4'h0}),
531 5 robfinch
        .rdat(ch0ob.dat),
532
        .hit(ch0_hit_s)
533
);
534
 
535
mpmc10_strm_read_cache ustrm1
536
(
537
        .rst(rst),
538
        .wclk(mem_ui_clk),
539
        .wr(uch==4'd1 && rd_data_valid_r),
540
        .wadr({app_waddr[31:4],4'h0}),
541
        .wdat(rd_data_r),
542 11 robfinch
        .inv(1'b0),
543 5 robfinch
        .rclk(mem_ui_clk),
544
        .rd(ch1is.stb & ~ch1is.we),
545 11 robfinch
        .radr({ch1is.padr[31:4],4'h0}),
546 5 robfinch
        .rdat(ch1ob.dat),
547
        .hit(ch1_hit_s)
548
);
549
 
550
mpmc10_strm_read_cache ustrm2
551
(
552
        .rst(rst),
553
        .wclk(mem_ui_clk),
554
        .wr(uch==4'd2 && rd_data_valid_r),
555
        .wadr({app_waddr[31:4],4'h0}),
556
        .wdat(rd_data_r),
557 11 robfinch
        .inv(1'b0),
558 5 robfinch
        .rclk(mem_ui_clk),
559
        .rd(ch2is.stb & ~ch2is.we),
560 11 robfinch
        .radr({ch2is.padr[31:4],4'h0}),
561 5 robfinch
        .rdat(ch2ob.dat),
562
        .hit(ch2_hit_s)
563
);
564
 
565
mpmc10_strm_read_cache ustrm3
566
(
567
        .rst(rst),
568
        .wclk(mem_ui_clk),
569
        .wr(uch==4'd3 && rd_data_valid_r),
570
        .wadr({app_waddr[31:4],4'h0}),
571
        .wdat(rd_data_r),
572 11 robfinch
        .inv(1'b0),
573 5 robfinch
        .rclk(mem_ui_clk),
574
        .rd(ch3is.stb & ~ch3is.we),
575 11 robfinch
        .radr({ch3is.padr[31:4],4'h0}),
576 5 robfinch
        .rdat(ch3ob.dat),
577
        .hit(ch3_hit_s)
578
);
579
 
580
mpmc10_strm_read_cache ustrm4
581
(
582
        .rst(rst),
583
        .wclk(mem_ui_clk),
584
        .wr(uch==4'd4 && rd_data_valid_r),
585
        .wadr({app_waddr[31:4],4'h0}),
586
        .wdat(rd_data_r),
587 11 robfinch
        .inv(1'b0),
588 5 robfinch
        .rclk(mem_ui_clk),
589
        .rd(ch4is.stb & ~ch4is.we),
590 11 robfinch
        .radr({ch4is.padr[31:4],4'h0}),
591 5 robfinch
        .rdat(ch4ob.dat),
592
        .hit(ch4_hit_s)
593
);
594
 
595
mpmc10_strm_read_cache ustrm5
596
(
597
        .rst(rst),
598
        .wclk(mem_ui_clk),
599
        .wr(uch==4'd5 && rd_data_valid_r),
600
        .wadr({app_waddr[31:4],4'h0}),
601
        .wdat(rd_data_r),
602 11 robfinch
        .inv(1'b0),
603 5 robfinch
        .rclk(mem_ui_clk),
604
        .rd(ch5is.stb & ~ch5is.we),
605 11 robfinch
        .radr({ch5is.padr[31:4],4'h0}),
606 5 robfinch
        .rdat(ch5ob.dat),
607
        .hit(ch5_hit_s)
608
);
609
 
610
mpmc10_strm_read_cache ustrm6
611
(
612
        .rst(rst),
613
        .wclk(mem_ui_clk),
614
        .wr(uch==4'd6 && rd_data_valid_r),
615
        .wadr({app_waddr[31:4],4'h0}),
616
        .wdat(rd_data_r),
617 11 robfinch
        .inv(1'b0),
618 5 robfinch
        .rclk(mem_ui_clk),
619
        .rd(ch6is.stb & ~ch6is.we),
620 11 robfinch
        .radr({ch6is.padr[31:4],4'h0}),
621 5 robfinch
        .rdat(ch6ob.dat),
622
        .hit(ch6_hit_s)
623
);
624
 
625
mpmc10_strm_read_cache ustrm7
626
(
627
        .rst(rst),
628
        .wclk(mem_ui_clk),
629
        .wr(uch==4'd7 && rd_data_valid_r),
630
        .wadr({app_waddr[31:4],4'h0}),
631
        .wdat(rd_data_r),
632 11 robfinch
        .inv(1'b0),
633 5 robfinch
        .rclk(mem_ui_clk),
634
        .rd(ch7is.stb & ~ch7is.we),
635 11 robfinch
        .radr({ch7is.padr[31:4],4'h0}),
636 5 robfinch
        .rdat(ch7ob.dat),
637
        .hit(ch7_hit_s)
638
);
639
 
640
always_comb     ch0ob.ack = ch0_hit_s & ch0i.stb;
641
always_comb     ch1ob.ack = ch1_hit_s & ch1i.stb;
642
always_comb     ch2ob.ack = ch2_hit_s & ch2i.stb;
643
always_comb     ch3ob.ack = ch3_hit_s & ch3i.stb;
644
always_comb     ch4ob.ack = ch4_hit_s & ch4i.stb;
645
always_comb     ch5ob.ack = ch5_hit_s & ch5i.stb;
646
always_comb     ch6ob.ack = ch6_hit_s & ch6i.stb;
647
always_comb     ch7ob.ack = ch7_hit_s & ch7i.stb;
648
 
649
wire [7:0] sel;
650
wire rd_rst_busy;
651
wire wr_rst_busy;
652
wire cd_sel;
653 7 robfinch
change_det #(.WID(8)) ucdsel (.rst(rst), .ce(1'b1), .clk(mem_ui_clk), .i(sel), .cd(cd_sel));
654 5 robfinch
 
655
always_comb     //ff @(posedge mem_ui_clk)
656
        wr_fifo = |sel & ~almost_full & ~wr_rst_busy & cd_sel;
657
 
658
roundRobin rr1
659
(
660
        .rst(rst),
661
        .clk(mem_ui_clk),
662
        .ce(1'b1),//~|req || chack[req_sel]),
663
        .req(req),
664
        .lock(8'h00),
665
        .sel(sel),
666
        .sel_enc(req_sel)
667
);
668
 
669
always_comb
670
        case(req_sel)
671
        4'd0:   req_fifoi <= STREAM0 ? ch0is2 : ch0is;
672
        4'd1:   req_fifoi <= STREAM1 ? ch1is2 : ch1is;
673
        4'd2:   req_fifoi <= STREAM2 ? ch2is2 : ch2is;
674
        4'd3:   req_fifoi <= STREAM3 ? ch3is2 : ch3is;
675
        4'd4:   req_fifoi <= STREAM4 ? ch4is2 : ch4is;
676
        4'd5:   req_fifoi <= STREAM5 ? ch5is2 : ch5is;
677
        4'd6:   req_fifoi <= STREAM6 ? ch6is2 : ch6is;
678
        4'd7:   req_fifoi <= STREAM7 ? ch7is2 : ch7is;
679 7 robfinch
        default:
680
                begin
681
                        req_fifoi <= 'd0;
682
                        req_fifoi.cid <= 4'd15;
683
                end
684 5 robfinch
        endcase
685
 
686
mpmc10_fifo ufifo1
687
(
688
        .rst(rst),
689
        .clk(mem_ui_clk),
690
        .rd_fifo(rd_fifo),
691
        .wr_fifo(wr_fifo),
692
        .req_fifoi(req_fifoi),
693
        .req_fifoo(req_fifoo),
694
        .v(v),
695
        .full(full),
696
        .empty(empty),
697
        .almost_full(almost_full),
698
        .rd_rst_busy(rd_rst_busy),
699
        .wr_rst_busy(wr_rst_busy),
700
        .cnt(cnt)
701
);
702
 
703
always_comb
704 7 robfinch
        uch <= fifoo.cid;
705 5 robfinch
always_comb
706 7 robfinch
        num_strips <= fifoo.blen;
707 5 robfinch
always_comb
708 11 robfinch
        adr <= fifoo.padr;
709 5 robfinch
 
710
wire [2:0] app_addr3;   // dummy to make up 32-bits
711
 
712
mpmc10_addr_gen uag1
713
(
714
        .rst(mem_ui_rst),
715
        .clk(mem_ui_clk),
716
        .state(state),
717
        .rdy(app_rdy),
718
        .num_strips(num_strips),
719
        .strip_cnt(req_strip_cnt),
720
        .addr_base(adr),
721
        .addr({app_addr3,app_addr})
722
);
723
 
724
mpmc10_waddr_gen uwag1
725
(
726
        .rst(mem_ui_rst),
727
        .clk(mem_ui_clk),
728
        .state(state),
729
        .valid(rd_data_valid_r),
730
        .num_strips(num_strips),
731
        .strip_cnt(resp_strip_cnt),
732
        .addr_base(adr),
733
        .addr(app_waddr)
734
);
735
 
736
mpmc10_mask_select unsks1
737
(
738
        .rst(mem_ui_rst),
739
        .clk(mem_ui_clk),
740
        .state(state),
741 10 robfinch
        .we(fifoo.we),
742
        .wmask(req_fifoo.sel[15:0]),
743 5 robfinch
        .mask(app_wdf_mask),
744
        .mask2(mem_wdf_mask2)
745
);
746
 
747 11 robfinch
wire [127:0] data128a;
748
wire [127:0] data128b;
749
 
750 5 robfinch
mpmc10_data_select #(.WID(128)) uds1
751
(
752
        .clk(mem_ui_clk),
753
        .state(state),
754 11 robfinch
        .dati1(req_fifoo.data1),
755
        .dati2(req_fifoo.data2),
756
        .dato1(data128a),
757
        .dato2(data128b)
758 5 robfinch
);
759
 
760 11 robfinch
reg rmw_hit;
761
reg rmw_ack;
762
reg [127:0] opa, opa1, opb, opc, t1;
763
reg [127:0] rmw_dat;
764
`ifdef SUPPORT_AMO
765 5 robfinch
always_comb
766 11 robfinch
        case(req_fifoo.cid)
767
        4'd0:   rmw_hit = hit0;
768
        4'd1:   rmw_hit = hit1;
769
        4'd2:   rmw_hit = hit2;
770
        4'd3:   rmw_hit = hit3;
771
        4'd4:   rmw_hit = hit4;
772
        4'd5:   rmw_hit = hit5;
773
        4'd6:   rmw_hit = hit6;
774
        4'd7:   rmw_hit = hit7;
775
        default:        rmw_hit = 1'b1;
776
        endcase
777
always_ff @(posedge mem_ui_clk)
778
        opb <= data128a >> {req_fifoo.padr[4:0],3'b0};
779
always_ff @(posedge mem_ui_clk)
780
        opc <= data128b >> {req_fifoo.padr[4:0],3'b0};
781
always_ff @(posedge mem_ui_clk)
782
        case(req_fifoo.cid)
783
        4'd0:   opa1 <= ch0oa.dat;
784
        4'd1:   opa1 <= ch1oa.dat;
785
        4'd2:   opa1 <= ch2oa.dat;
786
        4'd3:   opa1 <= ch3oa.dat;
787
        4'd4:   opa1 <= ch4oa.dat;
788
        4'd5:   opa1 <= ch5oa.dat;
789
        4'd6:   opa1 <= ch6oa.dat;
790
        4'd7:   opa1 <= ch7oa.dat;
791
        default:        opa1 <= 'd0;
792
        endcase
793
always_ff @(posedge mem_ui_clk)
794
        opa <= opa1 >> {req_fifoo.padr[4:0],3'b0};
795
always_ff @(posedge mem_ui_clk)
796
case(req_fifoo.sz)
797
`ifdef SUPPORT_AMO_TETRA
798
wishbone_pkg::tetra:
799
        case(req_fifoo.cmd)
800
        CMD_ADD:        t1 <= opa[31:0] + opb[31:0];
801
        CMD_AND:        t1 <= opa[31:0] & opb[31:0];
802
        CMD_OR:         t1 <= opa[31:0] | opb[31:0];
803
        CMD_EOR:        t1 <= opa[31:0] ^ opb[31:0];
804
`ifdef SUPPORT_AMO_SHIFT
805
        CMD_ASL:        t1 <= {opa[30:0],1'b0};
806
        CMD_LSR:        t1 <= {1'b0,opa[31:1]};
807
        CMD_ROL:        t1 <= {opa[30:0],opa[31]};
808
        CMD_ROR:        t1 <= {opa[0],opa[31:1]};
809
`endif
810
`ifdef SUPPORT_AMO_MULTI_SHIFT
811
        CMD_ASL:        t1 <= opa[31:0] << opb[4:0];
812
        CMD_LSR:        t1 <= opa[31:0] >> opb[4:0];
813
`endif
814
        CMD_MINU:       t1 <= opa[31:0] < opb[31:0] ? opa[31:0] : opb[31:0];
815
        CMD_MAXU:       t1 <= opa[31:0] > opb[31:0] ? opa[31:0] : opb[31:0];
816
        CMD_MIN:        t1 <= $signed(opa[31:0]) < $signed(opb[31:0]) ? opa[31:0] : opb[31:0];
817
        CMD_MAX:        t1 <= $signed(opa[31:0]) > $signed(opb[31:0]) ? opa[31:0] : opb[31:0];
818
        CMD_CAS:        t1 <= opa[31:0]==opb[31:0] ? opc[31:0] : opb[31:0];
819
        default:        t1 <= opa[31:0];
820
        endcase
821
`endif
822
`ifdef SUPPORT_AMO_OCTA
823
wishbone_pkg::octa:
824
        case(req_fifoo.cmd)
825
        CMD_ADD:        t1 <= opa[63:0] + opb[63:0];
826
        CMD_AND:        t1 <= opa[63:0] & opb[63:0];
827
        CMD_OR:         t1 <= opa[63:0] | opb[63:0];
828
        CMD_EOR:        t1 <= opa[63:0] ^ opb[63:0];
829
`ifdef SUPPORT_AMO_SHIFT
830
        CMD_ASL:        t1 <= {opa[62:0],1'b0};
831
        CMD_LSR:        t1 <= {1'b0,opa[63:1]};
832
        CMD_ROL:        t1 <= {opa[62:0],opa[63]};
833
        CMD_ROR:        t1 <= {opa[0],opa[63:1]};
834
`endif
835
`ifdef SUPPORT_AMO_MULTI_SHIFT
836
        CMD_ASL:        t1 <= opa[63:0] << opb[5:0];
837
        CMD_LSR:        t1 <= opa[63:0] >> opb[5:0];
838
`endif
839
        CMD_MINU:       t1 <= opa[63:0] < opb[63:0] ? opa[63:0] : opb[63:0];
840
        CMD_MAXU:       t1 <= opa[63:0] > opb[63:0] ? opa[63:0] : opb[63:0];
841
        CMD_MIN:        t1 <= $signed(opa[63:0]) < $signed(opb[63:0]) ? opa[63:0] : opb[63:0];
842
        CMD_MAX:        t1 <= $signed(opa[63:0]) > $signed(opb[63:0]) ? opa[63:0] : opb[63:0];
843
        CMD_CAS:        t1 <= opa[63:0]==opb[63:0] ? opc[63:0] : opb[63:0];
844
        default:        t1 <= opa[63:0];
845
        endcase
846
`endif
847
default:
848
        case(req_fifoo.cmd)
849
        CMD_ADD:        t1 <= opa[127:0] + opb[127:0];
850
        CMD_AND:        t1 <= opa[127:0] & opb[127:0];
851
        CMD_OR:         t1 <= opa[127:0] | opb[127:0];
852
        CMD_EOR:        t1 <= opa[127:0] ^ opb[127:0];
853
`ifdef SUPPORT_AMO_SHIFT
854
        CMD_ASL:        t1 <= {opa[126:0],1'b0};
855
        CMD_LSR:        t1 <= {1'b0,opa[127:1]};
856
        CMD_ROL:        t1 <= {opa[126:0],opa[127]};
857
        CMD_ROR:        t1 <= {opa[0],opa[127:1]};
858
`endif
859
`ifdef SUPPORT_AMO_MULTI_SHIFT
860
        CMD_ASL:        t1 <= opa[127:0] << opb[6:0];
861
        CMD_LSR:        t1 <= opa[127:0] >> opb[6:0];
862
`endif
863
        CMD_MINU:       t1 <= opa[127:0] < opb[127:0] ? opa[127:0] : opb[127:0];
864
        CMD_MAXU:       t1 <= opa[127:0] > opb[127:0] ? opa[127:0] : opb[127:0];
865
        CMD_MIN:        t1 <= $signed(opa[127:0]) < $signed(opb[127:0]) ? opa[127:0] : opb[127:0];
866
        CMD_MAX:        t1 <= $signed(opa[127:0]) > $signed(opb[127:0]) ? opa[127:0] : opb[127:0];
867
        CMD_CAS:        t1 <= opa[127:0]==opb[127:0] ? opc[127:0] : opb[127:0];
868
        default:        t1 <= opa[127:0];
869
        endcase
870
endcase
871
always_ff @(posedge mem_ui_clk)
872
        rmw_dat <= t1 << {req_fifoo.padr[4:0],3'b0};
873 5 robfinch
 
874 11 robfinch
always_ff @(posedge mem_ui_clk)
875
if (mem_ui_rst) begin
876
        ch0oc.dat <= 'd0;
877
        ch1oc.dat <= 'd0;
878
        ch2oc.dat <= 'd0;
879
        ch3oc.dat <= 'd0;
880
        ch4oc.dat <= 'd0;
881
        ch5oc.dat <= 'd0;
882
        ch6oc.dat <= 'd0;
883
        ch7oc.dat <= 'd0;
884
end
885
else begin
886
if (state==WRITE_TRAMP1)
887
        case(req_fifoo.cid)
888
        4'd0:   ch0oc.dat <= opa;
889
        4'd1:   ch1oc.dat <= opa;
890
        4'd2:   ch2oc.dat <= opa;
891
        4'd3:   ch3oc.dat <= opa;
892
        4'd4:   ch4oc.dat <= opa;
893
        4'd5:   ch5oc.dat <= opa;
894
        4'd6:   ch6oc.dat <= opa;
895
        4'd7:   ch7oc.dat <= opa;
896
        default:        ;
897
        endcase
898
end
899
always_ff @(posedge mem_ui_clk)
900
if (mem_ui_rst)
901
        rmw_ack <= 1'b0;
902
else begin
903
        if (state==WRITE_TRAMP1)
904
                rmw_ack <= 1'b1;
905
        else if (state==IDLE)
906
                rmw_ack <= 1'b0;
907
end
908
always_comb     ch0oc.ack = ch0i.stb & rmw_ack & rmw0 && req_fifoo.cid==4'd0;
909
always_comb     ch1oc.ack = ch1i.stb & rmw_ack & rmw1 && req_fifoo.cid==4'd1;
910
always_comb     ch2oc.ack = ch2i.stb & rmw_ack & rmw2 && req_fifoo.cid==4'd2;
911
always_comb     ch3oc.ack = ch3i.stb & rmw_ack & rmw3 && req_fifoo.cid==4'd3;
912
always_comb     ch4oc.ack = ch4i.stb & rmw_ack & rmw4 && req_fifoo.cid==4'd4;
913
always_comb     ch5oc.ack = ch5i.stb & rmw_ack & rmw5 && req_fifoo.cid==4'd5;
914
always_comb     ch6oc.ack = ch6i.stb & rmw_ack & rmw6 && req_fifoo.cid==4'd6;
915
always_comb     ch7oc.ack = ch7i.stb & rmw_ack & rmw7 && req_fifoo.cid==4'd7;
916
`endif
917
 
918 5 robfinch
// Setting the data value. Unlike reads there is only a single strip involved.
919
// Force unselected byte lanes to $FF
920
reg [127:0] dat128x;
921
generate begin
922
        for (g = 0; g < 16; g = g + 1)
923
                always_comb
924
                        if (mem_wdf_mask2[g])
925
                                dat128x[g*8+7:g*8] = 8'hFF;
926
                        else
927 11 robfinch
                                dat128x[g*8+7:g*8] = data128a[g*8+7:g*8];
928 5 robfinch
end
929
endgenerate
930
 
931
always_ff @(posedge mem_ui_clk)
932
if (mem_ui_rst)
933
  app_wdf_data <= 128'd0;
934
else begin
935 7 robfinch
        if (state==PRESET3)
936 5 robfinch
                app_wdf_data <= dat128x;
937 11 robfinch
        else if (state==WRITE_TRAMP1)
938
                app_wdf_data <= rmw_dat;
939 5 robfinch
end
940
 
941 7 robfinch
mpmc10_rd_fifo_gen urdf1
942
(
943
        .rst(rst|mem_ui_rst),
944
        .clk(mem_ui_clk),
945
        .state(state),
946
        .empty(empty),
947
        .rd_rst_busy(rd_rst_busy),
948
        .calib_complete(calib_complete),
949
        .rd(rd_fifo)
950
);
951 5 robfinch
 
952 7 robfinch
always_ff @(posedge mem_ui_clk)
953
if (rst)
954
        fifo_mask <= 'd0;
955
else begin
956
        if (rd_fifo)
957
                fifo_mask <= {$bits(fifo_mask){1'b1}};
958
        else if (state==IDLE)
959
                fifo_mask <= 'd0;
960
end
961
 
962 5 robfinch
mpmc10_state_machine_wb usm1
963
(
964
        .rst(rst|mem_ui_rst),
965
        .clk(mem_ui_clk),
966 7 robfinch
        .calib_complete(calib_complete),
967 5 robfinch
        .to(tocnt[9]),
968
        .rdy(app_rdy),
969
        .wdf_rdy(app_wdf_rdy),
970
        .fifo_empty(empty),
971
        .rd_rst_busy(rd_rst_busy),
972
        .fifo_out(req_fifoo),
973
        .state(state),
974
        .num_strips(num_strips),
975
        .req_strip_cnt(req_strip_cnt),
976
        .resp_strip_cnt(resp_strip_cnt),
977 11 robfinch
        .rd_data_valid(rd_data_valid_r),
978
        .rmw_hit(rmw_hit)
979 5 robfinch
);
980
 
981
mpmc10_to_cnt utoc1
982
(
983
        .clk(mem_ui_clk),
984
        .state(state),
985
        .prev_state(prev_state),
986
        .to_cnt(tocnt)
987
);
988
 
989
mpmc10_prev_state upst1
990
(
991
        .clk(mem_ui_clk),
992
        .state(state),
993
        .prev_state(prev_state)
994
);
995
 
996
mpmc10_app_en_gen ueng1
997
(
998
        .clk(mem_ui_clk),
999
        .state(state),
1000
        .rdy(app_rdy),
1001
        .strip_cnt(req_strip_cnt),
1002
        .num_strips(num_strips),
1003
        .en(app_en)
1004
);
1005
 
1006
mpmc10_app_cmd_gen ucg1
1007
(
1008
        .clk(mem_ui_clk),
1009
        .state(state),
1010
        .cmd(app_cmd)
1011
);
1012
 
1013
mpmc10_app_wdf_wren_gen uwreng1
1014
(
1015
        .clk(mem_ui_clk),
1016
        .state(state),
1017
        .rdy(app_wdf_rdy),
1018
        .wren(app_wdf_wren)
1019
);
1020
 
1021
mpmc10_app_wdf_end_gen uwendg1
1022
(
1023
        .clk(mem_ui_clk),
1024
        .state(state),
1025
        .rdy(app_wdf_rdy),
1026
        .strip_cnt(req_strip_cnt),
1027
        .num_strips(num_strips),
1028
        .wend(app_wdf_end)
1029
);
1030
 
1031
mpmc10_req_strip_cnt ursc1
1032
(
1033
        .clk(mem_ui_clk),
1034
        .state(state),
1035
        .wdf_rdy(app_wdf_rdy),
1036
        .rdy(app_rdy),
1037
        .num_strips(num_strips),
1038
        .strip_cnt(req_strip_cnt)
1039
);
1040
 
1041
mpmc10_resp_strip_cnt urespsc1
1042
(
1043
        .clk(mem_ui_clk),
1044
        .state(state),
1045
        .valid(rd_data_valid_r),
1046
        .num_strips(num_strips),
1047
        .strip_cnt(resp_strip_cnt)
1048
);
1049
 
1050
// Reservation status bit
1051
mpmc10_resv_bit ursb1
1052
(
1053
        .clk(mem_ui_clk),
1054
        .state(state),
1055 7 robfinch
        .wch(fifoo.cid),
1056
        .we(fifoo.stb & fifoo.we),
1057
        .cr(fifoo.csr & fifoo.we),
1058 11 robfinch
        .adr(fifoo.padr),
1059 5 robfinch
        .resv_ch(resv_ch),
1060
        .resv_adr(resv_adr),
1061
        .rb(rb1)
1062
);
1063
 
1064
mpmc10_addr_resv_man #(.NAR(NAR)) ursvm1
1065
(
1066
        .rst(mem_ui_rst),
1067
        .clk(mem_ui_clk),
1068
        .state(state),
1069
        .adr0(32'h0),
1070 11 robfinch
        .adr1(ch1is.padr),
1071
        .adr2(ch2is.padr),
1072
        .adr3(ch3is.padr),
1073
        .adr4(ch4is.padr),
1074 5 robfinch
        .adr5(32'h0),
1075 11 robfinch
        .adr6(ch6is.padr),
1076
        .adr7(ch7is.padr),
1077 5 robfinch
        .sr0(1'b0),
1078
        .sr1(ch1is.csr & ch1is.stb & ~ch1is.we),
1079
        .sr2(ch2is.csr & ch2is.stb & ~ch2is.we),
1080
        .sr3(ch3is.csr & ch3is.stb & ~ch3is.we),
1081
        .sr4(ch4is.csr & ch4is.stb & ~ch4is.we),
1082
        .sr5(1'b0),
1083
        .sr6(ch6is.csr & ch6is.stb & ~ch6is.we),
1084
        .sr7(ch7is.csr & ch7is.stb & ~ch7is.we),
1085 7 robfinch
        .wch(fifoo.stb ? fifoo.cid : 4'd15),
1086
        .we(fifoo.stb & fifoo.we),
1087 11 robfinch
        .wadr(fifoo.padr),
1088 7 robfinch
        .cr(fifoo.csr & fifoo.stb & fifoo.we),
1089 5 robfinch
        .resv_ch(resv_ch),
1090
        .resv_adr(resv_adr)
1091
);
1092
 
1093
endmodule

powered by: WebSVN 2.1.0

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