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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [icarus_version/] [rtl/] [top.v] - Blame information for rev 204

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

Line No. Rev Author Line
1 173 diegovalve
 
2
 
3
/**********************************************************************************
4
Theia, Ray Cast Programable graphic Processing Unit.
5
Copyright (C) 2010  Diego Valverde (diego.valverde.g@gmail.com)
6
 
7
This program is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License
9
as published by the Free Software Foundation; either version 2
10
of the License, or (at your option) any later version.
11
 
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
GNU General Public License for more details.
16
 
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
 
21
***********************************************************************************/
22
 
23
 
24
/*******************************************************************************
25
Module Description:
26
 
27
This is the top module that connects the GPU with the HOST and the HUB/SWITCH.
28
 
29
*******************************************************************************/
30
 
31
 
32
 
33
`timescale 1ns / 1ps
34
`include "aDefinitions.v"
35
`ifdef VERILATOR
36
`include "Theia.v"
37
`endif
38
module top
39
(
40
input wire                        Clock,
41
input wire                        Reset,
42
input wire                        iHostEnable,
43
output wire[`WB_WIDTH-1:0]        oHostReadAddress,
44
input wire[`WB_WIDTH-1:0]         iMemorySize,
45
output wire[1:0]                  oMemSelect,
46
input wire [`WB_WIDTH-1:0]        iInstruction,
47
input wire [`WB_WIDTH-1:0]        iParameter,
48
input wire [`WB_WIDTH-1:0]        iVertex,
49
input wire [`WB_WIDTH-1:0]        iControlRegister,
50
input wire[`WIDTH-1:0]            iPrimitiveCount,
51
input wire [`WB_WIDTH-1:0]        iTMEMAdr,
52
input wire [`WB_WIDTH-1:0]        iTMEMData,
53
input wire                        iTMEM_WE,
54
input wire [`MAX_TMEM_BANKS-1:0]  iTMEM_Sel,
55
input wire  [`MAX_CORE_BITS-1:0]  iOMEMBankSelect,
56
input  wire [`WB_WIDTH-1:0]       iOMEMReadAddress,
57
output wire [`WB_WIDTH-1:0]       oOMEMData,   //Output data bus (Wishbone)
58
`ifndef NO_DISPLAY_STATS
59 178 diegovalve
        input wire [`WIDTH-1:0] iWidth,iHeight,
60 173 diegovalve
`endif
61
output wire                       oDone
62
 
63
 
64
);
65 178 diegovalve
wire wHost_2__RenderDone;
66
assign oDone = wHost_2__RenderDone;
67 173 diegovalve
 
68
assign oMemSelect =  wMemSelect;
69
 
70
 wire [`WB_WIDTH-1:0]       wHost_2__DAT_O;
71
 reg                        wHost_2__ACK;
72
 wire                       wGPU_2__ACK;
73
 wire [`WB_WIDTH-1:0]       ADR_I,wHost_2__ADR_O;
74
 wire                       WE_I,STB_I;
75
 wire [1:0]                 wHost_2__TGA_O;
76
 wire [1:0]                 TGA_I;
77
 wire [`MAX_CORES-1:0]      wCoreSelect;
78
 wire                       wHost_2__MST_O;
79
 wire                       wGPU_2_HOST_Done;
