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

Subversion Repositories lq057q3dc02

[/] [lq057q3dc02/] [trunk/] [design/] [components.vhd] - Blame information for rev 30

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

Line No. Rev Author Line
1 30 jwdonal
------------------------------------------------------------------------------
2
-- Copyright (C) 2007 Jonathon W. Donaldson
3
--                    jwdonal a t opencores DOT org
4
--
5
--  This program is free software; you can redistribute it and/or modify
6
--  it under the terms of the GNU General Public License as published by
7
--  the Free Software Foundation; either version 2 of the License, or
8
--  (at your option) any later version.
9
--
10
--  This program is distributed in the hope that it will be useful,
11
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
--  GNU General Public License for more details.
14
--
15
--  You should have received a copy of the GNU General Public License
16
--  along with this program; if not, write to the Free Software
17
--  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
--
19
------------------------------------------------------------------------------
20
--
21
-- $Id: components.vhd,v 1.1 2008-11-07 00:48:12 jwdonal Exp $
22
--
23
-- Description:
24
--   This is a package that lists all of the components used in the design.
25
--
26
-- Structure:
27
--   - xupv2p.ucf
28
--   - components.vhd
29
--   - lq057q3dc02_tb.vhd
30
--   - lq057q3dc02.vhd
31
--     - dcm_sys_to_lcd.xaw
32
--     - video_controller.vhd
33
--       - enab_control.vhd
34
--       - hsyncx_control.vhd
35
--       - vsyncx_control.vhd
36
--       - pix_enab_clk_cntr.vhd
37
--     - image_gen.vhd
38
--       - image_gen_bram_red.xco
39
--       - image_gen_bram_green.xco
40
--       - image_gen_bram_blue.xco
41
--
42
------------------------------------------------------------------------------
43
--
44
-- Naming Conventions:
45
--   active low signals                                       "*x"
46
--   clock signal                                             "CLK_*"
47
--   reset signal                                             "RST"
48
--   generic                                                  "C_*"
49
--   user defined type                                        "TYPE_*"
50
--   state machine next state                                 "*_ns"
51
--   state machine current state                              "*_cs""
52
--   pipelined signals                                        "*_d#"
53
--   register delay signals                                   "*_p#"
54
--   signal                                                   "*_sig"
55
--   variable                                                 "*_var"
56
--   clock enable signals                                     "*_ce"
57
--   internal version of output port used as register         "*_reg"
58
--   internal version of output port used as connecting wire  "*_wire"
59
--   input/output port                                        "ALL_CAPS"
60
--   process                                                  "*_PROC"
61
--
62
------------------------------------------------------------------------------
63
 
64
LIBRARY IEEE;
65
USE IEEE.STD_LOGIC_1164.ALL;
66
 
67
PACKAGE components IS
68
 
69
  ATTRIBUTE BOX_TYPE: string; -- used to remove "Black Box" warning messages in the synthesis report
70
 
71
  ----------------------
72
  -- DCM LCD Clock
73
  ----------------------
74
  COMPONENT dcm_sys_to_lcd
75
  PORT (
76
    RST_IN,
77
    CLKIN_IN : IN STD_LOGIC;
78
 
79
    CLKIN_IBUFG_OUT,
80
    CLK0_OUT,
81
    CLKDV_OUT,
82
    CLKFX_OUT       : OUT STD_LOGIC
83
  );
84
  END COMPONENT dcm_sys_to_lcd;
85
 
86
 
87
  ----------------------
88
  -- CLK_LCD Cycle Counter for ENAB and
89
  -- image_gen_bram controllers
90
  ----------------------
91
  COMPONENT clk_lcd_cyc_cntr is
92
  GENERIC (
93
    C_VSYNC_TVS,
94
    C_LINE_NUM_WIDTH,
95
 
96
    C_CLK_LCD_CYC_NUM_WIDTH,
97
 
98
    C_ENAB_TEP,
99
    C_ENAB_THE : POSITIVE
100
  );
