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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [fpga/] [altera_de0_nano_soc/] [rtl/] [verilog/] [opengfx430/] [openGFX430_defines.v] - Blame information for rev 221

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 221 olivier.gi
//----------------------------------------------------------------------------
2
// Copyright (C) 2009 , Olivier Girard
3
//
4
// Redistribution and use in source and binary forms, with or without
5
// modification, are permitted provided that the following conditions
6
// are met:
7
//     * Redistributions of source code must retain the above copyright
8
//       notice, this list of conditions and the following disclaimer.
9
//     * Redistributions in binary form must reproduce the above copyright
10
//       notice, this list of conditions and the following disclaimer in the
11
//       documentation and/or other materials provided with the distribution.
12
//     * Neither the name of the authors nor the names of its contributors
13
//       may be used to endorse or promote products derived from this software
14
//       without specific prior written permission.
15
//
16
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
21
// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26
// THE POSSIBILITY OF SUCH DAMAGE
27
//
28
//----------------------------------------------------------------------------
29
//
30
// *File Name: openGFX430_defines.v
31
//
32
// *Module Description:
33
//                      oMSP Graphic Controller Configuration file
34
//
35
// *Author(s):
36
//              - Olivier Girard,    olgirard@gmail.com
37
//
38
//----------------------------------------------------------------------------
39
// $Rev: 103 $
40
// $LastChangedBy: olivier.girard $
41
// $LastChangedDate: 2011-03-05 15:44:48 +0100 (Sat, 05 Mar 2011) $
42
//----------------------------------------------------------------------------
43
//`define OGFX_NO_INCLUDE
44
`ifdef OGFX_NO_INCLUDE
45
`else
46
`include "openGFX430_undefines.v"
47
`endif
48
 
49
//============================================================================
50
// GRAPHIC CONTROLLER USER CONFIGURATION
51
//============================================================================
52
 
53
//-----------------------------------------------------
54
// Video display maximum pixel height/width
55
//-----------------------------------------------------
56
//`define MAX_DISPLAY_PIXEL_LENGTH_4096
57
//`define MAX_DISPLAY_PIXEL_LENGTH_2048
58
//`define MAX_DISPLAY_PIXEL_LENGTH_1024
59
`define MAX_DISPLAY_PIXEL_LENGTH_512
60
//`define MAX_DISPLAY_PIXEL_LENGTH_256
61
//`define MAX_DISPLAY_PIXEL_LENGTH_128
62
//`define MAX_DISPLAY_PIXEL_LENGTH_64
63
//`define MAX_DISPLAY_PIXEL_LENGTH_32
64
 
65
//-----------------------------------------------------
66
// Video memory address width
67
//-----------------------------------------------------
68
`define VRAM_AWIDTH  17
69
 
70
//-----------------------------------------------------
71
// Define if the Video memory is bigger than 4k Words
72
// (should be defined if VRAM_AWIDTH is bigger than 12)
73
//-----------------------------------------------------
74
`define VRAM_BIGGER_4_KW
75
 
76
//-----------------------------------------------------
77
// Include/Exclude Frame buffer pointers from the
78
// register map
79
// (Frame pointer 0 is always included)
80
//-----------------------------------------------------
81
`define WITH_FRAME1_POINTER
82
//`define WITH_FRAME2_POINTER
83
//`define WITH_FRAME3_POINTER
84
 
85
//-----------------------------------------------------
86
// LUT Configuration
87
//-----------------------------------------------------
88
`define WITH_PROGRAMMABLE_LUT
89
`define WITH_EXTRA_LUT_BANK
90
 
91
 
92
 
93
//==========================================================================//
94
//==========================================================================//
95
//==========================================================================//
96
//==========================================================================//
97
//=====        SYSTEM CONSTANTS --- !!!!!!!! DO NOT EDIT !!!!!!!!      =====//
98
//==========================================================================//
99
//==========================================================================//
100
//==========================================================================//
101
//==========================================================================//
102
 
103
`ifdef MAX_DISPLAY_PIXEL_LENGTH_4096
104
  `define LPIX_MSB    11
105
  `define LPIX_SIZE 4096
106
  `define WITH_DISPLAY_SIZE_HI
107
`endif
108
`ifdef MAX_DISPLAY_PIXEL_LENGTH_2048
109
  `define LPIX_MSB    10
110
  `define LPIX_SIZE 2048
111
  `define WITH_DISPLAY_SIZE_HI
112
`endif
113
`ifdef MAX_DISPLAY_PIXEL_LENGTH_1024
114
  `define LPIX_MSB     9
115
  `define LPIX_SIZE 1024
116
  `define WITH_DISPLAY_SIZE_HI
