1 |
145 |
lanttu |
-------------------------------------------------------------------------------
|
2 |
|
|
-- Title : DCT QI DCT block and dct_2_hibi together
|
3 |
|
|
-- Project :
|
4 |
|
|
-------------------------------------------------------------------------------
|
5 |
|
|
-- File : dctqidct_top.vhd
|
6 |
|
|
-- Author :
|
7 |
|
|
-- Company :
|
8 |
|
|
-- Created : 2006-07-13
|
9 |
|
|
-- Last update: 2006-08-03
|
10 |
|
|
-- Platform :
|
11 |
|
|
-- Standard : VHDL'87
|
12 |
|
|
-------------------------------------------------------------------------------
|
13 |
|
|
-- Copyright (c) 2006
|
14 |
|
|
-------------------------------------------------------------------------------
|
15 |
|
|
-- Revisions :
|
16 |
|
|
-- Date Version Author Description
|
17 |
|
|
-- 2006-07-13 1.0 rasmusa Created
|
18 |
|
|
-------------------------------------------------------------------------------
|
19 |
|
|
|
20 |
|
|
library ieee;
|
21 |
|
|
use ieee.std_logic_1164.all;
|
22 |
|
|
|
23 |
|
|
library dct;
|
24 |
|
|
library idct;
|
25 |
|
|
library quantizer;
|
26 |
|
|
library dctQidct;
|
27 |
|
|
|
28 |
|
|
use dct.DCT_pkg.all;
|
29 |
|
|
use idct.IDCT_pkg.all;
|
30 |
|
|
use quantizer.Quantizer_pkg.all;
|
31 |
|
|
|
32 |
|
|
entity dctqidct_top is
|
33 |
|
|
|
34 |
|
|
generic (
|
35 |
|
|
data_width_g : integer := 32;
|
36 |
|
|
comm_width_g : integer := 3;
|
37 |
|
|
use_self_rel_g : integer := 1;
|
38 |
|
|
own_address_g : integer := 0;
|
39 |
|
|
rtm_address_g : integer := 0;
|
40 |
|
|
debug_w_g : integer := 1
|
41 |
|
|
);
|
42 |
|
|
|
43 |
|
|
port (
|
44 |
|
|
clk : in std_logic;
|
45 |
|
|
rst_n : in std_logic;
|
46 |
|
|
|
47 |
|
|
data_in : in std_logic_vector(data_width_g-1 downto 0);
|
48 |
|
|
comm_in : in std_logic_vector(comm_width_g-1 downto 0);
|
49 |
|
|
av_in : in std_logic;
|
50 |
|
|
empty_in : in std_logic;
|
51 |
|
|
re_out : out std_logic;
|
52 |
|
|
data_out : out std_logic_vector(data_width_g-1 downto 0);
|
53 |
|
|
comm_out : out std_logic_vector(comm_width_g-1 downto 0);
|
54 |
|
|
av_out : out std_logic;
|
55 |
|
|
we_out : out std_logic;
|
56 |
|
|
full_in : in std_logic;
|
57 |
|
|
debug_out: out std_logic_vector(debug_w_g-1 downto 0) );
|
58 |
|
|
|
59 |
|
|
end dctqidct_top;
|
60 |
|
|
|
61 |
|
|
architecture structural of dctqidct_top is
|
62 |
|
|
|
63 |
|
|
component dct_to_hibi
|
64 |
|
|
generic (
|
65 |
|
|
data_width_g : integer;
|
66 |
|
|
comm_width_g : integer;
|
67 |
|
|
dct_width_g : integer;
|
68 |
|
|
quant_width_g : integer;
|
69 |
|
|
idct_width_g : integer;
|
70 |
|
|
use_self_rel_g : integer;
|
71 |
|
|
own_address_g : integer;
|
72 |
|
|
rtm_address_g : integer;
|
73 |
|
|
debug_w_g : integer );
|
74 |
|
|
port (
|
75 |
|
|
clk : in std_logic;
|
76 |
|
|
rst_n : in std_logic;
|
77 |
|
|
hibi_av_out : out std_logic;
|
78 |
|
|
hibi_data_out : out std_logic_vector (data_width_g-1 downto 0);
|
79 |
|
|
hibi_comm_out : out std_logic_vector (comm_width_g-1 downto 0);
|
80 |
|
|
hibi_we_out : out std_logic;
|
81 |
|
|
hibi_re_out : out std_logic;
|
82 |
|
|
hibi_av_in : in std_logic;
|
83 |
|
|
hibi_data_in : in std_logic_vector (data_width_g-1 downto 0);
|
84 |
|
|
hibi_comm_in : in std_logic_vector (comm_width_g-1 downto 0);
|
85 |
|
|
hibi_empty_in : in std_logic;
|
86 |
|
|
hibi_full_in : in std_logic;
|
87 |
|
|
wr_dct_out : out std_logic;
|
88 |
|
|
quant_ready4col_out : out std_logic;
|
89 |
|
|
idct_ready4col_out : out std_logic;
|
90 |
|
|
data_dct_out : out std_logic_vector(DCT_inputw_co-1 downto 0);
|
91 |
|
|
intra_out : out std_logic;
|
92 |
|
|
loadQP_out : out std_logic;
|
93 |
|
|
QP_out : out std_logic_vector (4 downto 0);
|
94 |
|
|
chroma_out : out std_logic;
|
95 |
|
|
data_idct_in : in std_logic_vector(IDCT_resultw_co-1 downto 0);
|
96 |
|
|
data_quant_in : in std_logic_vector(QUANT_resultw_co-1 downto 0);
|
97 |
|
|
dct_ready4col_in : in std_logic;
|
98 |
|
|
wr_idct_in : in std_logic;
|
99 |
|
|
wr_quant_in : in std_logic;
|
100 |
|
|
debug_out : out std_logic_vector(debug_w_g-1 downto 0) );
|
101 |
|
|
end component;
|
102 |
|
|
|
103 |
|
|
component dctQidct_core
|
104 |
|
|
port (
|
105 |
|
|
QP_in : in std_logic_vector (4 downto 0);
|
106 |
|
|
chroma_in : in std_logic;
|
107 |
|
|
clk : in std_logic;
|
108 |
|
|
data_dct_in : in std_logic_vector (DCT_inputw_co-1 downto 0);
|
109 |
|
|
idct_ready4column_in : in std_logic;
|
110 |
|
|
intra_in : in std_logic;
|
111 |
|
|
loadQP_in : in std_logic;
|
112 |
|
|
quant_ready4column_in : in std_logic;
|
113 |
|
|
rst_n : in std_logic;
|
114 |
|
|
wr_dct_in : in std_logic;
|
115 |
|
|
data_idct_out : out std_logic_vector (IDCT_resultw_co-1 downto 0);
|
116 |
|
|
data_quant_out : out std_logic_vector (QUANT_resultw_co-1 downto 0);
|
117 |
|
|
dct_ready4column_out : out std_logic;
|
118 |
|
|
wr_idct_out : out std_logic;
|
119 |
|
|
wr_quant_out : out std_logic);
|
120 |
|
|
end component;
|
121 |
|
|
|
122 |
|
|
signal QP : std_logic_vector (4 downto 0);
|
123 |
|
|
signal chroma : std_logic;
|
124 |
|
|
signal data_dct : std_logic_vector (DCT_inputw_co-1 downto 0);
|
125 |
|
|
signal idct_ready4column : std_logic;
|
126 |
|
|
signal intra : std_logic;
|
127 |
|
|
signal loadQP : std_logic;
|
128 |
|
|
signal quant_ready4column : std_logic;
|
129 |
|
|
signal wr_dct : std_logic;
|
130 |
|
|
signal data_idct : std_logic_vector (IDCT_resultw_co-1 downto 0);
|
131 |
|
|
signal data_quant : std_logic_vector (QUANT_resultw_co-1 downto 0);
|
132 |
|
|
signal dct_ready4column : std_logic;
|
133 |
|
|
signal wr_idct : std_logic;
|
134 |
|
|
signal wr_quant : std_logic;
|
135 |
|
|
|
136 |
|
|
|
137 |
|
|
begin -- structural
|
138 |
|
|
|
139 |
|
|
|
140 |
|
|
dct_to_hibi_1_12 : dct_to_hibi
|
141 |
|
|
generic map (
|
142 |
|
|
data_width_g => data_width_g,
|
143 |
|
|
comm_width_g => comm_width_g,
|
144 |
|
|
dct_width_g => DCT_inputw_co,
|
145 |
|
|
quant_width_g => QUANT_resultw_co,
|
146 |
|
|
idct_width_g => IDCT_resultw_co,
|
147 |
|
|
use_self_rel_g => use_self_rel_g,
|
148 |
|
|
own_address_g => own_address_g,
|
149 |
|
|
rtm_address_g => rtm_address_g,
|
150 |
|
|
debug_w_g => debug_w_g )
|
151 |
|
|
port map (
|
152 |
|
|
clk => clk,
|
153 |
|
|
rst_n => rst_n,
|
154 |
|
|
hibi_av_out => av_out,
|
155 |
|
|
hibi_data_out => data_out,
|
156 |
|
|
hibi_comm_out => comm_out,
|
157 |
|
|
hibi_we_out => we_out,
|
158 |
|
|
hibi_re_out => re_out,
|
159 |
|
|
hibi_av_in => av_in,
|
160 |
|
|
hibi_data_in => data_in,
|
161 |
|
|
hibi_comm_in => comm_in,
|
162 |
|
|
hibi_empty_in => empty_in,
|
163 |
|
|
hibi_full_in => full_in,
|
164 |
|
|
|
165 |
|
|
wr_dct_out => wr_dct,
|
166 |
|
|
quant_ready4col_out => quant_ready4column,
|
167 |
|
|
idct_ready4col_out => idct_ready4column,
|
168 |
|
|
data_dct_out => data_dct,
|
169 |
|
|
intra_out => intra,
|
170 |
|
|
loadQP_out => loadQP,
|
171 |
|
|
QP_out => QP,
|
172 |
|
|
chroma_out => chroma,
|
173 |
|
|
data_idct_in => data_idct,
|
174 |
|
|
data_quant_in => data_quant,
|
175 |
|
|
dct_ready4col_in => dct_ready4column,
|
176 |
|
|
wr_idct_in => wr_idct,
|
177 |
|
|
wr_quant_in => wr_quant,
|
178 |
|
|
debug_out => debug_out );
|
179 |
|
|
|
180 |
|
|
dctQidct_core_1 : dctQidct_core
|
181 |
|
|
port map (
|
182 |
|
|
QP_in => QP,
|
183 |
|
|
chroma_in => chroma,
|
184 |
|
|
clk => clk,
|
185 |
|
|
data_dct_in => data_dct,
|
186 |
|
|
idct_ready4column_in => idct_ready4column,
|
187 |
|
|
intra_in => intra,
|
188 |
|
|
loadQP_in => loadQP,
|
189 |
|
|
quant_ready4column_in => quant_ready4column,
|
190 |
|
|
rst_n => rst_n,
|
191 |
|
|
wr_dct_in => wr_dct,
|
192 |
|
|
data_idct_out => data_idct,
|
193 |
|
|
data_quant_out => data_quant,
|
194 |
|
|
dct_ready4column_out => dct_ready4column,
|
195 |
|
|
wr_idct_out => wr_idct,
|
196 |
|
|
wr_quant_out => wr_quant);
|
197 |
|
|
|
198 |
|
|
|
199 |
|
|
end structural;
|