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 IO_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 |
|
|
output wire [`DATA_ROW_WIDTH-1:0] oOMEMWriteAddress,
|
37 |
|
|
output wire [`DATA_ROW_WIDTH-1:0] oOMEMWriteData,
|
38 |
|
|
output wire oOMEMWriteEnable
|
39 |
|
|
|
40 |
|
|
);
|
41 |
|
|
|
42 |
|
|
wire wExeDone;
|
43 |
|
|
wire [2:0] wExeDoneTmp;
|
44 |
|
|
wire wRS_OMWRITE_Trigger;
|
45 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wRS1_OperandA;
|
46 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wRS1_OperandB;
|
47 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wResult;
|
48 |
|
|
wire wCommitGranted;
|
49 |
|
|
|
50 |
|
|
//ReservationStation_1Cycle RS
|
51 |
|
|
ReservationStation RS
|
52 |
|
|
(
|
53 |
|
|
.Clock( Clock ),
|
54 |
|
|
.Reset( Reset ),
|
55 |
|
|
.iIssueBus( iIssueBus ),
|
56 |
|
|
.iCommitBus( iCommitBus ),
|
57 |
|
|
.iMyId( iId ),
|
58 |
|
|
.iExecutionDone( wExeDone ),
|
59 |
|
|
.iResult( wResult ),
|
60 |
|
|
.iCommitGranted( wCommitGranted ),
|
61 |
|
|
.oSrc1Latched( wRS1_OperandB ),
|
62 |
|
|
.oSrc0Latched( wRS1_OperandA ),
|
63 |
|
|
.oBusy( oBusy ),
|
64 |
|
|
.oTrigger( wRS_OMWRITE_Trigger )
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
);
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
assign oCommitResquest = 1'b0; //This is always zero since we are writting anything into the RF
|
71 |
|
|
assign oCommitData = `COMMIT_PACKET_SIZE'd0; //This is always zero since we are writting anything into the RF
|
72 |
|
|
assign oOMEMWriteData = wRS1_OperandA; //Write 96 bits to external memory OMEM
|
73 |
|
|
assign oOMEMWriteAddress = wRS1_OperandB; //Each 32 bit words has the write address
|
74 |
|
|
|
75 |
|
|
FFD_POSEDGE_SYNCRONOUS_RESET # ( 1 ) DONE_FFD0
|
76 |
|
|
( Clock, Reset, 1'b1 , wRS_OMWRITE_Trigger | wExeDone_pre1 | wExeDone_pre2, oOMEMWriteEnable );
|
77 |
|
|
|
78 |
|
|
//It takes 3 clock cycles to write the 96 bits into OMEM
|
79 |
|
|
wire wExeDone_pre1,wExeDone_pre2;
|
80 |
|
|
FFD_POSEDGE_SYNCRONOUS_RESET # ( 1 ) DONE_FFD1
|
81 |
|
|
( Clock, Reset, 1'b1 , wRS_OMWRITE_Trigger, wExeDone_pre1 );
|
82 |
|
|
|
83 |
|
|
FFD_POSEDGE_SYNCRONOUS_RESET # ( 1 ) DONE_FFD2
|
84 |
|
|
( Clock, Reset, 1'b1 , wExeDone_pre1, wExeDone_pre2 );
|
85 |
|
|
|
86 |
|
|
FFD_POSEDGE_SYNCRONOUS_RESET # ( 1 ) DONE_FFD3
|
87 |
|
|
( Clock, Reset, 1'b1 , wExeDone_pre2, wExeDone );
|
88 |
|
|
|
89 |
|
|
assign wCommitGranted = wExeDone;
|
90 |
|
|
|
91 |
|
|
endmodule
|