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

Subversion Repositories opengfx430

[/] [opengfx430/] [trunk/] [core/] [rtl/] [verilog/] [ogfx_gpu.v] - Blame information for rev 3

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

Line No. Rev Author Line
1 3 olivier.gi
//----------------------------------------------------------------------------
2
// Copyright (C) 2015 Authors
3
//
4
// This source file may be used and distributed without restriction provided
5
// that this copyright statement is not removed from the file and that any
6
// derivative work contains the original copyright notice and the associated
7
// disclaimer.
8
//
9
// This source file is free software; you can redistribute it and/or modify
10
// it under the terms of the GNU Lesser General Public License as published
11
// by the Free Software Foundation; either version 2.1 of the License, or
12
// (at your option) any later version.
13
//
14
// This source is distributed in the hope that it will be useful, but WITHOUT
15
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17
// License for more details.
18
//
19
// You should have received a copy of the GNU Lesser General Public License
20
// along with this source; if not, write to the Free Software Foundation,
21
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22
//
23
//----------------------------------------------------------------------------
24
//
25
// *File Name: ogfx_gpu.v
26
//
27
// *Module Description:
28
//                      Graphic-Processing unit of the graphic controller.
29
//                      This block can perform the following hardware
30
//                      accelerations:
31
//
32
//                          -
33
//                          -
34
//
35
// *Author(s):
36
//              - Olivier Girard,    olgirard@gmail.com
37
//
38
//----------------------------------------------------------------------------
39
// $Rev$
40
// $LastChangedBy$
41
// $LastChangedDate$
42
//----------------------------------------------------------------------------
43
`ifdef OGFX_NO_INCLUDE
44
`else
45
`include "openGFX430_defines.v"
46
`endif
47
 
48
module  ogfx_gpu (
49
 
50
// OUTPUTs
51
    gpu_cmd_done_evt_o,                           // GPU command done event
52
    gpu_cmd_error_evt_o,                          // GPU command error event
53
    gpu_get_data_o,                               // GPU get next data
54
 
55
    vid_ram_addr_o,                               // Video-RAM address
56
    vid_ram_din_o,                                // Video-RAM data
57
    vid_ram_wen_o,                                // Video-RAM write strobe (active low)
58
    vid_ram_cen_o,                                // Video-RAM chip enable (active low)
59
 
60
// INPUTs
61
    mclk,                                         // Main system clock
62
    puc_rst,                                      // Main system reset
63
 
64
    display_width_i,                              // Display width
65
 
66
    gfx_mode_i,                                   // Video mode (1xx:16bpp / 011:8bpp / 010:4bpp / 001:2bpp / 000:1bpp)
67
 
68
    gpu_data_i,                                   // GPU data
69
    gpu_data_avail_i,                             // GPU data available
70
    gpu_enable_i,                                 // GPU enable
71
 
72
    vid_ram_dout_i,                               // Video-RAM data input
73
    vid_ram_dout_rdy_nxt_i                        // Video-RAM data output ready during next cycle
74
);
75
 
76
// OUTPUTs
77
//=========
78
output               gpu_cmd_done_evt_o;          // GPU command done event
79
output               gpu_cmd_error_evt_o;         // GPU command error event
80
output               gpu_get_data_o;              // GPU get next data
81
 
82
output [`VRAM_MSB:0] vid_ram_addr_o;              // Video-RAM address
83
output        [15:0] vid_ram_din_o;               // Video-RAM data
84
output               vid_ram_wen_o;               // Video-RAM write strobe (active low)
85
output               vid_ram_cen_o;               // Video-RAM chip enable (active low)
86
 
87
// INPUTs
88
//=========
89
input                mclk;                        // Main system clock
90
input                puc_rst;                     // Main system reset
91
 
92
input  [`LPIX_MSB:0] display_width_i;             // Display width
93
 
94
input          [2:0] gfx_mode_i;                  // Video mode (1xx:16bpp / 011:8bpp / 010:4bpp / 001:2bpp / 000:1bpp)
95
 
96
input         [15:0] gpu_data_i;                  // GPU data
97
input                gpu_data_avail_i;            // GPU data available
98
input                gpu_enable_i;                // GPU enable
99
 
