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 173

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
        input wire [`WIDTH-1:0] iDebugWidth,
60
`endif
61
output wire                       oDone
62
 
63
 
64
);
65
 
66
assign oMemSelect =  wMemSelect;
67
 
68
 wire [`WB_WIDTH-1:0]       wHost_2__DAT_O;
69
 reg                        wHost_2__ACK;
70
 wire                       wGPU_2__ACK;
71
 wire [`WB_WIDTH-1:0]       ADR_I,wHost_2__ADR_O;
72
 wire                       WE_I,STB_I;
73
 wire [1:0]                 wHost_2__TGA_O;
74
 wire [1:0]                 TGA_I;
75
 wire [`MAX_CORES-1:0]      wCoreSelect;
76
 wire                       wHost_2__MST_O;
77
 wire                       wGPU_2_HOST_Done;
78
 wire [`MAX_CORES-1:0]      wHost_2__RENDREN_O;
79
 wire                       wGPU_2__HOST_HDL;
80
 wire                       wHost_2__WE_O;
81
 wire                       wHost_2__STDONE;
82
 wire                       wGPUCommitedResults;
83
 wire                       wHostDataAvailable;
84
 wire                       wHost_2__CYC_O,wHost_2__GACK_O,TGC_O,wHost_2__STB_O;
85
 
86
assign oDone = wGPU_2_HOST_Done;
87
 
88
THEIA GPU
89
  (
90
  .CLK_I(     Clock              ),
91
  .RST_I(     Reset              ),
92
  .RENDREN_I( wHost_2__RENDREN_O ),
93
  .DAT_I(     wHost_2__DAT_O     ),
94
  .ACK_I(     wHost_2__ACK       ),
95
  .CYC_I(     wHost_2__CYC_O     ),
96
  .MST_I(     wHost_2__MST_O     ),
97
  .TGA_I(     wHost_2__TGA_O     ),
98
  .ACK_O(     wGPU_2__ACK        ),
99
  .ADR_I(     wHost_2__ADR_O     ),
100
  .WE_I(      wHost_2__WE_O      ),
101
  .SEL_I(     wCoreSelect        ),
102
  .STB_I(     wHost_2__STB_O     ),
103
 
104
  //O-Memory
105
  .OMBSEL_I(  iOMEMBankSelect  ),
106
  .OMADR_I(   iOMEMReadAddress ),
107
  .OMEM_O(    oOMEMData        ),
108
  //T-Memory
109
  .TMDAT_I(   iTMEMData        ),
110
  .TMADR_I(   iTMEMAdr         ),
111
  .TMWE_I(    iTMEM_WE         ),
112
  .TMSEL_I(   iTMEM_Sel        ),
113
  .HDL_O(     wGPU_2__HOST_HDL    ),
114
  .HDLACK_I(  wHost_2__GACK_O     ),
115
  .STDONE_I(  wHost_2__STDONE     ),
116
  .RCOMMIT_O( wGPUCommitedResults ),
117
  .HDA_I(     wHostDataAvailable  ),
118
  .CREG_I(    iControlRegister[15:0]    ),
119
  .DONE_O(    wGPU_2_HOST_Done    )
120
 
121
 );
122
 
123
 
124
wire[1:0] wMemSelect;
125
wire[`WB_WIDTH-1:0] wHostReadData;
126
 
127
MUXFULLPARALELL_2SEL_GENERIC # ( `WB_WIDTH ) MUX1
128
 (
129
.Sel( wMemSelect    ),
130
.I1(  iInstruction  ),
131
.I2(  iParameter    ),
132
.I3(  iVertex       ),
133
.I4(  0             ),
134
.O1(  wHostReadData )
135
 );
136
 
137
Module_Host HOST
138
(
139
 .Clock(                  Clock                ),
140
 .Reset(                  Reset                ),
141
 .iEnable(                iHostEnable          ),
142
 .oHostDataAvailable(     wHostDataAvailable   ),
143
 .iHostDataReadConfirmed( wGPU_2__HOST_HDL     ),
144
 .iMemorySize(            iMemorySize          ),
145
 .iPrimitiveCount(        iPrimitiveCount      ),
146
 .iGPUCommitedResults(    wGPUCommitedResults  ),
147
 .STDONE_O(               wHost_2__STDONE      ),
148
 .iGPUDone(               wGPU_2_HOST_Done     ),
149
 
150
`ifndef NO_DISPLAY_STATS
151
 .iDebugWidth(iDebugWidth),
152
`endif
153
 
154
 //To Memory
155
.oReadAddress( oHostReadAddress ),
156
.iReadData(    wHostReadData ),
157
 
158
 //To Hub/Switch
159
.oCoreSelectMask( wCoreSelect        ),
160
.oMemSelect(      wMemSelect         ),
161
.DAT_O(           wHost_2__DAT_O     ),
162
.ADR_O(           wHost_2__ADR_O     ),
163
.TGA_O(           wHost_2__TGA_O     ),
164
.RENDREN_O(       wHost_2__RENDREN_O ),
165
.CYC_O(           wHost_2__CYC_O     ),
166
.STB_O(           wHost_2__STB_O     ),
167
.MST_O(           wHost_2__MST_O     ),
168
.GRDY_I(          wGPU_2__HOST_HDL   ),
169
.GACK_O(          wHost_2__GACK_O    ),
170
.WE_O(            wHost_2__WE_O      ),
171
.ACK_I(           wGPU_2__ACK        )
172
);
173
 
174
 
175
endmodule

powered by: WebSVN 2.1.0

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