101
 
102
  PORT (
103
    RSTx,
104
    CLK_LCD,
105
    HSYNCx,
106
    VSYNCx : IN std_logic;
107
 
108
    LINE_NUM : IN std_logic_vector(C_LINE_NUM_WIDTH-1 downto 0);
109
 
110
    CLK_LCD_CYC_NUM : OUT std_logic_vector(C_CLK_LCD_CYC_NUM_WIDTH-1 downto 0)
111
  );
112
  END COMPONENT clk_lcd_cyc_cntr;
113
 
114
  ----------------------
115
  -- Video Controller
116
  ----------------------
117
  COMPONENT video_controller is
118
  GENERIC (
119
    --Video Controller
120
    C_RL_STATUS,
121
    C_UD_STATUS,
122
    C_VQ_STATUS : STD_LOGIC;
123
 
124
    --VSYNCx Controller (pass thru)
125
    C_VSYNC_TV,
126
    C_VSYNC_TVP,
127
    C_VSYNC_TVS,
128
    C_LINE_NUM_WIDTH,
129
 
130
    --HSYNCx Controller (pass thru)
131
    C_HSYNC_TH,
132
    C_HSYNC_THP,
133
    C_NUM_CLKS_WIDTH,
134
 
135
    --CLK_LCD Cycle Counter (pass thru)
136
    C_CLK_LCD_CYC_NUM_WIDTH,
137
 
138
    --ENAB Controller (pass thru)
139
    C_ENAB_TEP,
140
    C_ENAB_THE : POSITIVE
141
  );
142
 
143
  PORT (
144
    RSTx,
145
    CLK_LCD : IN  STD_LOGIC;
146
 
147
    LINE_NUM : OUT STD_LOGIC_VECTOR(C_LINE_NUM_WIDTH-1 downto 0);
148
 
149
    CLK_LCD_CYC_NUM : OUT STD_LOGIC_VECTOR(C_CLK_LCD_CYC_NUM_WIDTH-1 downto 0);
150
 
151
    HSYNCx,
152
    VSYNCx,
153
    ENAB,
154
    RL,
155
    UD,
156
    VQ    : OUT STD_LOGIC
157
  );
158
  END COMPONENT video_controller;
159
 
160
 
161
  ----------------------
162
  -- HSYNCx Control
163
  ----------------------
164
  COMPONENT hsyncx_control is
165
  GENERIC (
166
    C_HSYNC_TH,
167
    C_HSYNC_THP,
168
    C_NUM_CLKS_WIDTH : POSITIVE
169
  );
170
  PORT (
171
    RSTx,
172
    CLK_LCD : IN  STD_LOGIC;
173
 
174
    HSYNCx  : OUT STD_LOGIC
175
  );
176
  END COMPONENT hsyncx_control;
177
 
178
 
179
  ----------------------
180
  -- VSYNCx Control
181
  ----------------------
182
  COMPONENT vsyncx_control is
183
  GENERIC (
184
    C_VSYNC_TV,
185
    C_VSYNC_TVP,
186
    C_LINE_NUM_WIDTH : POSITIVE
187
  );
188
 
189
  PORT (
190
    RSTx,
191
    CLK_LCD,
192
    HSYNCx   : IN  STD_LOGIC;
193
 
194
    LINE_NUM : OUT STD_LOGIC_VECTOR(C_LINE_NUM_WIDTH-1 downto 0);
195
 
196
    VSYNCx   : OUT STD_LOGIC
197
  );
198
  END COMPONENT vsyncx_control;
199
 
200
 
201
  ----------------------
202
  -- ENAB Control
203
  ----------------------
204
  COMPONENT enab_control is
205
  GENERIC (
206
    C_VSYNC_TVS,
207
 
208
    C_CLK_LCD_CYC_NUM_WIDTH,
209
 
210
    C_ENAB_TEP,
211
    C_ENAB_THE : POSITIVE
212
  );