80
 wire [`MAX_CORES-1:0]      wHost_2__RENDREN_O;
81
 wire                       wGPU_2__HOST_HDL;
82
 wire                       wHost_2__WE_O;
83
 wire                       wHost_2__STDONE;
84
 wire                       wGPUCommitedResults;
85
 wire                       wHostDataAvailable;
86
 wire                       wHost_2__CYC_O,wHost_2__GACK_O,TGC_O,wHost_2__STB_O;
87
 
88 178 diegovalve
//assign oDone = wGPU_2_HOST_Done;
89 173 diegovalve
 
90
THEIA GPU
91
  (
92
  .CLK_I(     Clock              ),
93
  .RST_I(     Reset              ),
94
  .RENDREN_I( wHost_2__RENDREN_O ),
95
  .DAT_I(     wHost_2__DAT_O     ),
96
  .ACK_I(     wHost_2__ACK       ),
97
  .CYC_I(     wHost_2__CYC_O     ),
98
  .MST_I(     wHost_2__MST_O     ),
99
  .TGA_I(     wHost_2__TGA_O     ),
100
  .ACK_O(     wGPU_2__ACK        ),
101
  .ADR_I(     wHost_2__ADR_O     ),
102
  .WE_I(      wHost_2__WE_O      ),
103
  .SEL_I(     wCoreSelect        ),
104
  .STB_I(     wHost_2__STB_O     ),
105
 
106
  //O-Memory
107
  .OMBSEL_I(  iOMEMBankSelect  ),
108
  .OMADR_I(   iOMEMReadAddress ),
109
  .OMEM_O(    oOMEMData        ),
110
  //T-Memory
111
  .TMDAT_I(   iTMEMData        ),
112
  .TMADR_I(   iTMEMAdr         ),
113
  .TMWE_I(    iTMEM_WE         ),
114
  .TMSEL_I(   iTMEM_Sel        ),
115
  .HDL_O(     wGPU_2__HOST_HDL    ),
116
  .HDLACK_I(  wHost_2__GACK_O     ),
117
  .STDONE_I(  wHost_2__STDONE     ),
118
  .RCOMMIT_O( wGPUCommitedResults ),
119
  .HDA_I(     wHostDataAvailable  ),
120
  .CREG_I(    iControlRegister[15:0]    ),
121
  .DONE_O(    wGPU_2_HOST_Done    )
122
 
123
 );
124
 
125
 
126
wire[1:0] wMemSelect;
127
wire[`WB_WIDTH-1:0] wHostReadData;
128
 
129
MUXFULLPARALELL_2SEL_GENERIC # ( `WB_WIDTH ) MUX1
130
 (
131
.Sel( wMemSelect    ),
132
.I1(  iInstruction  ),
133
.I2(  iParameter    ),
134
.I3(  iVertex       ),
135
.I4(  0             ),
136
.O1(  wHostReadData )
137
 );
138
 
139
Module_Host HOST
140
(
141
 .Clock(                  Clock                ),
142
 .Reset(                  Reset                ),
143
 .iEnable(                iHostEnable          ),
144
 .oHostDataAvailable(     wHostDataAvailable   ),
145
 .iHostDataReadConfirmed( wGPU_2__HOST_HDL     ),
146
 .iMemorySize(            iMemorySize          ),
147
 .iPrimitiveCount(        iPrimitiveCount      ),
148
 .iGPUCommitedResults(    wGPUCommitedResults  ),
149
 .STDONE_O(               wHost_2__STDONE      ),
150
 .iGPUDone(               wGPU_2_HOST_Done     ),
151 178 diegovalve
 .oRenderDone(            wHost_2__RenderDone  ),
152 173 diegovalve
 
153
 
154 178 diegovalve
 .iWidth(iWidth),
155
 .iHeight(iHeight),
156
 
157 173 diegovalve
 //To Memory
158
.oReadAddress( oHostReadAddress ),
159
.iReadData(    wHostReadData ),
160
 
161
 //To Hub/Switch
162
.oCoreSelectMask( wCoreSelect        ),
163
.oMemSelect(      wMemSelect         ),
164
.DAT_O(           wHost_2__DAT_O     ),
165
.ADR_O(           wHost_2__ADR_O     ),
166
.TGA_O(           wHost_2__TGA_O     ),
167
.RENDREN_O(       wHost_2__RENDREN_O ),
168
.CYC_O(           wHost_2__CYC_O     ),
169
.STB_O(           wHost_2__STB_O     ),
170
.MST_O(           wHost_2__MST_O     ),
171
.GRDY_I(          wGPU_2__HOST_HDL   ),
172
.GACK_O(          wHost_2__GACK_O    ),
173
.WE_O(            wHost_2__WE_O      ),
174
.ACK_I(           wGPU_2__ACK        )
175
);
176
 
177
 
178
endmodule

powered by: WebSVN 2.1.0

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