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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [gpu_8_cores/] [rtl/] [GPU/] [TOP/] [Theia.v] - Blame information for rev 76

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

Line No. Rev Author Line
1 76 diegovalve
`timescale 1ns / 1ps
2
`include "aDefinitions.v"
3
 
4
//---------------------------------------------------------------------------
5
module THEIA
6
(
7 16 diegovalve
 
8
input wire                    CLK_I,    //Input clock
9
input wire                    RST_I,    //Input reset
10
//Theia Interfaces
11
input wire                    MST_I,    //Master signal, THEIA enters configuration mode
12
                                       //when this gets asserted (see documentation)
13
//Wish Bone Interface
14
input wire [`WB_WIDTH-1:0]    DAT_I,     //Input data bus  (Wishbone)
15
output wire [`WB_WIDTH-1:0]   DAT_O,     //Output data bus (Wishbone)
16
input wire                    ACK_I,    //Input ack
17
output wire                   ACK_O,    //Output ack
18
output wire [`WB_WIDTH-1:0]   ADR_O,     //Output address
19
input wire [`WB_WIDTH-1:0]    ADR_I,     //Input address
20
output wire                   WE_O,             //Output write enable
21
input wire                    WE_I,    //Input write enable
22
output wire                   STB_O,    //Strobe signal, see wishbone documentation
23
input wire                    STB_I,    //Strobe signal, see wishbone documentation
24
output wire                   CYC_O,    //Bus cycle signal, see wishbone documentation
25
input wire                    CYC_I,   //Bus cycle signal, see wishbone documentation
26
output wire     [1:0]             TGC_O,   //Bus cycle tag, see THEAI documentation
27
input wire [1:0]              TGA_I,   //Input address tag, see THEAI documentation
28
output wire [1:0]             TGA_O,   //Output address tag, see THEAI documentation
29 76 diegovalve
input wire      [1:0]             TGC_I,   //Bus cycle tag, see THEAI documentation
30
input wire [`MAX_CORES-1:0]      SEL_I,  //The WishBone Master uses this signal to configure a specific core (TBD, not sure is needed)
31
input wire [`MAX_CORES-1:0]   RENDREN_I,
32 16 diegovalve
//Control Register
33 76 diegovalve
input wire [15:0]                         CREG_I,
34
output wire                   DONE_O
35 16 diegovalve
 
36 76 diegovalve
);
37 16 diegovalve
 
38
 
39
 
40 76 diegovalve
 
41
wire [`MAX_CORES-1:0] wDone;
42
wire [`MAX_CORES-1:0] wBusGranted,wBusRequest;
43
wire [`WB_WIDTH-1:0]  wDAT_O_0,wDAT_O_1,wDAT_O_2,wDAT_O_3;
44
wire [`WB_WIDTH-1:0]  wADR_O_0,wADR_O_1,wADR_O_2,wADR_O_3;
45
wire [1:0] wTGA_O_0,wTGA_O_1,wTGA_O_2,wTGA_O_3;
46
wire [1:0] wBusSelect;
47
 
48
//wire   wSTB_O_0,wSTB_O_1,wSTB_O_2,wSTB_O_3;
49
//wire   wWE_O_0,wWE_O_1,wWE_O_2,wWE_O_3;
50
 
51
wire [`MAX_CORES-1:0] wSTB_O,wWE_O;
52
 
53
wire   wACK_O_0,wACK_O_1,wACK_O_2,wACK_O_3;
54
 
55
wire [`MAX_CORES-1:0]   wSTB_I;
56
wire [`MAX_CORES-1:0]   wMST_I;
57
wire [`MAX_CORES-1:0]   wACK_I;
58
wire [`MAX_CORES-1:0]   wCYC_I;
59
wire [1:0]              wTGA_I[`MAX_CORES-1:0];
60
 
61
//assign DONE_O = wDone[0] & wDone[1] & wDone[2] & wDone[3];
62
//assign DONE_O = wDone[1];
63
assign DONE_O = wDone[0] & wDone[1];
64
 
