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

Subversion Repositories wf3d

[/] [wf3d/] [trunk/] [implement/] [rtl/] [zedboard/] [zq_top.v] - Blame information for rev 8

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 specular
//=======================================================================
2
// Project Monophony
3
//   Wire-Frame 3D Graphics Accelerator IP Core
4
//
5
// File:
6
//   zq_top.v
7
//
8
// Abstract:
9
//   wf3d AXI top module for ZedBoard
10
//
11
// Author:
12
//   Kenji Ishimaru (info.wf3d@gmail.com)
13
//
14
//======================================================================
15
//
16
// Copyright (c) 2016, Kenji Ishimaru
17
// All rights reserved.
18
//
19
// Redistribution and use in source and binary forms, with or without
20
// modification, are permitted provided that the following conditions are met:
21
//
22
//  -Redistributions of source code must retain the above copyright notice,
23
//   this list of conditions and the following disclaimer.
24
//  -Redistributions in binary form must reproduce the above copyright notice,
25
//   this list of conditions and the following disclaimer in the documentation
26
//   and/or other materials provided with the distribution.
27
//
28
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
30
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
31
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
35
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
36
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
37
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
38
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
//
40
// Revision History
41
 
42
module zq_top (
43
  // system
44
  clk_core,
45
  rst_x,
46
  o_int,
47
  // AXI Slave
48
  //   write port
49
  i_awid_s,
50
  i_awaddr_s,
51
  i_awlen_s,
52
  i_awsize_s,
53
  i_awburst_s,
54
  i_awlock_s,
55
  i_awcache_s,
56
  i_awprot_s,
57
  i_awvalid_s,
58
  o_awready_s,
59
  i_wid_s,
60
  i_wdata_s,
61
  i_wstrb_s,
62
  i_wlast_s,
63
  i_wvalid_s,
64
  o_wready_s,
65
  o_bid_s,
66
  o_bresp_s,
67
  o_bvalid_s,
68
  i_bready_s,
69
  //   read port
70
  i_arid_s,
71
  i_araddr_s,
72
  i_arlen_s,
73
  i_arsize_s,
74
  i_arburst_s,
75
  i_arlock_s,
76
  i_arcache_s,
77
  i_arprot_s,
78
  i_arvalid_s,
79
  o_arready_s,
80
  o_rid_s,
81
  o_rdata_s,
82
  o_rresp_s,
83
  o_rlast_s,
84
  o_rvalid_s,
85
  i_rready_s,
86
  // AXI Master
87
  o_awid_m,
88
  o_awaddr_m,
89
  o_awlen_m,
90
  o_awsize_m,
91
  o_awburst_m,
92
  o_awlock_m,
93
  o_awcache_m,
94
  o_awuser_m,
95
  o_awprot_m,
96
  o_awvalid_m,
97
  i_awready_m,
98
  o_wid_m,
99
  o_wdata_m,
100
  o_wstrb_m,
101
  o_wlast_m,
102
  o_wvalid_m,
103
  i_wready_m,
104
  i_bid_m,
105
  i_bresp_m,
106
  i_bvalid_m,
107
  o_bready_m,
108
  o_arid_m,
109
  o_araddr_m,
110
  o_arlen_m,
111
  o_arsize_m,
112
  o_arburst_m,
113
  o_arlock_m,
114
  o_arcache_m,
115
  o_aruser_m,
116
  o_arprot_m,
117
  o_arvalid_m,
118
  i_arready_m,
119
  i_rid_m,
120
  i_rdata_m,
121
  i_rresp_m,
122
  i_rlast_m,
123
  i_rvalid_m,
124
  o_rready_m,
125
  // Video out
126
  clk_v,
127
  o_blank_x,
128
  o_hsync_x,
129
  o_vsync_x,
130
  o_vr,
131
  o_vg,
132
  o_vb
133
);
134
`include "polyphony_axi_def.v"
135
//////////////////////////////////
136
// I/O port definition
137
//////////////////////////////////
138
  // system
139
  input clk_core;
140
  input rst_x;
141
  output o_int;
142
  // AXI Slave
143
  //   write port
144
  input [P_AXI_S_AWID-1:0] i_awid_s;
145
  input [P_AXI_S_AWADDR-1:0] i_awaddr_s;
146
  input [P_AXI_S_AWLEN-1:0] i_awlen_s;
147
  input [P_AXI_S_AWSIZE-1:0] i_awsize_s;
148
  input [P_AXI_S_AWBURST-1:0] i_awburst_s;
149
  input [P_AXI_S_AWLOCK-1:0] i_awlock_s;
150
  input [P_AXI_S_AWCACHE-1:0] i_awcache_s;
151
  input [P_AXI_S_AWPROT-1:0] i_awprot_s;
152
  input i_awvalid_s;
153
  output o_awready_s;
154
  input [P_AXI_S_WID-1:0] i_wid_s;
155
  input [P_AXI_S_WDATA-1:0] i_wdata_s;
156
  input [P_AXI_S_WSTRB-1:0] i_wstrb_s;
157
  input i_wlast_s;
158
  input i_wvalid_s;
159
  output o_wready_s;
160
  output [P_AXI_S_BID-1:0] o_bid_s;
161
  output [P_AXI_S_BRESP-1:0] o_bresp_s;
162
  output o_bvalid_s;
163
  input i_bready_s;
164
  //   read port
165
  input [P_AXI_S_ARID-1:0] i_arid_s;
166
  input [P_AXI_S_ARADDR-1:0] i_araddr_s;
167
  input [P_AXI_S_ARLEN-1:0] i_arlen_s;
168
  input [P_AXI_S_ARSIZE-1:0] i_arsize_s;
169
  input [P_AXI_S_ARBURST-1:0] i_arburst_s;
170
  input [P_AXI_S_ARLOCK-1:0] i_arlock_s;
171
  input [P_AXI_S_ARCACHE-1:0] i_arcache_s;
172
  input [P_AXI_S_ARPROT-1:0] i_arprot_s;
173
  input i_arvalid_s;
174
  output o_arready_s;
175
  output [P_AXI_S_RID-1:0] o_rid_s;
176
  output [P_AXI_S_RDATA-1:0] o_rdata_s;
177
  output [P_AXI_S_RRESP-1:0] o_rresp_s;
178
  output o_rlast_s;
179
  output o_rvalid_s;
180
  input i_rready_s;
181
  // AXI Master
182
  output [P_AXI_M_AWID-1:0] o_awid_m;
183
  output [P_AXI_M_AWADDR-1:0] o_awaddr_m;
184
  output [P_AXI_M_AWLEN-1:0] o_awlen_m;
185
  output [P_AXI_M_AWSIZE-1:0] o_awsize_m;
186
  output [P_AXI_M_AWBURST-1:0] o_awburst_m;
187
  output [P_AXI_M_AWLOCK-1:0] o_awlock_m;
188
  output [P_AXI_M_AWCACHE-1:0] o_awcache_m;
189
  output [P_AXI_M_AWUSER-1:0] o_awuser_m;
190
  output [P_AXI_M_AWPROT-1:0] o_awprot_m;
191
  output o_awvalid_m;
192
  input i_awready_m;
193
  output [P_AXI_M_WID-1:0] o_wid_m;
194
  output [P_AXI_M_WDATA-1:0] o_wdata_m;
195
  output [P_AXI_M_WSTRB-1:0] o_wstrb_m;
196
  output o_wlast_m;
197
  output o_wvalid_m;
198
  input i_wready_m;
199
  input [P_AXI_M_BID-1:0] i_bid_m;
200
  input [P_AXI_M_BRESP-1:0] i_bresp_m;
201
  input i_bvalid_m;
202
  output o_bready_m;
203
  output [P_AXI_M_ARID-1:0] o_arid_m;
204
  output [P_AXI_M_ARADDR-1:0] o_araddr_m;
205
  output [P_AXI_M_ARLEN-1:0] o_arlen_m;
206
  output [P_AXI_M_ARSIZE-1:0] o_arsize_m;
207
  output [P_AXI_M_ARBURST-1:0] o_arburst_m;
208
  output [P_AXI_M_ARLOCK-1:0] o_arlock_m;
209
  output [P_AXI_M_ARCACHE-1:0] o_arcache_m;
210
  output [P_AXI_M_ARUSER-1:0] o_aruser_m;
211
  output [P_AXI_M_ARPROT-1:0] o_arprot_m;
212
  output o_arvalid_m;
213
  input i_arready_m;
214
  input [P_AXI_M_RID-1:0] i_rid_m;
215
  input [P_AXI_M_RDATA-1:0] i_rdata_m;
216
  input [P_AXI_M_RRESP-1:0] i_rresp_m;
217
  input i_rlast_m;
218
  input i_rvalid_m;
219
  output o_rready_m;
220
  // Video out
221
  input clk_v;
222
  output o_blank_x;
223
  output o_hsync_x;
224
  output o_vsync_x;
225
  output [7:0] o_vr;
226
  output [7:0] o_vg;
227
  output [7:0] o_vb;
228
 
229
//////////////////////////////////
230
// wire
231
//////////////////////////////////
232
    // axi master - Memory interconenct
233
    wire           w_brg_req;
234
    wire  [P_IB_ADDR_WIDTH-1:0] w_brg_adrs;
235
    wire  [1:0]    w_brg_id;
236
    wire           w_brg_wr;
237
    wire  [P_IB_LEN_WIDTH-1:0]  w_brg_len;
238
    wire           w_brg_ack;
239
    wire           w_brg_wstr;
240
    wire  [P_IB_BE_WIDTH-1:0]   w_brg_be;
241
    wire  [P_IB_DATA_WIDTH-1:0] w_brg_wdata;
242
    wire           w_brg_wack;
243
    wire           w_brg_rstr;
244
    wire           w_brg_rlast;
245
    wire  [1:0]    w_brg_rid;
246
    wire  [P_IB_DATA_WIDTH-1:0] w_brg_rdata;
247
    // axi slave bus - request dispatcher
248
    wire           w_req_axi_s;
249
    wire           w_wr_axi_s;
250
    wire  [23:0]   w_adrs_axi_s;
251
    wire           w_ack_axi_s;
252
    wire  [3:0]    w_be_axi_s;
253
    wire  [31:0]   w_wd_axi_s;
254
    wire           w_rstr_axi_s;
255
    wire  [31:0]   w_rd_axi_s;
256
    // pci - request dispatcher
257
    wire           w_req_pci;
258
    wire           w_wr_pci;
259
    wire  [31:0]   w_adrs_pci;
260
    wire           w_ack_pci;
261
    wire  [3:0]    w_be_pci;
262
    wire  [31:0]   w_wd_pci;
263
    wire  [31:0]   w_rd_pci;
264
    // request dispatcher - System controller
265
    wire           w_req_sys;
266
    wire           w_wr_wr_s3;
267
    wire  [21:0]   w_wr_adrs_s3;
268
    wire           w_ack_sys;
269
    wire  [3:0]    w_wr_be_s3;
270
    wire  [31:0]   w_wr_wdata_s3;
271
    wire           w_rstr_sys;
272
    wire  [31:0]   w_rdata_sys;
273
 
274
    wire           w_dma_start;
275
    wire   [3:0]   w_dma_mode;
276
    wire           w_dma_end;
277
    wire   [19:0]  w_dma_top_address0;
278
    wire   [19:0]  w_dma_top_address1;
279
    wire   [19:0]  w_dma_top_address2;
280
    wire   [19:0]  w_dma_top_address3;
281
    wire   [17:0]  w_dma_length;
282
    wire   [3:0]   w_dma_be;
283
    wire   [31:0]  w_dma_wd0;
284
    wire   [31:0]  w_dma_wd1;
285
    // sdram interface
286
    wire           w_req_mem;
287
    wire           w_wr_mem;
288
    wire   [P_IB_ADDR_WIDTH-1:0] w_adrs_mem;
289
    wire   [P_IB_LEN_WIDTH-1:0]  w_len_mem;
290
    wire           w_ack_mem;
291
    wire           w_strw_mem;
292
    wire   [P_IB_BE_WIDTH-1:0]   w_be_mem;
293
    wire   [P_IB_DATA_WIDTH-1:0] w_wd_mem;
294
    wire           w_ackw_mem;
295
    // request dispatcher - 3D graphics core
296
    wire           w_req_3d;
297
    wire           w_ack_3d;
298
    wire           w_rstr_3d;
299
    wire  [31:0]   w_rdata_3d;
300
    // 3D graphics - memory interconnect
301
    wire           w_wr_req1;
302
    wire           w_wr_wr1;
303
//    wire  [P_IB_ADDR_WIDTH-1:0] w_wr_adrs1;
304
    wire  [31:0] w_wr_adrs1;
305
    wire  [2:0]  w_wr_len1;
306
    wire           w_wr_ack1;
307
    wire  [3:0]   w_wr_be1;
308
    wire  [31:0] w_wr_wdata1;
309
    wire           w_wr_rstr1;
310
    wire  [31:0] w_wr_rdata1;
311
    // 3D graphics - system controller
312
    wire           w_vtx_int;
313
    // 3D graphics vertex fetsh
314
    wire           w_req_dma;
315
    wire  [P_IB_ADDR_WIDTH-1:0] w_adrs_dma;
316
    wire  [P_IB_LEN_WIDTH-1:0]  w_len_dma;
317
    wire           w_ack_dma;
318
    wire           w_strr_dma;
319
    wire  [P_IB_DATA_WIDTH-1:0] w_dbr_dma;
320
    // Memory interconnect - video controller
321
    wire           w_r_req2;
322
    wire  [P_IB_ADDR_WIDTH-1:0] w_r_adrs2;
323
    wire  [P_IB_LEN_WIDTH-1:0]  w_r_len2;
324
    wire           w_r_ack2;
325
    wire           w_r_rstr2;
326
    wire  [P_IB_DATA_WIDTH-1:0] w_r_rdata2;
327
    // System controller - video controller
328
    wire  [1:0]    w_video_start;
329
    wire  [11:0]   w_fb0_offset;
330
    wire  [11:0]   w_fb1_offset;
331
    wire  [1:0]    w_color_mode;
332
    wire           w_front_buffer;
333
 
334
    wire           w_init_done;
335
    wire           w_vint_x;
336
    wire           w_vint_edge;
337
 
338
    wire        w_vde;
339
    wire        w_hsync_x;
340
    wire        w_vsync_x;
341
    wire [7:0]  w_vr;
342
    wire [7:0]  w_vg;
343
    wire [7:0]  w_vb;
344
 
345
    // AXI Master configuration
346
    wire [3:0]  w_conf_arcache_m;
347
    wire [4:0]  w_conf_aruser_m;
348
    wire [3:0]  w_conf_awcache_m;
349
    wire [4:0]  w_conf_awuser_m;
350
    // debug
351
    wire           w_idle;
352
    wire  [15:0]   w_ff;
353
    wire  [4:0]    w_fe;
354
    wire           w_la_pin;
355
    wire  [1:0]    w_sh4_state;
356
//////////////////////////////////
357
// assign
358
//////////////////////////////////
359
  assign o_int = ~w_vtx_int;
360
 
361
//////////////////////////////////
362
// module instance
363
//////////////////////////////////
364
 
365
// AXI Slave I/F
366
fm_axi_s u_axi_s (
367
  // system
368
  .clk_core(clk_core),
369
  .rst_x(rst_x),
370
  // AXI write port
371
  .i_awid_s(i_awid_s),
372
  .i_awaddr_s(i_awaddr_s),
373
  .i_awlen_s(i_awlen_s),
374
  .i_awsize_s(i_awsize_s),
375
  .i_awburst_s(i_awburst_s),
376
  .i_awlock_s(i_awlock_s),
377
  .i_awcache_s(i_awcache_s),
378
  .i_awprot_s(i_awprot_s),
379
  .i_awvalid_s(i_awvalid_s),
380
  .o_awready_s(o_awready_s),
381
  .i_wid_s(i_wid_s),
382
  .i_wdata_s(i_wdata_s),
383
  .i_wstrb_s(i_wstrb_s),
384
  .i_wlast_s(i_wlast_s),
385
  .i_wvalid_s(i_wvalid_s),
386
  .o_wready_s(o_wready_s),
387
  .o_bid_s(o_bid_s),
388
  .o_bresp_s(o_bresp_s),
389
  .o_bvalid_s(o_bvalid_s),
390
  .i_bready_s(i_bready_s),
391
  // AXI read port
392
  .i_arid_s(i_arid_s),
393
  .i_araddr_s(i_araddr_s),
394
  .i_arlen_s(i_arlen_s),
395
  .i_arsize_s(i_arsize_s),
396
  .i_arburst_s(i_arburst_s),
397
  .i_arlock_s(i_arlock_s),
398
  .i_arcache_s(i_arcache_s),
399
  .i_arprot_s(i_arprot_s),
400
  .i_arvalid_s(i_arvalid_s),
401
  .o_arready_s(o_arready_s),
402
  .o_rid_s(o_rid_s),
403
  .o_rdata_s(o_rdata_s),
404
  .o_rresp_s(o_rresp_s),
405
  .o_rlast_s(o_rlast_s),
406
  .o_rvalid_s(o_rvalid_s),
407
  .i_rready_s(i_rready_s),
408
  // internal bus
409
  .o_req(w_req_axi_s),
410
  .o_wr(w_wr_axi_s),
411
  .o_adrs(w_adrs_axi_s),
412
  .i_ack(w_ack_axi_s),
413
  .o_be(w_be_axi_s),
414
  .o_wd(w_wd_axi_s),
415
  .i_rstr(w_rstr_axi_s),
416
  .i_rd(w_rd_axi_s)
417
);
418
 
419
// slave request dispatcher
420
fm_dispatch u_dispatch (
421
    .clk_core(clk_core),
422
    .rst_x(rst_x),
423
    // axi slave interface
424
    .i_req(w_req_axi_s),
425
    .i_wr(w_wr_axi_s),
426
    .i_adrs(w_adrs_axi_s),
427
    .o_ack(w_ack_axi_s),
428
    .i_be(w_be_axi_s),
429
    .i_wd(w_wd_axi_s),
430
    .o_rstr(w_rstr_axi_s),
431
    .o_rd(w_rd_axi_s),
432
    // internal side
433
    .o_req_sys(w_req_sys),
434
    .o_req_3d(w_req_3d),
435
    .o_wr(w_wr_wr_s3),
436
    .o_adrs(w_wr_adrs_s3),
437
    .i_ack_sys(w_ack_sys),
438
    .i_ack_3d(w_ack_3d),
439
    .o_be(w_wr_be_s3),
440
    .o_wd(w_wr_wdata_s3),
441
    .i_rstr_sys(w_rstr_sys),
442
    .i_rstr_3d(w_rstr_3d),
443
    .i_rd_sys(w_rdata_sys),
444
    .i_rd_3d(w_rdata_3d)
445
);
446
 
447
// System controller
448
fm_asys u_asys (
449
    .clk_core(clk_core),
450
    .rst_x(rst_x),
451
    // internal interface
452
    .i_req(w_req_sys),
453
    .i_wr(w_wr_wr_s3),
454
    .i_adrs(w_wr_adrs_s3),
455
    .o_ack(w_ack_sys),
456
    .i_be(w_wr_be_s3),
457
    .i_wd(w_wr_wdata_s3),
458
    .o_rstr(w_rstr_sys),
459
    .o_rd(w_rdata_sys),
460
    // configuration output
461
    //   Video controller
462
    .o_video_start(w_video_start),
463
    .o_aa_en(),
464
    .o_fb0_offset(w_fb0_offset),
465
    .o_fb0_ms_offset(),
466
    .o_fb1_offset(w_fb1_offset),
467
    .o_fb1_ms_offset(),
468
    .o_color_mode(w_color_mode),
469
    .o_front_buffer(w_front_buffer),
470
    .o_fb_blend_en(),
471
    // vint
472
    .i_vint_x(w_vint_x),
473
    .i_vint_edge(w_vint_edge),
474
    // vertex dma int
475
    .i_vtx_int(w_vtx_dma),
476
    // int out
477
    .o_int_x(w_vtx_int),
478
    // DMA
479
    .o_dma_start(w_dma_start),
480
    .o_dma_mode(w_dma_mode),
481
    .i_dma_end(w_dma_end),
482
    .o_dma_top_address0(w_dma_top_address0),
483
    .o_dma_top_address1(w_dma_top_address1),
484
    .o_dma_top_address2(w_dma_top_address2),
485
    .o_dma_top_address3(w_dma_top_address3),
486
    .o_dma_length(w_dma_length),
487
    .o_dma_be(w_dma_be),
488
    .o_dma_wd0(w_dma_wd0),
489
    .o_dma_wd1(w_dma_wd1),
490
    // AXI Master configuration
491
    .o_conf_arcache_m(w_conf_arcache_m),
492
    .o_conf_aruser_m(w_conf_aruser_m),
493
    .o_conf_awcache_m(w_conf_awcache_m),
494
    .o_conf_awuser_m(w_conf_awuser_m)
495
);
496
 
497
// DMAC
498
fm_dma u_dma (
499
    .clk_core(clk_core),
500
    .rst_x(rst_x),
501
    // DMA
502
    .i_dma_start(w_dma_start),
503
    .i_dma_mode(w_dma_mode),
504
    .o_dma_end(w_dma_end),
505
    .i_dma_top_address0(w_dma_top_address0),
506
    .i_dma_top_address1(w_dma_top_address1),
507
    .i_dma_top_address2(w_dma_top_address2),
508
    .i_dma_top_address3(w_dma_top_address3),
509
    .i_dma_length(w_dma_length),
510
    .i_dma_be(w_dma_be),
511
    .i_dma_wd0(w_dma_wd0),
512
    .i_dma_wd1(w_dma_wd1),
513
    // memory access
514
    .o_req_mem(w_req_mem),
515
    .o_wr_mem(w_wr_mem),
516
    .o_adrs_mem(w_adrs_mem),
517
    .o_len_mem(w_len_mem),
518
    .i_ack_mem(w_ack_mem),
519
    .o_strw_mem(w_strw_mem),
520
    .o_be_mem(w_be_mem),
521
    .o_wd_mem(w_wd_mem),
522
    .i_ackw_mem(w_ackw_mem)
523
);
524
 
525
// 3D Graphics Core
526
fm_3d_core u_3d_core (
527
  // system
528
  .clk_i(clk_core),
529
  .rst_i(~rst_x),
530
  .int_o(w_vtx_dma),
531
  // Slave I/F
532
  .i_req_s(w_req_3d),
533
  .i_wr_s(w_wr_wr_s3),
534
  .i_adrs_s(w_wr_adrs_s3[7:0]),
535
  .o_ack_s(w_ack_3d),
536
  .i_be_s(w_wr_be_s3),
537
  .i_dbw_s(w_wr_wdata_s3),
538
  .o_strr_s(w_rstr_3d),
539
  .o_dbr_s(w_rdata_3d),
540
  // Master I/F
541
  .o_req_m(w_wr_req1),
542
  .o_wr_m(w_wr_wr1),
543
  .o_adrs_m(w_wr_adrs1),
544
  .o_len_m(w_wr_len1),
545
  .i_ack_m(w_wr_ack1),
546
  .o_be_m(w_wr_be1),
547
  .o_dbw_m(w_wr_wdata1),
548
  .i_strr_m(w_wr_rstr1),
549
  .i_dbr_m(w_wr_rdata1)
550
);
551
 
552
// Memory interconnect
553
fm_mic u_mic (
554
    .clk_core(clk_core),
555
    .rst_x(rst_x),
556
    // write/read port 0 (vertex fetch)
557
    .i_wr_req0(w_req_dma),
558
    .i_wr_wr0(1'b0),
559
    .i_wr_adrs0(w_adrs_dma),
560
    .i_wr_len0(w_len_dma),
561
    .o_wr_ack0(w_ack_dma),
562
    .i_wr_wstr0(1'b0),
563
    .i_wr_be0({P_IB_BE_WIDTH{1'b0}}),
564
    .i_wr_wdata0({P_IB_DATA_WIDTH{1'b0}}),
565
    .o_wr_wack0(),
566
    .o_wr_rstr0(w_strr_dma),
567
    .o_wr_rdata0(w_dbr_dma),
568
    // read/write port 1 (3D read/write)
569
    .i_wr_req1(w_wr_req1),
570
    .i_wr_wr1(w_wr_wr1),
571
    .i_wr_adrs1(w_wr_adrs1),
572
    .i_wr_len1(w_wr_len1),
573
    .o_wr_ack1(w_wr_ack1),
574
    .i_wr_be1(w_wr_be1),
575
    .i_wr_wdata1(w_wr_wdata1),
576
    .o_wr_rstr1(w_wr_rstr1),
577
    .o_wr_rdata1(w_wr_rdata1),
578
    // read port 2 (ctr controller)
579
    .i_r_req2(w_r_req2),
580
    .i_r_adrs2(w_r_adrs2),
581
    .i_r_len2(w_r_len2),
582
    .o_r_ack2(w_r_ack2),
583
    .o_r_rstr2(w_r_rstr2),
584
    .o_r_rdata2(w_r_rdata2),
585
     // write port 3 (DMA write)
586
    .i_wr_req3(w_req_mem),
587
    .i_wr_adrs3(w_adrs_mem),
588
    .i_wr_len3(w_len_mem),
589
    .o_wr_ack3(w_ack_mem),
590
    .i_wr_wstr3(w_strw_mem),
591
    .i_wr_be3(w_be_mem),
592
    .i_wr_wdata3(w_wd_mem),
593
    .o_wr_wack3(w_ackw_mem),
594
    // DIMM Bridge Interface
595
    .o_brg_req(w_brg_req),
596
    .o_brg_wr(w_brg_wr),
597
    .o_brg_id(w_brg_id),
598
    .o_brg_adrs(w_brg_adrs),
599
    .o_brg_len(w_brg_len),
600
    .i_brg_ack(w_brg_ack),
601
    .o_brg_wstr(w_brg_wstr),
602
    .o_brg_be(w_brg_be),
603
    .o_brg_wdata(w_brg_wdata),
604
    .i_brg_wack(w_brg_wack),
605
    .i_brg_rstr(w_brg_rstr),
606
    .i_brg_rlast(w_brg_rlast),
607
    .i_brg_rid(w_brg_rid),
608
    .i_brg_rdata(w_brg_rdata)
609
);
610
 
611
// AXI master bridge
612
fm_axi_m u_axi_m (
613
  .clk_core(clk_core),
614
  .rst_x(rst_x),
615
  // AXI Master configuration
616
  .i_conf_arcache_m(w_conf_arcache_m),
617
  .i_conf_aruser_m(w_conf_aruser_m),
618
  .i_conf_awcache_m(w_conf_awcache_m),
619
  .i_conf_awuser_m(w_conf_awuser_m),
620
  // Local Memory Range
621
  .i_brg_req(w_brg_req),
622
  .i_brg_adrs(w_brg_adrs),
623
  .i_brg_rw(w_brg_wr),
624
  .i_brg_id(w_brg_id),
625
  .i_brg_len(w_brg_len),
626
  .o_brg_ack(w_brg_ack),
627
  .i_brg_wdvalid(w_brg_wstr),
628
  .i_brg_be(w_brg_be),
629
  .i_brg_wdata(w_brg_wdata),
630
  .o_brg_wack(w_brg_wack),
631
  .o_brg_rdvalid(w_brg_rstr),
632
  .o_brg_rlast(w_brg_rlast),
633
  .o_brg_rid(w_brg_rid),
634
  .o_brg_rdata(w_brg_rdata),
635
  .o_init_done(w_init_done),
636
  // AXI write port
637
  .o_awid_m(o_awid_m),
638
  .o_awaddr_m(o_awaddr_m),
639
  .o_awlen_m(o_awlen_m),
640
  .o_awsize_m(o_awsize_m),
641
  .o_awburst_m(o_awburst_m),
642
  .o_awlock_m(o_awlock_m),
643
  .o_awcache_m(o_awcache_m),
644
  .o_awuser_m(o_awuser_m),
645
  .o_awprot_m(o_awprot_m),
646
  .o_awvalid_m(o_awvalid_m),
647
  .i_awready_m(i_awready_m),
648
  .o_wid_m(o_wid_m),
649
  .o_wdata_m(o_wdata_m),
650
  .o_wstrb_m(o_wstrb_m),
651
  .o_wlast_m(o_wlast_m),
652
  .o_wvalid_m(o_wvalid_m),
653
  .i_wready_m(i_wready_m),
654
  .i_bid_m(i_bid_m),
655
  .i_bresp_m(i_bresp_m),
656
  .i_bvalid_m(i_bvalid_m),
657
  .o_bready_m(o_bready_m),
658
  // AXI read port
659
  .o_arid_m(o_arid_m),
660
  .o_araddr_m(o_araddr_m),
661
  .o_arlen_m(o_arlen_m),
662
  .o_arsize_m(o_arsize_m),
663
  .o_arburst_m(o_arburst_m),
664
  .o_arlock_m(o_arlock_m),
665
  .o_arcache_m(o_arcache_m),
666
  .o_aruser_m(o_aruser_m),
667
  .o_arprot_m(o_arprot_m),
668
  .o_arvalid_m(o_arvalid_m),
669
  .i_arready_m(i_arready_m),
670
  .i_rid_m(i_rid_m),
671
  .i_rdata_m(i_rdata_m),
672
  .i_rresp_m(i_rresp_m),
673
  .i_rlast_m(i_rlast_m),
674
  .i_rvalid_m(i_rvalid_m),
675
  .o_rready_m(o_rready_m)
676
);
677
 
678
// Video controller
679
fm_hvc u_hvc (
680
    .clk_core(clk_core),
681
    .clk_vi(clk_v),
682
    .rst_x(rst_x),
683
    // configuration registers
684
    .i_video_start(w_video_start[0]),
685
    .i_fb0_offset(w_fb0_offset),
686
    .i_fb1_offset(w_fb1_offset),
687
    .i_color_mode(w_color_mode),
688
    .i_front_buffer(w_front_buffer),
689
    // status out
690
    .o_vint_x(w_vint_x),
691
    .o_vint_edge(w_vint_edge),
692
    // dram if
693
    .o_req(w_r_req2),
694
    .o_adrs(w_r_adrs2),
695
    .o_len(w_r_len2),
696
    .i_ack(w_r_ack2),
697
    .i_rstr(w_r_rstr2),
698
    .i_rd(w_r_rdata2),
699
    // video out
700
    .clk_vo(clk_vo),
701
    .o_r(w_vr),
702
    .o_g(w_vg),
703
    .o_b(w_vb),
704
    .o_vsync_x(w_vsync_x),
705
    .o_hsync_x(w_hsync_x),
706
    .o_blank_x(w_vde)
707
);
708
assign o_vr = w_vr;
709
assign o_vg = w_vg;
710
assign o_vb = w_vb;
711
assign o_vsync_x = w_vsync_x;
712
assign o_hsync_x = w_hsync_x;
713
assign o_blank_x = w_vde;
714
 
715
endmodule

powered by: WebSVN 2.1.0

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