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

Subversion Repositories cavlc

[/] [cavlc/] [trunk/] [rtl/] [cavlc_top.v] - Blame information for rev 6

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

Line No. Rev Author Line
1 6 qiubin
//2011-8-7 initial version
2
 
3
`include "defines.v"
4
 
5
module cavlc_top(
6
        clk,
7
        rst_n,
8
        ena,
9
        start,
10
        rbsp,
11
        nC,
12
        max_coeff_num,
13
 
14
        coeff_0,
15
        coeff_1,
16
        coeff_2,
17
        coeff_3,
18
        coeff_4,
19
        coeff_5,
20
        coeff_6,
21
        coeff_7,
22
        coeff_8,
23
        coeff_9,
24
        coeff_10,
25
        coeff_11,
26
        coeff_12,
27
        coeff_13,
28
        coeff_14,
29
        coeff_15,
30
        TotalCoeff,
31
        len_comb,
32
        idle,
33
        valid
34
);
35
//------------------------
36
// ports
37
//------------------------
38
input   clk, rst_n;
39
input   ena;
40
input   start;
41
input   [0:15]   rbsp;
42
input   [4:0]    nC;
43
input   [4:0]    max_coeff_num;
44
 
45
output  [8:0]    coeff_0;
46
output  [8:0]    coeff_1;
47
output  [8:0]    coeff_2;
48
output  [8:0]    coeff_3;
49
output  [8:0]    coeff_4;
50
output  [8:0]    coeff_5;
51
output  [8:0]    coeff_6;
52
output  [8:0]    coeff_7;
53
output  [8:0]    coeff_8;
54
output  [8:0]    coeff_9;
55
output  [8:0]    coeff_10;
56
output  [8:0]    coeff_11;
57
output  [8:0]    coeff_12;
58
output  [8:0]    coeff_13;
59
output  [8:0]    coeff_14;
60
output  [8:0]    coeff_15;
61
output  [4:0]    TotalCoeff;
62
output  [4:0]    len_comb;
63
output  idle;
64
output  valid;
65
 
66
//------------------------
67
// cavlc_read_total_coeffs
68
//------------------------
69
wire [1:0] TrailingOnes;
70
wire [4:0] TotalCoeff;
71
wire [1:0] TrailingOnes_comb;
72
wire [4:0] TotalCoeff_comb;
73
wire [4:0] len_read_total_coeffs_comb;
74
wire [7:0] cavlc_state;
75
 
76
cavlc_read_total_coeffs cavlc_read_total_coeffs(
77
        .clk(clk),
78
        .rst_n(rst_n),
79
        .ena(ena),
80
        .start(start),
81
        .sel(cavlc_state[`cavlc_read_total_coeffs_bit]),
82
 
83
        .rbsp(rbsp),
84
        .nC(nC),
85
 
86
        .TrailingOnes(TrailingOnes),
87
        .TotalCoeff(TotalCoeff),
88
 
89
        .TrailingOnes_comb(TrailingOnes_comb),
90
        .TotalCoeff_comb(TotalCoeff_comb),
91
 
92
        .len_comb(len_read_total_coeffs_comb)
93
);
94
 
95
//------------------------
96
// cavlc_read_levels
97
//------------------------
98
wire    [4:0]    len_read_levels_comb;
99
wire    [3:0]    i;
100
 
101
wire    [8:0]    level_0;
102
wire    [8:0]    level_1;
103
wire    [8:0]    level_2;
104
wire    [8:0]    level_3;
105
wire    [8:0]    level_4;
106
wire    [8:0]    level_5;
107
wire    [8:0]    level_6;
108
wire    [8:0]    level_7;
109
wire    [8:0]    level_8;
110
wire    [8:0]    level_9;
111
wire    [8:0]    level_10;
112
wire    [8:0]    level_11;
113
wire    [8:0]    level_12;
114
wire    [8:0]    level_13;
115
wire    [8:0]    level_14;
116
wire    [8:0]    level_15;
117
 
118
cavlc_read_levels cavlc_read_levels(
119
        .clk(clk),
120
        .rst_n(rst_n),
121
        .ena(ena),
122
        .t1s_sel(cavlc_state[`cavlc_read_t1s_flags_bit]),
123
        .prefix_sel(cavlc_state[`cavlc_read_level_prefix_bit]),
124
        .suffix_sel(cavlc_state[`cavlc_read_level_suffix_bit]),
125
        .calc_sel(cavlc_state[`cavlc_calc_level_bit]),
126
        .TrailingOnes(TrailingOnes),
127
        .TotalCoeff(TotalCoeff),
128
        .i(i),
129
        .rbsp(rbsp),
130
 
131
        .level_0(level_0),
132
        .level_1(level_1),
133
        .level_2(level_2),
134
        .level_3(level_3),
135
        .level_4(level_4),
136
        .level_5(level_5),
137
        .level_6(level_6),
138
        .level_7(level_7),
139
        .level_8(level_8),
140
        .level_9(level_9),
141
        .level_10(level_10),
142
        .level_11(level_11),
143
        .level_12(level_12),
144
        .level_13(level_13),
145
        .level_14(level_14),
146
        .level_15(level_15),
147
        .len_comb(len_read_levels_comb)
148
);
149
 
