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

Subversion Repositories theia_gpu

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

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

Line No. Rev Author Line
1 213 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
module THEIA
25
(
26
        input wire         Clock,
27
        input wire         Reset,
28
        input wire         iEnable,
29
        input wire [31:0]  iMemReadData,
30
        input wire         iMemDataAvailable,
31
        output wire [31:0] oMemReadAddress,
32
        output wire        oMEM_ReadRequest
33
 
34
);
35
 
36
 
37
wire [`WB_WIDTH-1:0]              wMCU_2_VP_InstructionWriteAddress;
38
wire  [`WB_WIDTH-1:0]             wMCU_2_VP_InstructionWriteData;
39
wire   [`MAX_CORES-1:0]           wMCU_2_VP_InstructionWriteEnable;
40
wire [`MCU_TAG_SIZE-1:0]          wMCU_2_VP_Tag;
41
wire                              wMCU_2_VP_STB;
42
wire                              wMCU_2_VP_Cyc;
43
wire                              wMCU_2_VP_Mst;
44
wire  [`MAX_CORES-1:0]            wVP_2_MCU_ACK;
45
wire                              wVP_Slave_ACK;
46
wire [`MCU_REQUEST_SIZE-1:0]      wCP_2MCU_BlockCopyCommand;
47
wire[`CBC_BUS_WIDTH-1:0]          wCP_VP__ControlCommandBus;
48
wire                              wMCU_2_CP__FIFOEmpty;
49
wire                              wOMem_WE[`MAX_CORES-1:0];
50
wire [`WB_WIDTH-1:0]              wOMEM_Address[`MAX_CORES-1:0];
51
wire [`WB_WIDTH-1:0]              wOMEM_Dat[`MAX_CORES-1:0];
52
 
53
 
54
//////////////////////////////////////////////
55
//
56
// The control processor
57
//
58
//////////////////////////////////////////////
59
ControlProcessor CP
60
(
61
                .Clock(               Clock                     ),
62
                .Reset(               Reset                     ),
63
                .oControlBus(         wCP_VP__ControlCommandBus ),
64
                .iMCUFifoEmpty(       wMCU_2_CP__FIFOEmpty      ),
65
                .oCopyBlockCommand(   wCP_2MCU_BlockCopyCommand )
66
);
67
 
68
//////////////////////////////////////////////
69
//
70
// The control processor
71
//
72
//////////////////////////////////////////////
73
assign wVP_Slave_ACK = wVP_2_MCU_ACK[0] | wVP_2_MCU_ACK[1] | wVP_2_MCU_ACK[2] | wVP_2_MCU_ACK[3];
74
 
75
MemoryController #(`MAX_CORES) MCU
76
(
77
                .Clock(                  Clock                             ),
78
                .Reset(                  Reset                             ),
79
                .iRequest(               wCP_2MCU_BlockCopyCommand         ),
80
                .oMEM_ReadAddress(       oMemReadAddress                   ),
81
                .oMEM_ReadRequest(       oMEM_ReadRequest                  ),
82
                .oFifoEmpty(             wMCU_2_CP__FIFOEmpty              ),
83
                .iMEM_ReadData(          iMemReadData                      ),
84
                .iMEM_DataAvailable(     iMemDataAvailable                 ),
85
                .DAT_O(                  wMCU_2_VP_InstructionWriteData    ),
86
                .ADR_O(                  wMCU_2_VP_InstructionWriteAddress ),
87
                .STB_O(                  wMCU_2_VP_STB                     ),
88
                .WE_O(                   wMCU_2_VP_InstructionWriteEnable  ),
89
                .TAG_O(                  wMCU_2_VP_Tag                     ),
90
                .CYC_O(                  wMCU_2_VP_Cyc                     ),
91
                .MST_O(                  wMCU_2_VP_Mst                     ),
92
                .ACK_I(                  wVP_Slave_ACK                     )
93
);
94
 
95
//////////////////////////////////////////////
96
//
97
// The vector processors
98
//
99
//////////////////////////////////////////////
100
genvar i;
101
  generate
102
        for (i = 0; i < `MAX_CORES; i = i +1)
103
        begin : VPX
104
 
105
        VectorProcessor VP
106
        (
107
                .Clock(           Clock                                 ),
108
                .Reset(           Reset                                 ),
109
                .iEnable(         iEnable                               ),
110
                .iVPID(           i+1                                   ),
111
                .iCpCommand(      wCP_VP__ControlCommandBus             ),
112
                .MCU_STB_I(       wMCU_2_VP_STB                         ),
113
      .MCU_WE_I(        wMCU_2_VP_InstructionWriteEnable[i]   ),
114
      .MCU_DAT_I(       wMCU_2_VP_InstructionWriteData        ),
115
      .MCU_ADR_I(       wMCU_2_VP_InstructionWriteAddress     ),
116
      .MCU_TAG_I(       wMCU_2_VP_Tag                         ),
117
      .MCU_ACK_O(       wVP_2_MCU_ACK[i]                      ),
118
      .MCU_MST_I(       wMCU_2_VP_Mst                         ),
119
      .MCU_CYC_I(       wMCU_2_VP_Cyc                         ),
120
                .OMEM_WE(         wOMem_WE[i]                            ),
121
                .OMEM_ADDR(       wOMEM_Address[i]                       ),
122
                .OMEM_DATA(       wOMEM_Dat[i]                           )
123
 
124
 
125
        );
126
 
127
        RAM_SINGLE_READ_PORT # ( `WB_WIDTH, `WB_WIDTH, `OMEM_SIZE ) OMEM
128
        (
129
          .Clock(         Clock                ),
130
          .iWriteEnable(  wOMem_WE[i]          ),
131
          .iWriteAddress( wOMEM_Address[i]     ),
132
          .iDataIn(       wOMEM_Dat[i]         ),
133
          .iReadAddress0( wOMEM_Address[i]     )
134
          //.oDataOut0(     wOMEM_Dat[i]         )
135
 
136
        );
137
 
138
        end // for
139
endgenerate
140
 
141
 
142
endmodule

powered by: WebSVN 2.1.0

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