100
input         [15:0] vid_ram_dout_i;              // Video-RAM data input
101
input                vid_ram_dout_rdy_nxt_i;      // Video-RAM data output ready during next cycle
102
 
103
 
104
//=============================================================================
105
// 1)  WIRE, REGISTERS AND PARAMETER DECLARATION
106
//=============================================================================
107
 
108
wire                 exec_fill;
109
wire                 exec_copy;
110
wire                 exec_copy_trans;
111
wire                 trig_exec;
112
 
113
wire   [`APIX_MSB:0] cfg_dst_px_addr;
114
wire                 cfg_dst_cl_swp;
115
wire                 cfg_dst_x_swp;
116
wire                 cfg_dst_y_swp;
117
wire          [15:0] cfg_fill_color;
118
wire           [3:0] cfg_pix_op_sel;
119
wire   [`LPIX_MSB:0] cfg_rec_width;
120
wire   [`LPIX_MSB:0] cfg_rec_height;
121
wire   [`APIX_MSB:0] cfg_src_px_addr;
122
wire                 cfg_src_cl_swp;
123
wire                 cfg_src_x_swp;
124
wire                 cfg_src_y_swp;
125
wire          [15:0] cfg_transparent_color;
126
 
127
wire                 gpu_exec_done;
128
 
129
 
130
//=============================================================================
131
// 2)  GPU CONGIGURATION & CONTROL REGISTERS
132
//=============================================================================
133
 
134
ogfx_gpu_reg ogfx_gpu_reg_inst (
135
 
136
// OUTPUTs
137
    .gpu_cmd_done_evt_o      (gpu_cmd_done_evt_o    ),     // GPU command done event
138
    .gpu_cmd_error_evt_o     (gpu_cmd_error_evt_o   ),     // GPU command error event
139
    .gpu_get_data_o          (gpu_get_data_o        ),     // GPU get next data
140
 
141
    .exec_fill_o             (exec_fill             ),     // Rectangle fill on going
142
    .exec_copy_o             (exec_copy             ),     // Rectangle copy on going
143
    .exec_copy_trans_o       (exec_copy_trans       ),     // Rectangle transparent copy on going
144
    .trig_exec_o             (trig_exec             ),     // Trigger rectangle execution
145
 
146
    .cfg_dst_px_addr_o       (cfg_dst_px_addr       ),     // Destination pixel address configuration
147
    .cfg_dst_cl_swp_o        (cfg_dst_cl_swp        ),     // Destination Column/Line-Swap configuration
148
    .cfg_dst_x_swp_o         (cfg_dst_x_swp         ),     // Destination X-Swap configuration
149
    .cfg_dst_y_swp_o         (cfg_dst_y_swp         ),     // Destination Y-Swap configuration
150
    .cfg_fill_color_o        (cfg_fill_color        ),     // Fill color (for rectangle fill operation)
151
    .cfg_pix_op_sel_o        (cfg_pix_op_sel        ),     // Pixel operation to be performed during the copy
152
    .cfg_rec_width_o         (cfg_rec_width         ),     // Rectangle width configuration
153
    .cfg_rec_height_o        (cfg_rec_height        ),     // Rectangle height configuration
154
    .cfg_src_px_addr_o       (cfg_src_px_addr       ),     // Source pixel address configuration
155
    .cfg_src_cl_swp_o        (cfg_src_cl_swp        ),     // Source Column/Line-Swap configuration
156
    .cfg_src_x_swp_o         (cfg_src_x_swp         ),     // Source X-Swap configuration
157
    .cfg_src_y_swp_o         (cfg_src_y_swp         ),     // Source Y-Swap configuration
158
    .cfg_transparent_color_o (cfg_transparent_color ),     // Transparent color (for rectangle transparent copy operation)
159
 
160
 
161
// INPUTs
162
    .mclk                    (mclk                  ),     // Main system clock
163
    .puc_rst                 (puc_rst               ),     // Main system reset
164
 
165
    .gpu_data_i              (gpu_data_i            ),     // GPU data
166
    .gpu_data_avail_i        (gpu_data_avail_i      ),     // GPU data available
167
    .gfx_mode_i              (gfx_mode_i            ),     // Video mode (1xx:16bpp / 011:8bpp / 010:4bpp / 001:2bpp / 000:1bpp)
168
    .gpu_enable_i            (gpu_enable_i          ),     // GPU enable
169
 
170
    .gpu_exec_done_i         (gpu_exec_done         )      // GPU execution done
171
);
172
 
