1 |
2 |
eexuke |
//--------------------------------------------------------------------------------------------------
|
2 |
|
|
// Design : nova
|
3 |
|
|
// Author(s) : Ke Xu
|
4 |
|
|
// Email : eexuke@yahoo.com
|
5 |
|
|
// File : nova.v
|
6 |
|
|
// Generated : Feb 25,2006
|
7 |
|
|
// Copyright (C) 2008 Ke Xu
|
8 |
|
|
//-------------------------------------------------------------------------------------------------
|
9 |
|
|
// Description
|
10 |
|
|
// Top module of nova design, including two main blocks: BitStream controller and reconstruction datapath
|
11 |
|
|
//-------------------------------------------------------------------------------------------------
|
12 |
|
|
|
13 |
|
|
// synopsys translate_off
|
14 |
|
|
`include "timescale.v"
|
15 |
|
|
// synopsys translate_on
|
16 |
|
|
`include "nova_defines.v"
|
17 |
|
|
|
18 |
|
|
module nova (clk,reset_n,BitStream_buffer_input,BitStream_ram_ren,BitStream_ram_addr,
|
19 |
|
|
pic_num,pin_disable_DF,freq_ctrl0,freq_ctrl1,
|
20 |
|
|
ext_frame_RAM0_cs_n,ext_frame_RAM0_wr,ext_frame_RAM0_addr,ext_frame_RAM0_data,
|
21 |
|
|
ext_frame_RAM1_cs_n,ext_frame_RAM1_wr,ext_frame_RAM1_addr,ext_frame_RAM1_data,
|
22 |
|
|
dis_frame_RAM_din,
|
23 |
|
|
|
24 |
|
|
slice_header_s6
|
25 |
|
|
);
|
26 |
|
|
input clk,reset_n;
|
27 |
|
|
input [15:0] BitStream_buffer_input;
|
28 |
|
|
input pin_disable_DF;
|
29 |
|
|
input freq_ctrl0;
|
30 |
|
|
input freq_ctrl1;
|
31 |
|
|
|
32 |
|
|
output BitStream_ram_ren;
|
33 |
|
|
output [16:0] BitStream_ram_addr;
|
34 |
|
|
output [5:0] pic_num;
|
35 |
|
|
//---ext_frame_RAM0---
|
36 |
|
|
output ext_frame_RAM0_cs_n;
|
37 |
|
|
output ext_frame_RAM0_wr;
|
38 |
|
|
output [13:0] ext_frame_RAM0_addr;
|
39 |
|
|
//inout [31:0] ext_frame_RAM0_data;
|
40 |
|
|
input [31:0] ext_frame_RAM0_data;
|
41 |
|
|
|
42 |
|
|
//---ext_frame_RAM1---
|
43 |
|
|
output ext_frame_RAM1_cs_n;
|
44 |
|
|
output ext_frame_RAM1_wr;
|
45 |
|
|
output [13:0] ext_frame_RAM1_addr;
|
46 |
|
|
//inout [31:0] ext_frame_RAM1_data;
|
47 |
|
|
input [31:0] ext_frame_RAM1_data;
|
48 |
|
|
|
49 |
|
|
output [31:0] dis_frame_RAM_din;
|
50 |
|
|
output slice_header_s6;
|
51 |
|
|
|
52 |
|
|
wire trigger_CAVLC;
|
53 |
|
|
wire end_of_NonZeroCoeff_CAVLC;
|
54 |
|
|
wire end_of_DCBlk_IQIT;
|
55 |
|
|
wire end_of_one_blk4x4_sum;
|
56 |
|
|
wire end_of_MB_DEC;
|
57 |
|
|
wire gclk_end_of_MB_DEC;
|
58 |
|
|
wire end_of_one_residual_block;
|
59 |
|
|
wire end_of_one_frame;
|
60 |
|
|
wire Is_skip_run_entry;
|
61 |
|
|
wire Is_skip_run_end;
|
62 |
|
|
wire skip_mv_calc;
|
63 |
|
|
wire [3:0] mb_type_general;
|
64 |
|
|
wire [3:0] mb_num_h;
|
65 |
|
|
wire [3:0] mb_num_v;
|
66 |
|
|
wire NextMB_IsSkip;
|
67 |
|
|
wire LowerMB_IsSkip;
|
68 |
|
|
wire [4:0] blk4x4_rec_counter;
|
69 |
|
|
wire [3:0] slice_data_state;
|
70 |
|
|
wire [3:0] residual_state;
|
71 |
|
|
wire [3:0] cavlc_decoder_state;
|
72 |
|
|
wire [1:0] Intra16x16_predmode;
|
73 |
|
|
wire [63:0] Intra4x4_predmode_CurrMb;
|
74 |
|
|
wire [1:0] Intra_chroma_predmode;
|
75 |
|
|
wire [5:0] QPy;
|
76 |
|
|
wire [5:0] QPc;
|
77 |
|
|
wire [1:0] i4x4_CbCr;
|
78 |
|
|
wire [3:0] slice_alpha_c0_offset_div2;
|
79 |
|
|
wire [3:0] slice_beta_offset_div2;
|
80 |
|
|
wire [3:0] CodedBlockPatternLuma;
|
81 |
|
|
wire [1:0] CodedBlockPatternChroma;
|
82 |
|
|
wire [4:0] TotalCoeff;
|
83 |
|
|
wire disable_DF;
|
84 |
|
|
wire [8:0] coeffLevel_0, coeffLevel_1, coeffLevel_2,coeffLevel_3, coeffLevel_4, coeffLevel_5;
|
85 |
|
|
wire [8:0] coeffLevel_6, coeffLevel_7, coeffLevel_8, coeffLevel_9,coeffLevel_10,coeffLevel_11;
|
86 |
|
|
wire [8:0] coeffLevel_12,coeffLevel_13,coeffLevel_14,coeffLevel_15;
|
87 |
|
|
wire mv_is16x16;
|
88 |
|
|
wire [3:0] mv_below8x8;
|
89 |
|
|
wire [31:0] mvx_CurrMb0,mvx_CurrMb1,mvx_CurrMb2,mvx_CurrMb3;
|
90 |
|
|
wire [31:0] mvy_CurrMb0,mvy_CurrMb1,mvy_CurrMb2,mvy_CurrMb3;
|
91 |
|
|
wire [11:0] bs_V0,bs_V1,bs_V2,bs_V3;
|
92 |
|
|
wire [11:0] bs_H0,bs_H1,bs_H2,bs_H3;
|
93 |
|
|
wire curr_DC_IsZero;
|
94 |
|
|
wire end_of_BS_DEC;
|
95 |
|
|
|
96 |
|
|
BitStream_controller BitStream_controller (
|
97 |
|
|
.clk(clk),
|
98 |
|
|
.reset_n(reset_n),
|
99 |
|
|
.freq_ctrl0(freq_ctrl0),
|
100 |
|
|
.freq_ctrl1(freq_ctrl1),
|
101 |
|
|
.BitStream_buffer_input(BitStream_buffer_input),
|
102 |
|
|
.pin_disable_DF(pin_disable_DF),
|
103 |
|
|
.trigger_CAVLC(trigger_CAVLC),
|
104 |
|
|
.blk4x4_rec_counter(blk4x4_rec_counter),
|
105 |
|
|
.end_of_DCBlk_IQIT(end_of_DCBlk_IQIT),
|
106 |
|
|
.end_of_one_blk4x4_sum(end_of_one_blk4x4_sum),
|
107 |
|
|
.end_of_MB_DEC(end_of_MB_DEC),
|
108 |
|
|
.gclk_end_of_MB_DEC(gclk_end_of_MB_DEC),
|
109 |
|
|
.curr_DC_IsZero(curr_DC_IsZero),
|
110 |
|
|
|
111 |
|
|
.BitStream_ram_ren(BitStream_ram_ren),
|
112 |
|
|
.BitStream_ram_addr(BitStream_ram_addr),
|
113 |
|
|
.pic_num(pic_num),
|
114 |
|
|
.mb_type_general(mb_type_general),
|
115 |
|
|
.mb_num_h(mb_num_h),
|
116 |
|
|
.mb_num_v(mb_num_v),
|
117 |
|
|
.NextMB_IsSkip(NextMB_IsSkip),
|
118 |
|
|
.LowerMB_IsSkip(LowerMB_IsSkip),
|
119 |
|
|
.slice_data_state(slice_data_state),
|
120 |
|
|
.residual_state(residual_state),
|
121 |
|
|
.cavlc_decoder_state(cavlc_decoder_state),
|
122 |
|
|
.end_of_one_residual_block(end_of_one_residual_block),
|
123 |
|
|
.end_of_NonZeroCoeff_CAVLC(end_of_NonZeroCoeff_CAVLC),
|
124 |
|
|
.end_of_one_frame(end_of_one_frame),
|
125 |
|
|
.Intra16x16_predmode(Intra16x16_predmode),
|
126 |
|
|
.Intra4x4_predmode_CurrMb(Intra4x4_predmode_CurrMb),
|
127 |
|
|
.Intra_chroma_predmode(Intra_chroma_predmode),
|
128 |
|
|
.QPy(QPy),
|
129 |
|
|
.QPc(QPc),
|
130 |
|
|
.i4x4_CbCr(i4x4_CbCr),
|
131 |
|
|
.slice_alpha_c0_offset_div2(slice_alpha_c0_offset_div2),
|
132 |
|
|
.slice_beta_offset_div2(slice_beta_offset_div2),
|
133 |
|
|
.CodedBlockPatternLuma(CodedBlockPatternLuma),
|
134 |
|
|
.CodedBlockPatternChroma(CodedBlockPatternChroma),
|
135 |
|
|
.TotalCoeff(TotalCoeff),
|
136 |
|
|
.Is_skip_run_entry(Is_skip_run_entry),
|
137 |
|
|
.skip_mv_calc(skip_mv_calc),
|
138 |
|
|
.disable_DF(disable_DF),
|
139 |
|
|
.coeffLevel_0(coeffLevel_0),
|
140 |
|
|
.coeffLevel_1(coeffLevel_1),
|
141 |
|
|
.coeffLevel_2(coeffLevel_2),
|
142 |
|
|
.coeffLevel_3(coeffLevel_3),
|
143 |
|
|
.coeffLevel_4(coeffLevel_4),
|
144 |
|
|
.coeffLevel_5(coeffLevel_5),
|
145 |
|
|
.coeffLevel_6(coeffLevel_6),
|
146 |
|
|
.coeffLevel_7(coeffLevel_7),
|
147 |
|
|
.coeffLevel_8(coeffLevel_8),
|
148 |
|
|
.coeffLevel_9(coeffLevel_9),
|
149 |
|
|
.coeffLevel_10(coeffLevel_10),
|
150 |
|
|
.coeffLevel_11(coeffLevel_11),
|
151 |
|
|
.coeffLevel_12(coeffLevel_12),
|
152 |
|
|
.coeffLevel_13(coeffLevel_13),
|
153 |
|
|
.coeffLevel_14(coeffLevel_14),
|
154 |
|
|
.coeffLevel_15(coeffLevel_15),
|
155 |
|
|
.mv_is16x16(mv_is16x16),
|
156 |
|
|
.mv_below8x8(mv_below8x8),
|
157 |
|
|
.mvx_CurrMb0(mvx_CurrMb0),
|
158 |
|
|
.mvx_CurrMb1(mvx_CurrMb1),
|
159 |
|
|
.mvx_CurrMb2(mvx_CurrMb2),
|
160 |
|
|
.mvx_CurrMb3(mvx_CurrMb3),
|
161 |
|
|
.mvy_CurrMb0(mvy_CurrMb0),
|
162 |
|
|
.mvy_CurrMb1(mvy_CurrMb1),
|
163 |
|
|
.mvy_CurrMb2(mvy_CurrMb2),
|
164 |
|
|
.mvy_CurrMb3(mvy_CurrMb3),
|
165 |
|
|
.end_of_BS_DEC(end_of_BS_DEC),
|
166 |
|
|
.bs_V0(bs_V0),
|
167 |
|
|
.bs_V1(bs_V1),
|
168 |
|
|
.bs_V2(bs_V2),
|
169 |
|
|
.bs_V3(bs_V3),
|
170 |
|
|
.bs_H0(bs_H0),
|
171 |
|
|
.bs_H1(bs_H1),
|
172 |
|
|
.bs_H2(bs_H2),
|
173 |
|
|
.bs_H3(bs_H3),
|
174 |
|
|
|
175 |
|
|
.slice_header_s6(slice_header_s6)
|
176 |
|
|
);
|
177 |
|
|
reconstruction reconstruction (
|
178 |
|
|
.clk(clk),
|
179 |
|
|
.reset_n(reset_n),
|
180 |
|
|
.mb_type_general(mb_type_general),
|
181 |
|
|
.mb_num_h(mb_num_h),
|
182 |
|
|
.mb_num_v(mb_num_v),
|
183 |
|
|
.NextMB_IsSkip(NextMB_IsSkip),
|
184 |
|
|
.LowerMB_IsSkip(LowerMB_IsSkip),
|
185 |
|
|
.slice_data_state(slice_data_state),
|
186 |
|
|
.residual_state(residual_state),
|
187 |
|
|
.cavlc_decoder_state(cavlc_decoder_state),
|
188 |
|
|
.end_of_one_residual_block(end_of_one_residual_block),
|
189 |
|
|
.end_of_NonZeroCoeff_CAVLC(end_of_NonZeroCoeff_CAVLC),
|
190 |
|
|
.end_of_one_frame(end_of_one_frame),
|
191 |
|
|
.Intra16x16_predmode(Intra16x16_predmode),
|
192 |
|
|
.Intra4x4_predmode_CurrMb(Intra4x4_predmode_CurrMb),
|
193 |
|
|
.Intra_chroma_predmode(Intra_chroma_predmode),
|
194 |
|
|
.QPy(QPy),
|
195 |
|
|
.QPc(QPc),
|
196 |
|
|
.i4x4_CbCr(i4x4_CbCr),
|
197 |
|
|
.slice_alpha_c0_offset_div2(slice_alpha_c0_offset_div2),
|
198 |
|
|
.slice_beta_offset_div2(slice_beta_offset_div2),
|
199 |
|
|
.CodedBlockPatternLuma(CodedBlockPatternLuma),
|
200 |
|
|
.CodedBlockPatternChroma(CodedBlockPatternChroma),
|
201 |
|
|
.TotalCoeff(TotalCoeff),
|
202 |
|
|
.Is_skip_run_entry(Is_skip_run_entry),
|
203 |
|
|
.skip_mv_calc(skip_mv_calc),
|
204 |
|
|
.disable_DF(disable_DF),
|
205 |
|
|
.coeffLevel_0(coeffLevel_0),
|
206 |
|
|
.coeffLevel_1(coeffLevel_1),
|
207 |
|
|
.coeffLevel_2(coeffLevel_2),
|
208 |
|
|
.coeffLevel_3(coeffLevel_3),
|
209 |
|
|
.coeffLevel_4(coeffLevel_4),
|
210 |
|
|
.coeffLevel_5(coeffLevel_5),
|
211 |
|
|
.coeffLevel_6(coeffLevel_6),
|
212 |
|
|
.coeffLevel_7(coeffLevel_7),
|
213 |
|
|
.coeffLevel_8(coeffLevel_8),
|
214 |
|
|
.coeffLevel_9(coeffLevel_9),
|
215 |
|
|
.coeffLevel_10(coeffLevel_10),
|
216 |
|
|
.coeffLevel_11(coeffLevel_11),
|
217 |
|
|
.coeffLevel_12(coeffLevel_12),
|
218 |
|
|
.coeffLevel_13(coeffLevel_13),
|
219 |
|
|
.coeffLevel_14(coeffLevel_14),
|
220 |
|
|
.coeffLevel_15(coeffLevel_15),
|
221 |
|
|
.mv_is16x16(mv_is16x16),
|
222 |
|
|
.mv_below8x8(mv_below8x8),
|
223 |
|
|
.mvx_CurrMb0(mvx_CurrMb0),
|
224 |
|
|
.mvx_CurrMb1(mvx_CurrMb1),
|
225 |
|
|
.mvx_CurrMb2(mvx_CurrMb2),
|
226 |
|
|
.mvx_CurrMb3(mvx_CurrMb3),
|
227 |
|
|
.mvy_CurrMb0(mvy_CurrMb0),
|
228 |
|
|
.mvy_CurrMb1(mvy_CurrMb1),
|
229 |
|
|
.mvy_CurrMb2(mvy_CurrMb2),
|
230 |
|
|
.mvy_CurrMb3(mvy_CurrMb3),
|
231 |
|
|
.end_of_BS_DEC(end_of_BS_DEC),
|
232 |
|
|
.bs_V0(bs_V0),
|
233 |
|
|
.bs_V1(bs_V1),
|
234 |
|
|
.bs_V2(bs_V2),
|
235 |
|
|
.bs_V3(bs_V3),
|
236 |
|
|
.bs_H0(bs_H0),
|
237 |
|
|
.bs_H1(bs_H1),
|
238 |
|
|
.bs_H2(bs_H2),
|
239 |
|
|
.bs_H3(bs_H3),
|
240 |
|
|
|
241 |
|
|
.trigger_CAVLC(trigger_CAVLC),
|
242 |
|
|
.blk4x4_rec_counter(blk4x4_rec_counter),
|
243 |
|
|
.end_of_DCBlk_IQIT(end_of_DCBlk_IQIT),
|
244 |
|
|
.end_of_one_blk4x4_sum(end_of_one_blk4x4_sum),
|
245 |
|
|
.end_of_MB_DEC(end_of_MB_DEC),
|
246 |
|
|
.gclk_end_of_MB_DEC(gclk_end_of_MB_DEC),
|
247 |
|
|
.curr_DC_IsZero(curr_DC_IsZero),
|
248 |
|
|
.ext_frame_RAM0_cs_n(ext_frame_RAM0_cs_n),
|
249 |
|
|
.ext_frame_RAM0_wr(ext_frame_RAM0_wr),
|
250 |
|
|
.ext_frame_RAM0_addr(ext_frame_RAM0_addr),
|
251 |
|
|
.ext_frame_RAM0_data(ext_frame_RAM0_data),
|
252 |
|
|
.ext_frame_RAM1_cs_n(ext_frame_RAM1_cs_n),
|
253 |
|
|
.ext_frame_RAM1_wr(ext_frame_RAM1_wr),
|
254 |
|
|
.ext_frame_RAM1_addr(ext_frame_RAM1_addr),
|
255 |
|
|
.ext_frame_RAM1_data(ext_frame_RAM1_data),
|
256 |
|
|
.dis_frame_RAM_din(dis_frame_RAM_din)
|
257 |
|
|
);
|
258 |
|
|
|
259 |
|
|
endmodule
|