65
//----------------------------------------------------------------      
66
//      assign wDone[3:1] = 3'b111;
67
        assign wBusRequest[3:2] = 0;
68
        assign wSTB_O[3:2] = 0;
69
        assign wWE_O[3:2] = 0;
70
        Module_BusArbitrer ARB1
71
        (
72
        .Clock( CLK_I ),
73
        .Reset( RST_I ),
74
        .iRequest( wBusRequest ),
75
        .oGrant(   wBusGranted ),
76
        .oBusSelect( wBusSelect )
77
 
78
        );
79
//----------------------------------------------------------------
80
//The Muxes
81
//DAT_O Mux
82
MUXFULLPARALELL_2SEL_GENERIC # ( `WB_WIDTH ) MUX_DAT_O
83
 (
84
 .Sel(wBusSelect),
85
  .I1(wDAT_O_0),
86
  .I2(wDAT_O_1),
87
  .I3(wDAT_O_2),
88
  .I4(wDAT_O_3),
89
  .O1( DAT_O )
90
  );
91
 
92
MUXFULLPARALELL_2SEL_GENERIC # ( `WB_WIDTH ) MUX_ADR_O
93
 (
94
 .Sel(wBusSelect),
95
  .I1(wADR_O_0),
96
  .I2(wADR_O_1),
97
  .I3(wADR_O_2),
98
  .I4(wADR_O_3),
99
  .O1( ADR_O )
100
  );
101
 
102
 
103
 
104
MUXFULLPARALELL_2SEL_GENERIC # ( 1 ) MUX_STB_O
105
 (
106
 .Sel(wBusSelect),
107
  .I1(wSTB_O[0]),
108
  .I2(wSTB_O[1]),
109
  .I3(wSTB_O[2]),
110
  .I4(wSTB_O[3]),
111
  .O1( STB_O )
112
  );
113
 
114
 
115
  MUXFULLPARALELL_2SEL_GENERIC # ( 1 ) MUX_WE_O
116
 (
117
 .Sel(wBusSelect),
118
  .I1(wWE_O[0]),
119
  .I2(wWE_O[1]),
120
  .I3(wWE_O[2]),
121
  .I4(wWE_O[3]),
122
  .O1( WE_O )
123
  );
124
 
125
 
126
  MUXFULLPARALELL_2SEL_GENERIC # ( 2 ) MUX_TGA_O
127
 (
128
 .Sel(wBusSelect),
129
  .I1(wTGA_O_0),
130
  .I2(wTGA_O_1),
131
  .I3(wTGA_O_2),
132
  .I4(wTGA_O_3),
133
  .O1( TGA_O )
134
  );
135
 
136
 
137
  assign ACK_O = (wACK_O_0 | wACK_O_1);// | wACK_O_2 | wACK_O_3);
138
 
139
        assign wMST_I[0] = (SEL_I[0]) ? MST_I : 0;
140
        assign wMST_I[1] = (SEL_I[1]) ? MST_I : 0;
141
        assign wMST_I[2] = (SEL_I[2]) ? MST_I : 0;
142
        assign wMST_I[3] = (SEL_I[3]) ? MST_I : 0;
143
 
144
        assign wSTB_I[0] = (SEL_I[0]) ? STB_I : 0;
145
        assign wSTB_I[1] = (SEL_I[1]) ? STB_I : 0;
146
        assign wSTB_I[2] = (SEL_I[2]) ? STB_I : 0;
147
        assign wSTB_I[3] = (SEL_I[3]) ? STB_I : 0;
148
 
149
        assign wCYC_I[0] = (SEL_I[0]) ? CYC_I : 0;
150
        assign wCYC_I[1] = (SEL_I[1]) ? CYC_I : 0;
151
        assign wCYC_I[2] = (SEL_I[2]) ? CYC_I : 0;