173
//=============================================================================
174
// 3)  2D-DMA
175
//=============================================================================
176
 
177
ogfx_gpu_dma ogfx_gpu_dma_inst (
178
 
179
// OUTPUTs
180
    .gpu_exec_done_o         (gpu_exec_done         ),     // GPU execution done
181
 
182
    .vid_ram_addr_o          (vid_ram_addr_o        ),     // Video-RAM address
183
    .vid_ram_din_o           (vid_ram_din_o         ),     // Video-RAM data
184
    .vid_ram_wen_o           (vid_ram_wen_o         ),     // Video-RAM write strobe (active low)
185
    .vid_ram_cen_o           (vid_ram_cen_o         ),     // Video-RAM chip enable (active low)
186
 
187
// INPUTs
188
    .mclk                    (mclk                  ),     // Main system clock
189
    .puc_rst                 (puc_rst               ),     // Main system reset
190
 
191
    .cfg_dst_px_addr_i       (cfg_dst_px_addr       ),     // Destination pixel address configuration
192
    .cfg_dst_cl_swp_i        (cfg_dst_cl_swp        ),     // Destination Column/Line-Swap configuration
193
    .cfg_dst_x_swp_i         (cfg_dst_x_swp         ),     // Destination X-Swap configuration
194
    .cfg_dst_y_swp_i         (cfg_dst_y_swp         ),     // Destination Y-Swap configuration
195
    .cfg_fill_color_i        (cfg_fill_color        ),     // Fill color (for rectangle fill operation)
196
    .cfg_pix_op_sel_i        (cfg_pix_op_sel        ),     // Pixel operation to be performed during the copy
197
    .cfg_rec_width_i         (cfg_rec_width         ),     // Rectangle width configuration
198
    .cfg_rec_height_i        (cfg_rec_height        ),     // Rectangle height configuration
199
    .cfg_src_px_addr_i       (cfg_src_px_addr       ),     // Source pixel address configuration
200
    .cfg_src_cl_swp_i        (cfg_src_cl_swp        ),     // Source Column/Line-Swap configuration
201
    .cfg_src_x_swp_i         (cfg_src_x_swp         ),     // Source X-Swap configuration
202
    .cfg_src_y_swp_i         (cfg_src_y_swp         ),     // Source Y-Swap configuration
203
    .cfg_transparent_color_i (cfg_transparent_color ),     // Transparent color (for rectangle transparent copy operation)
204
 
205
    .display_width_i         (display_width_i       ),     // Display width
206
 
207
    .gfx_mode_i              (gfx_mode_i            ),     // Video mode (1xx:16bpp / 011:8bpp / 010:4bpp / 001:2bpp / 000:1bpp)
208
 
209
    .gpu_enable_i            (gpu_enable_i          ),     // GPU enable
210
 
211
    .exec_fill_i             (exec_fill             ),     // Rectangle fill on going
212
    .exec_copy_i             (exec_copy             ),     // Rectangle copy on going
213
    .exec_copy_trans_i       (exec_copy_trans       ),     // Rectangle transparent copy on going
214
    .trig_exec_i             (trig_exec             ),     // Trigger rectangle execution
215
 
216
    .vid_ram_dout_i          (vid_ram_dout_i        ),     // Video-RAM data input
217
    .vid_ram_dout_rdy_nxt_i  (vid_ram_dout_rdy_nxt_i)      // Video-RAM data output ready during next cycle
218
);
219
 
220
endmodule // ogfx_gpu
221
 
222
`ifdef OGFX_NO_INCLUDE
223
`else
224
`include "openGFX430_undefines.v"
225
`endif

powered by: WebSVN 2.1.0

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