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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [beta_2.0/] [rtl/] [Module_Adder_Station.v] - Blame information for rev 213

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 213 diegovalve
`include "aDefinitions.v"
2
 
3
 
4
/**********************************************************************************
5
Theia, Ray Cast Programable graphic Processing Unit.
6
Copyright (C) 2012  Diego Valverde (diego.valverde.g@gmail.com)
7
 
8
This program is free software; you can redistribute it and/or
9
modify it under the terms of the GNU General Public License
10
as published by the Free Software Foundation; either version 2
11
of the License, or (at your option) any later version.
12
 
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17
 
18
You should have received a copy of the GNU General Public License
19
along with this program; if not, write to the Free Software
20
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21
 
22
***********************************************************************************/
23
 
24
 
25
module ADDER_STATION
26
(
27
   input wire Clock,
28
   input wire Reset,
29
   input wire [`MOD_ISSUE_PACKET_SIZE-1:0]                   iIssueBus,
30
   input wire [`MOD_COMMIT_PACKET_SIZE-1:0]                  iCommitBus,
31
        input wire [3:0]                                          iId,
32
        output wire [`COMMIT_PACKET_SIZE-1:0]                     oCommitData,
33
        output wire                                               oCommitResquest,
34
        input wire                                                iCommitGranted,
35
        output wire                                               oBusy
36
 
37
);
38
 
39
wire                           wExeDone;
40
wire [2:0]                     wExeDoneTmp;
41
wire                           wRS1_2_ADD_Trigger;
42
wire [`DATA_ROW_WIDTH-1:0]     wRS1_OperandA;
43
wire [`DATA_ROW_WIDTH-1:0]     wRS1_OperandB;
44
wire [`DATA_ROW_WIDTH-1:0]     wResult;
45
 
46
ReservationStation_1Cycle RS
47
(
48
        .Clock(              Clock                           ),
49
        .Reset(              Reset                           ),
50
        .iIssueBus(          iIssueBus                       ),
51
        .iCommitBus(         iCommitBus                      ),
52
        .iMyId(              iId                             ),
53
        .iExecutionDone(     wExeDone                        ),
54
        .iResult(             wResult                        ),
55
        .iCommitGranted(     iCommitGranted                  ),
56
 
57
        .oSource1(          wRS1_OperandA                   ),
58
        .oSource0(          wRS1_OperandB                   ),
59
        .oBusy(              oBusy                           ),
60
        .oTrigger(           wRS1_2_ADD_Trigger              ),
61
        .oCommitRequest(     oCommitResquest                 ),
62
        .oId(              oCommitData[`COMMIT_RSID_RNG]                                ),
63
        .oWE(              oCommitData[`COMMIT_WE_RNG]                                  ),
64
        .oDestination(     oCommitData[`COMMIT_DST_RNG]                               ),
65
        .oResult(          {oCommitData[`X_RNG],oCommitData[`Y_RNG],oCommitData[`Z_RNG]})
66
 
67
);
68
 
69
assign wExeDone = wExeDoneTmp[0] & wExeDoneTmp[1] & wExeDoneTmp[2];
70
 
71
ADDER # (`WIDTH) ADD_0
72
(
73
   .Clock(     Clock                   ),
74
        .Reset(     Reset                   ),
75
   .iTrigger(   wRS1_2_ADD_Trigger     ),
76
   .iA(        wRS1_OperandA[`X_RNG]   ),
77
        .iB(        wRS1_OperandB[`X_RNG]   ),
78
        .oDone(     wExeDoneTmp[0]          ),
79
   .oR(        wResult[`X_RNG]         )
80
);
81
 
82
ADDER # (`WIDTH) ADD_1
83
(
84
   .Clock(     Clock                   ),
85
        .Reset(     Reset                   ),
86
   .iTrigger(   wRS1_2_ADD_Trigger     ),
87
   .iA(        wRS1_OperandA[`Y_RNG]   ),
88
        .iB(        wRS1_OperandB[`Y_RNG]   ),
89
        .oDone(     wExeDoneTmp[1]          ),
90
   .oR(        wResult[`Y_RNG]         )
91
);
92
 
93
ADDER # (`WIDTH) ADD_2
94
(
95
   .Clock(     Clock                   ),
96
        .Reset(     Reset                   ),
97
   .iTrigger(   wRS1_2_ADD_Trigger     ),
98
   .iA(        wRS1_OperandA[`Z_RNG]   ),
99
        .iB(        wRS1_OperandB[`Z_RNG]   ),
100
        .oDone(     wExeDoneTmp[2]          ),
101
   .oR(        wResult[`Z_RNG]         )
102
);
103
 
104
endmodule

powered by: WebSVN 2.1.0

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