152
        assign wCYC_I[3] = (SEL_I[3]) ? CYC_I : 0;
153
 
154
        assign wTGA_I[0] = (SEL_I[0]) ? TGA_I : 0;
155
        assign wTGA_I[1] = (SEL_I[1]) ? TGA_I : 0;
156
        assign wTGA_I[2] = (SEL_I[2]) ? TGA_I : 0;
157
        assign wTGA_I[3] = (SEL_I[3]) ? TGA_I : 0;
158
 
159
//----------------------------------------------------------------
160
wire foo;
161
assign foo = ACK_I;
162
        THEIACORE THEIA_CORE0
163
                (
164
                .CLK_I( CLK_I ),
165
                .RST_I( RST_I ),
166
                .RENDREN_I( RENDREN_I[0] ),
167
 
168
                //Slave signals
169
                .ADR_I( ADR_I ),
170
                .WE_I(  WE_I  ),
171
                .STB_I(  wSTB_I[0] ),
172
                //-----------------------------------
173
                //This signal behaves in a very funny way...
174
                //
175
                .ACK_I( ACK_I ),//&  wBusGranted[0] ),//wACK_I[0] ), //WTF??? ok I think it works fine like this...
176
                //-----------------------------------
177
                .CYC_I( wCYC_I[0] ),
178
                .MST_I( wMST_I[0] ),
179
                .TGA_I( wTGA_I[0] ),
180
                .CREG_I( CREG_I ),
181
 
182
                //Master Signals
183
                .WE_O (         wWE_O[0]  ),
184
                .STB_O(         wSTB_O[0] ),
185
                .ACK_O(         wACK_O_0 ),
186
                .DAT_O(  wDAT_O_0 ),
187
                .ADR_O(  wADR_O_0 ),
188
                .CYC_O(  wBusRequest[0] ),
189
                .GNT_I(         wBusGranted[0] ),
190
                .TGA_O(         wTGA_O_0 ),
191
                `ifdef DEBUG
192
                .iDebug_CoreID( `MAX_CORES'd0 ),
193
                `endif
194
                //Other
195
                .DAT_I( DAT_I ),
196
                .DONE_O( wDone[0] )
197 16 diegovalve
 
198 76 diegovalve
        );
199
//----------------------------------------------------------------
200
THEIACORE THEIA_CORE1
201
                (
202
                .CLK_I( CLK_I ),
203
                .RST_I( RST_I ),
204
                .RENDREN_I( RENDREN_I[1] ),
205
 
206
                //Slave signals
207
                .ADR_I( ADR_I ),
208
                .WE_I(  WE_I  ),
209
                .STB_I(  wSTB_I[1] ),//ok
210
                .ACK_I(  ACK_I ),//& wBusGranted[1] ),//wACK_I[0] ), //WTF??? ok I think it works fine like this...
211
                .CYC_I( wCYC_I[1] ),//ok
212
                .MST_I( wMST_I[1] ),//ok
213
                .TGA_I( wTGA_I[1] ),//ok
214
                .CREG_I( CREG_I ),
215
 
216
                //Master Signals
217
                .WE_O (         wWE_O[1]  ),
218
                .STB_O(         wSTB_O[1] ),
219
                .ACK_O(         wACK_O_1 ),
220
                .DAT_O(  wDAT_O_1 ),
221
                .ADR_O(  wADR_O_1 ),
222
                .CYC_O(  wBusRequest[1] ),
223
                .GNT_I(         wBusGranted[1] ),
224
                .TGA_O(         wTGA_O_1 ),
225
                `ifdef DEBUG
226
                .iDebug_CoreID( `MAX_CORES'd1 ),
227
                `endif
228
                //Other
229
                .DAT_I( DAT_I ),
230
                .DONE_O( wDone[1] )
231 16 diegovalve
 
232 76 diegovalve
        );
233
//----------------------------------------------------------------
234
 
235
 
236
endmodule
237
//---------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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