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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [beta_2.0/] [rtl/] [Module_TMemInterface.v] - Blame information for rev 230

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 230 diegovalve
`timescale 1ns / 1ps
2
`include "aDefinitions.v"
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
//
26
//
27
//        Remarks: 
28
//            * TMI sends 3 read requests to the TMEM memory. The read requests has
29
//              read address equal iAddress[X_RNG], iAddress[Y_RNG] and iAddress[Z_RNG]
30
//              respectively.
31
//            * TMI will set oData == 1 once the bus cycle is complete (this can take
32
//              multiple clock cycles depending on the crossbar traffic
33
//            * TMI needs to have iEnable == 1 for the entire duration of the read bus cycle,
34
//              if the iEnable is set to zero before the bus transaction is complete then
35
//              read operation will fail and the read data will not be presented into
36
//              the oData output signal.
37
//
38
//------------------------------------------------------------------------------
39
module Module_TMemInterface
40
(
41
input wire Clock,
42
input wire Reset,
43
input wire iEnable,
44
input wire [`DATA_ROW_WIDTH-1:0]     iAddress,
45
output wire [`DATA_ROW_WIDTH-1:0]    oData,
46
output wire oDone,
47
 
48
input wire                                                 ACK_I,
49
input wire                    GNT_I,
50
input wire [`WB_WIDTH-1:0 ]      DAT_I,
51
 
52
//WB Output Signals
53
output wire [`WB_WIDTH-1:0 ] ADR_O,
54
output wire                                  WE_O,
55
output wire                                  STB_O,
56
output wire                                  CYC_O
57
 
58
 
59
);
60
 
61
wire [3:0] wCurrentWord;
62
wire wDone;
63
assign oDone = wDone;// & iEnable;
64
 
65
FFD_POSEDGE_SYNCRONOUS_RESET # ( 1 ) FFD_DONE
66
(
67
        .Clock(Clock),
68
        .Reset(Reset),
69
        .Enable( 1'b1 ),
70
        .D(wCurrentWord[3]),
71
        .Q(wDone)
72
);
73
 
74
 
75
//wire wShiftNow;
76
assign WE_O = 1'b0;     //we only read
77
assign CYC_O = iEnable;
78
 
79
 
80
 
81
wire[2:0] wLatchNow;
82
FFD_POSEDGE_SYNCRONOUS_RESET # ( 3 ) FFD_LATHCNOW
83
(
84
        .Clock(Clock),
85
        .Reset(Reset),
86
        .Enable( 1'b1 ),
87
        .D(wCurrentWord[2:0]),
88
        .Q(wLatchNow)
89
);
90
 
91
 
92
 
93
SHIFTLEFT_POSEDGE #(4) SHL
94
(
95
  .Clock(Clock),
96
  .Enable(iEnable & GNT_I),//wShiftNow),                        
97
  .Reset(Reset | ~iEnable ),
98
  .Initial(4'b1),
99
  .O(wCurrentWord)
100
 
101
);
102
 
103
MUXFULLPARALELL_3SEL_WALKINGONE # ( `WB_WIDTH ) MUX1
104
 (
105
        .Sel( wCurrentWord[2:0] ),
106
        .I3(iAddress[31:0]),
107
        .I2(iAddress[63:32]),
108
        .I1(iAddress[95:64]),
109
        .O1( ADR_O )
110
 );
111
 
112
 
113
 
114
FFD_POSEDGE_SYNCRONOUS_RESET # ( `WIDTH ) FFDX
115
(
116
        .Clock(Clock),
117
        .Reset(Reset),
118
        .Enable( wLatchNow[0] & GNT_I),
119
        .D(DAT_I),
120
        .Q(oData[95:64])
121
);
122
 
123
 
124
FFD_POSEDGE_SYNCRONOUS_RESET # ( `WIDTH ) FFDY
125
(
126
        .Clock(Clock),
127
        .Reset(Reset),
128
        .Enable( wLatchNow[1] & GNT_I),
129
        .D(DAT_I),
130
        .Q(oData[63:32])
131
);
132
 
133
 
134
FFD_POSEDGE_SYNCRONOUS_RESET # ( `WIDTH ) FFDZ
135
(
136
        .Clock(Clock),
137
        .Reset( Reset ),
138
        .Enable( wLatchNow[2] & GNT_I),
139
        .D(DAT_I),
140
        .Q(oData[31:0])
141
);
142
 
143
endmodule
144
//--------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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