213
  PORT (
214
    RSTx,
215
    CLK_LCD : IN STD_LOGIC;
216
 
217
    CLK_LCD_CYC_NUM : IN STD_LOGIC_VECTOR(C_CLK_LCD_CYC_NUM_WIDTH-1 downto 0);
218
 
219
    ENAB  : OUT STD_LOGIC
220
  );
221
  END COMPONENT enab_control;
222
 
223
 
224
  -----------------------
225
  -- BRAM Image Generator
226
  -----------------------
227
  COMPONENT image_gen_bram is
228
  GENERIC (
229
    C_BIT_DEPTH,
230
 
231
    C_VSYNC_TVS,
232
    C_LINE_NUM_WIDTH,
233
 
234
    C_CLK_LCD_CYC_NUM_WIDTH,
235
 
236
    C_ENAB_TEP,
237
    C_ENAB_THE,
238
 
239
    C_BRAM_ADDR_WIDTH,
240
    C_IMAGE_WIDTH,
241
    C_IMAGE_HEIGHT : POSITIVE
242
  );
243
  PORT (
244
    RSTx,
245
    CLK_LCD : IN STD_LOGIC;
246
 
247
    LINE_NUM : IN STD_LOGIC_VECTOR(C_LINE_NUM_WIDTH-1 downto 0);
248
 
249
    CLK_LCD_CYC_NUM : IN STD_LOGIC_VECTOR(C_CLK_LCD_CYC_NUM_WIDTH-1 downto 0);
250
 
251
    R,
252
    G,
253
    B : OUT STD_LOGIC_VECTOR(C_BIT_DEPTH/3-1 downto 0)
254
  );
255
  END COMPONENT image_gen_bram;
256
 
257
 
258
  --------------------------
259
  -- Image Generator BRAM --
260
  --------------------------
261
  --You can't simply instantiate one XCO BRAM component 3 times because all
262
  --three components are initialized with 3 different COE files!
263
  --We also use SINIT in place of EN port because disabling EN (i.e. making it '0')
264
  --cuases the output ports to remain at the last output value.  SINIT
265
  --resets the output back to '0' whenever it is disabled.  Which is exactly what we want
266
  --b/c if the last value reamins (as it would with EN) the last pixel drawn for the
267
  --image in each row would be "smeared" across the remaining pixels in the row!
268
  COMPONENT image_gen_bram_red
269
  PORT (
270
    CLK,
271
    SINIT : IN STD_LOGIC;
272
    ADDR : IN STD_LOGIC_VECTOR(17-1 downto 0);
273
    DOUT : OUT STD_LOGIC_VECTOR(6-1 downto 0)
274
  );
275
  END COMPONENT;
276
  ATTRIBUTE BOX_TYPE of image_gen_bram_red: component is "USER_BLACK_BOX";
277
 
278
  COMPONENT image_gen_bram_green
279
  PORT (
280
    CLK,
281
    SINIT : IN STD_LOGIC;
282
    ADDR : IN STD_LOGIC_VECTOR(17-1 downto 0);
283
    DOUT : OUT STD_LOGIC_VECTOR(6-1 downto 0)
284
  );
285
  END COMPONENT;
286
  ATTRIBUTE BOX_TYPE of image_gen_bram_green: component is "USER_BLACK_BOX";
287
 
288
  COMPONENT image_gen_bram_blue
289
  PORT (
290
    CLK,
291
    SINIT : IN STD_LOGIC;
292
    ADDR : IN STD_LOGIC_VECTOR(17-1 downto 0);
293
    DOUT : OUT STD_LOGIC_VECTOR(6-1 downto 0)
294
  );
295
  END COMPONENT;
296
  ATTRIBUTE BOX_TYPE of image_gen_bram_blue: component is "USER_BLACK_BOX";
297
 
298
 
299
END PACKAGE components;

powered by: WebSVN 2.1.0

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