117
`endif
118
`ifdef MAX_DISPLAY_PIXEL_LENGTH_512
119
  `define LPIX_MSB     8
120
  `define LPIX_SIZE  512
121
  `define WITH_DISPLAY_SIZE_HI
122
`endif
123
`ifdef MAX_DISPLAY_PIXEL_LENGTH_256
124
  `define LPIX_MSB     7
125
  `define LPIX_SIZE  256
126
`endif
127
`ifdef MAX_DISPLAY_PIXEL_LENGTH_128
128
  `define LPIX_MSB     6
129
  `define LPIX_SIZE  128
130
`endif
131
`ifdef MAX_DISPLAY_PIXEL_LENGTH_64
132
  `define LPIX_MSB     5
133
  `define LPIX_SIZE   64
134
`endif
135
`ifdef MAX_DISPLAY_PIXEL_LENGTH_32
136
  `define LPIX_MSB     4
137
  `define LPIX_SIZE   32
138
`endif
139
`define   SPIX_MSB     (((`LPIX_MSB+1)*2)-1)
140
`ifdef WITH_DISPLAY_SIZE_HI
141
  `define SPIX_HI_MSB  (`SPIX_MSB-16)
142
  `define SPIX_LO_MSB  15
143
`else
144
  `define SPIX_LO_MSB  `SPIX_MSB
145
`endif
146
 
147
`define  VRAM_MSB    (`VRAM_AWIDTH-1)
148
 
149
`define  APIX_WIDTH  (`VRAM_AWIDTH+4)
150
`define  APIX_MSB    (`APIX_WIDTH-1)
151
`ifdef VRAM_BIGGER_4_KW
152
 `define APIX_HI_MSB (`APIX_MSB-16)
153
 `define APIX_LO_MSB 15
154
`else
155
 `define APIX_LO_MSB `APIX_MSB
156
`endif
157
 
158
`ifdef WITH_EXTRA_LUT_BANK
159
 `define LRAM_AWIDTH 9
160
`else
161
 `define LRAM_AWIDTH 8
162
`endif
163
`define LRAM_MSB  (`LRAM_AWIDTH-1)
164
 
165
 
166
// Opcodes for GPU commands
167
`define OP_EXEC_FILL         2'b00
168
`define OP_EXEC_COPY         2'b01
169
`define OP_EXEC_COPY_TRANS   2'b10
170
`define OP_REC_WIDTH         4'b1100
171
`define OP_REC_HEIGHT        4'b1101
172
`define OP_SRC_PX_ADDR      {4'b1111, 2'b10, 10'b0000000000}
173
`define OP_DST_PX_ADDR      {4'b1111, 2'b10, 10'b0000000001}
174
`define OP_OF0_ADDR         {4'b1111, 2'b10, 10'b0000010000}
175
`define OP_OF1_ADDR         {4'b1111, 2'b10, 10'b0000010001}
176
`define OP_OF2_ADDR         {4'b1111, 2'b10, 10'b0000010010}
177
`define OP_OF3_ADDR         {4'b1111, 2'b10, 10'b0000010011}
178
`define OP_SET_FILL         {4'b1111, 2'b01, 10'b0000100000}
179
`define OP_SET_TRANSPARENT  {4'b1111, 2'b01, 10'b0000100001}
180
 
181
// Bit possitions of the GPU Command
182
`define SRC_OFFSET          13:12
183
`define SRC_X_SWAP          11
184
`define SRC_Y_SWAP          10
185
`define SRC_CL_SWAP          9
186
`define PX_OP                8:5
187
`define DST_OFFSET           4:3
188
`define DST_X_SWAP           2
189
`define DST_Y_SWAP           1
190
`define DST_CL_SWAP          0
191
 
192
 
193
//----------------------------------
194
// Configuration checkers
195
//----------------------------------
196
`ifdef WITH_FRAME2_POINTER
197
 `ifdef WITH_FRAME1_POINTER
198
 `else
199
GFX CONTROLLER CONFIGURATION ERROR: ENABLED FRAME2 POINTER WITHOUT FRAME1 POINTER
200
 `endif
201
`endif
202
`ifdef WITH_FRAME3_POINTER
203
 `ifdef WITH_FRAME2_POINTER
204
 `else
205
GFX CONTROLLER CONFIGURATION ERROR: ENABLED FRAME2 POINTER WITHOUT FRAME1 POINTER
206
 `endif
207
`endif
208
`ifdef WITH_PROGRAMMABLE_LUT
209
`else
210
`ifdef WITH_EXTRA_LUT_BANK
211
GFX CONTROLLER CONFIGURATION ERROR: NOT ALLOWED TO ENABLE EXTRA LUT BANK IF PROGRAMMABLE LUT SUPPORT IS DISABLED
212
`endif
213
`endif

powered by: WebSVN 2.1.0

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