OSDN Git Service

f05b3b49c17df46e61d7bf9ac7b68c183f80efed
[fpga-leon-mjpeg/leon-mjpeg.git] / grlib-gpl-1.0.22-b4095 / lib / kuri / mjpeg / mjpeg.vhd.bak
1 ------------------------------------------------------------------------------
2 --  Copyright (C) 20011 , Kenichi Kurimoto
3 --
4 --  This program is free software; you can redistribute it and/or modify
5 --  it under the terms of the GNU General Public License as published by
6 --  the Free Software Foundation; either version 2 of the License, or
7 --  (at your option) any later version.
8 --
9 --  This program is distributed in the hope that it will be useful,
10 --  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 --  GNU General Public License for more details.
13 --
14 --  You should have received a copy of the GNU General Public License
15 --  along with this program; if not, write to the Free Software
16 --  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
17 -----------------------------------------------------------------------------
18 -- Entity:      mjpeg package 
19 -- File:        mjpeg.vhd
20 -- Author:      Kenichi Kurimoto 
21 -- Description: motion JPEG package
22 ------------------------------------------------------------------------------
23
24
25
26 library ieee;
27 use ieee.std_logic_1164.all;
28 use ieee.numeric_std.all;
29
30 library grlib;
31 use grlib.stdlib.all;
32 use grlib.amba.all;
33 use grlib.devices.all;
34
35 library techmap;
36 use techmap.gencomp.all;
37
38 package mjpeg is
39
40 type jpg_set_type is record
41   samp_fact : std_logic;
42   xmcumax   : std_logic_vector(5 downto 0);
43   ymcumax   : std_logic_vector(4 downto 0);
44   incaddy   : std_logic_vector(15 downto 0);
45   incaddmcux : std_logic_vector(15 downto 0);
46   incaddmcuy : std_logic_vector(10 downto 0);
47   fbstartadd : std_logic_vector(31 downto 0);
48 end record;
49
50 component huffdctycc is
51    generic (
52       memtech : integer := DEFMEMTECH;
53       shindex : integer := 0;
54       haddr  : integer := 0;
55       hmask  : integer := 16#fff#;
56       hirq   : integer := 0;      
57       pindex : integer := 0;
58       paddr  : integer := 0;
59       pmask  : integer := 16#fff#;
60       mhindex : integer := 0;
61       chprot : integer := 3);      
62
63    port (
64       rst   : in std_ulogic;
65       clk   : in std_ulogic;
66       ahbmi : in ahb_mst_in_type;
67       ahbmo : out ahb_mst_out_type;
68       ahbsi : in ahb_slv_in_type;
69       ahbso : out ahb_slv_out_type;
70       apbi  : in apb_slv_in_type;
71       apbo  : out apb_slv_out_type;
72       logan_sig : out std_logic_vector(31 downto 0)
73    );
74 end component;
75
76 component huff  is
77    generic (
78       memtech : integer := DEFMEMTECH;
79       shindex : integer := 0;
80       haddr  : integer := 0;
81       hmask  : integer := 16#fff#;
82       hirq   : integer := 0;      
83       pindex : integer := 0;
84       paddr  : integer := 0;
85       pmask  : integer := 16#fff#;
86       mhindex : integer := 0;
87       chprot : integer := 3);      
88    port (
89       rst   : in std_ulogic;
90       clk   : in std_ulogic;
91       ahbsi : in ahb_slv_in_type;
92       ahbso : out ahb_slv_out_type;
93       apbi  : in apb_slv_in_type;
94       apbo  : out apb_slv_out_type;
95       kready : in std_logic;
96       kstrobe : out std_logic;
97       kdata   : out std_logic_vector(11 downto 0);
98       kaddress : out std_logic_vector(5 downto 0);
99       jpg_setting : out jpg_set_type;
100       error : in std_logic_vector(2 downto 0);
101       startgen : out std_logic;
102       kstrobeq : out std_logic;
103       kdataq : out std_logic_vector(7 downto 0);
104       kaddq : out std_logic_vector(7 downto 0);
105       krddataq : in std_logic_vector(7 downto 0);
106       krdq : out std_logic      
107    );
108 end component;
109
110 component huffmemcont is
111    generic (
112       memtech : integer := DEFMEMTECH);
113    port (
114       rst   : in std_ulogic;
115       clk   : in std_ulogic;
116       kready1  : out std_logic;
117       kstrobe1 : in std_logic;
118       kaddress1 : in std_logic_vector(5 downto 0);
119       kdata1   : in std_logic_vector(11 downto 0);
120       kready2  : in std_logic;
121       kstrobe2 : out std_logic;
122       kdata2   : out std_logic_vector(11 downto 0);
123       error    : out std_logic;
124       samp_fact : in std_logic;
125       kstrobeq1 : in std_logic;
126       kdataq1   : in std_logic_vector(7 downto 0);
127       kdataq2   : out std_logic_vector(7 downto 0);      
128       kaddq : in std_logic_vector(7 downto 0);
129       krdq : in std_logic;
130       krddataq : out std_logic_vector(7 downto 0);
131       startgen : in std_logic
132    );
133 end component;
134
135 component dctmem1cont is
136    generic (
137       memtech : integer := DEFMEMTECH);
138    port (
139       rst   : in std_ulogic;
140       clk   : in std_ulogic;
141       kready1  : out std_logic;
142       kstrobe1 : in std_logic;
143       kdata1   : in std_logic_vector(11 downto 0);
144       kready2  : in std_logic;
145       kstrobe2 : out std_logic;
146       kdata2   : out std_logic_vector(11 downto 0);
147       error    : out std_logic;
148       samp_fact : in std_logic;
149       kstrobeq1 : in std_logic;
150       kdataq1   : in std_logic_vector(7 downto 0);
151       kdataq2   : out std_logic_vector(7 downto 0)
152    );
153 end component;
154
155 component dctmem2cont is
156    generic (
157       memtech : integer := DEFMEMTECH);
158    port (
159       rst   : in std_ulogic;
160       clk   : in std_ulogic;
161       kready1  : out std_logic;
162       kstrobe1 : in std_logic;
163       kdata1   : in std_logic_vector(15 downto 0);
164       kready2  : in std_logic;
165       kstrobe2 : out std_logic;
166       kdata2   : out std_logic_vector(15 downto 0);
167       error     : out std_logic;
168       startgen  : in std_logic
169    );
170 end component;
171
172 component idct1 is
173     port ( rst : in  std_ulogic;
174            clk : in  std_ulogic;
175            ready1 : out std_logic;
176            strobe1 : in std_logic;
177            coeffin : in  std_logic_vector (11 downto 0);
178            quantin : in  std_logic_vector (7 downto 0);
179            outdata : out  std_logic_vector (15 downto 0);
180            ready2 : in std_logic;
181            strobe2 : out std_logic;
182            startgen : in std_logic
183            );
184 end component;
185
186 component idct2 is
187     port ( rst : in  std_ulogic;
188            clk : in  std_ulogic;
189            ready1 : out std_logic;
190            strobe1 : in std_logic;
191            coeffin : in  std_logic_vector (15 downto 0);
192            outdata : out  std_logic_vector (7 downto 0);
193            ready2 : in std_logic;
194            strobe2 : out std_logic;
195            startgen : in std_logic
196            );
197 end component;
198
199 component yccambaif
200      generic (
201       memtech : integer := DEFMEMTECH;
202       shindex : integer := 0;
203       haddr  : integer := 0;
204       hmask  : integer := 16#fff#;
205       hirq   : integer := 0;      
206       pindex : integer := 0;
207       paddr  : integer := 0;
208       pmask  : integer := 16#fff#);
209    port (
210       rst   : in std_ulogic;
211       clk   : in std_ulogic;
212       ahbsi : in ahb_slv_in_type;
213       ahbso : out ahb_slv_out_type;
214       apbi  : in apb_slv_in_type;
215       apbo  : out apb_slv_out_type;
216       kready : in std_logic;
217       kstrobe : out std_logic;
218       kdata   : out std_logic_vector(11 downto 0);
219       samp_fact : out std_logic;
220       error : in std_logic_vector(2 downto 0);
221       xmcumax : out std_logic_vector(5 downto 0);
222       ymcumax : out std_logic_vector(4 downto 0);
223       incaddy  : out std_logic_vector(15 downto 0);
224       incaddmcux : out std_logic_vector(15 downto 0);
225       incaddmcuy : out std_logic_vector(10 downto 0);
226       fbstartadd : out std_logic_vector(31 downto 0);
227       startgen : out std_logic;
228       kstrobeq : out std_logic;
229       kdataq : out std_logic_vector(7 downto 0)
230    );
231 end component;
232
233 component yccmemcont
234    generic (
235       memtech : integer := DEFMEMTECH);
236    port (
237       rst   : in std_ulogic;
238       clk   : in std_ulogic;
239       kready1  : out std_logic;
240       kstrobe1 : in std_logic;
241       kdata1   : in std_logic_vector(7 downto 0);
242       kready2  : in std_logic;
243       kstrobe2 : out std_logic;
244       kdata2   : out std_logic_vector(23 downto 0);
245       samp_fact : in std_logic;
246       error     : out std_logic;
247       startgen  : in std_logic
248    );
249 end component;
250
251 component yccrgb
252    generic (
253       memtech : integer := DEFMEMTECH;
254       hirq   : integer := 0;       
255       mhindex : integer := 0;
256       chprot : integer := 3);
257    port (
258       rst   : in std_ulogic;
259       clk   : in std_ulogic;
260       ahbmi : in ahb_mst_in_type;
261       ahbmo : out ahb_mst_out_type;
262       kready  : out std_logic;
263       kstrobe : in std_logic;
264       kdata   : in std_logic_vector(23 downto 0);
265       xmcumax : in std_logic_vector(5 downto 0);
266       ymcumax : in std_logic_vector(4 downto 0);
267       incaddy  : in std_logic_vector(15 downto 0);
268       incaddmcux : in std_logic_vector(15 downto 0);      
269       incaddmcuy : in std_logic_vector(10 downto 0);
270       fbstartadd : in std_logic_vector(31 downto 0);
271       startgen   : in std_logic
272    );
273 end component;
274
275 end;