150
//------------------------
151
// cavlc_read_total_zeros
152
//------------------------
153
wire    [3:0]    TotalZeros_comb;
154
wire    [3:0]    len_read_total_zeros_comb;
155
 
156
cavlc_read_total_zeros cavlc_read_total_zeros(
157
        .ena(ena),
158
        .sel(cavlc_state[`cavlc_read_total_zeros_bit]),
159
        .chroma_DC_sel(nC[4]),
160
        .rbsp(rbsp[0:8]),
161
        .TotalCoeff(TotalCoeff[3:0]),
162
        .TotalZeros_comb(TotalZeros_comb),
163
        .len_comb(len_read_total_zeros_comb)
164
);
165
 
166
//------------------------
167
// read_run_before
168
//------------------------
169
wire    [3:0]    ZeroLeft;
170
wire    [3:0]    len_read_run_befores_comb;
171
 
172
cavlc_read_run_befores cavlc_read_run_befores(
173
        .clk(clk),
174
        .rst_n(rst_n),
175
        .ena(ena),
176
        .clr(cavlc_state[`cavlc_read_total_coeffs_bit]),
177
        .sel(cavlc_state[`cavlc_read_run_befores_bit]),
178
        .ZeroLeft_init(cavlc_state[`cavlc_read_total_zeros_bit]),
179
 
180
        .rbsp(rbsp[0:10]),
181
        .i(i),
182
        .TotalZeros_comb(TotalZeros_comb),
183
 
184
        .level_0(level_0),
185
        .level_1(level_1),
186
        .level_2(level_2),
187
        .level_3(level_3),
188
        .level_4(level_4),
189
        .level_5(level_5),
190
        .level_6(level_6),
191
        .level_7(level_7),
192
        .level_8(level_8),
193
        .level_9(level_9),
194
        .level_10(level_10),
195
        .level_11(level_11),
196
        .level_12(level_12),
197
        .level_13(level_13),
198
        .level_14(level_14),
199
        .level_15(level_15),
200
 
201
        .coeff_0(coeff_0),
202
        .coeff_1(coeff_1),
203
        .coeff_2(coeff_2),
204
        .coeff_3(coeff_3),
205
        .coeff_4(coeff_4),
206
        .coeff_5(coeff_5),
207
        .coeff_6(coeff_6),
208
        .coeff_7(coeff_7),
209
        .coeff_8(coeff_8),
210
        .coeff_9(coeff_9),
211
        .coeff_10(coeff_10),
212
        .coeff_11(coeff_11),
213
        .coeff_12(coeff_12),
214
        .coeff_13(coeff_13),
215
        .coeff_14(coeff_14),
216
        .coeff_15(coeff_15),
217
        .ZeroLeft(ZeroLeft),
218
        .len_comb(len_read_run_befores_comb)
219
);
220
 
221
//------------------------
222
// cavlc_len_gen
223
//------------------------
224
wire [4:0] len_comb;
225
 
226
cavlc_len_gen cavlc_len_gen(
227
        .cavlc_state(cavlc_state),
228
        .len_read_total_coeffs_comb(len_read_total_coeffs_comb),
229
        .len_read_levels_comb(len_read_levels_comb),
230
        .len_read_total_zeros_comb(len_read_total_zeros_comb),
231
        .len_read_run_befores_comb(len_read_run_befores_comb),
232
        .len_comb(len_comb)
233
);
234
 
235
//------------------------
236
// fsm
237
//------------------------
238
cavlc_fsm cavlc_fsm(
239
        .clk(clk),
240
        .rst_n(rst_n),
241
        .ena(ena),
242
        .start(start),
243
 
244
        .max_coeff_num(max_coeff_num),
245
        .TotalCoeff(TotalCoeff),
246
        .TotalCoeff_comb(TotalCoeff_comb),
247
        .TrailingOnes(TrailingOnes),
248
        .TrailingOnes_comb(TrailingOnes_comb),
249
        .ZeroLeft(ZeroLeft),
250
        .state(cavlc_state),
251
        .i(i),
252
        .idle(idle),
253
        .valid(valid)
254
);
255
 
256
endmodule

powered by: WebSVN 2.1.0

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