1 |
10 |
eexuke |
//--------------------------------------------------------------------------------------------------
|
2 |
|
|
// Design : nova
|
3 |
|
|
// Author(s) : Ke Xu
|
4 |
|
|
// Email : eexuke@yahoo.com
|
5 |
|
|
// File : DF_top.v
|
6 |
|
|
// Generated : Dec 30, 2005
|
7 |
|
|
// Copyright (C) 2008 Ke Xu
|
8 |
|
|
//-------------------------------------------------------------------------------------------------
|
9 |
|
|
// Description
|
10 |
|
|
// Top module of deblocking filter
|
11 |
|
|
//-------------------------------------------------------------------------------------------------
|
12 |
|
|
|
13 |
|
|
// synopsys translate_off
|
14 |
|
|
`include "timescale.v"
|
15 |
|
|
// synopsys translate_on
|
16 |
|
|
`include "nova_defines.v"
|
17 |
|
|
|
18 |
|
|
module DF_top (clk,reset_n,gclk_DF,gclk_end_of_MB_DEC,gclk_DF_mbAddrA_RF,gclk_DF_mbAddrB_RAM,
|
19 |
|
|
end_of_BS_DEC,disable_DF,mb_num_h,mb_num_v,
|
20 |
|
|
bs_V0,bs_V1,bs_V2,bs_V3,bs_H0,bs_H1,bs_H2,bs_H3,
|
21 |
|
|
QPy,QPc,slice_alpha_c0_offset_div2,slice_beta_offset_div2,
|
22 |
|
|
blk4x4_sum_counter,blk4x4_rec_counter_2_raster_order,rec_DF_RAM_dout,
|
23 |
|
|
blk4x4_sum_PE0_out,blk4x4_sum_PE1_out,blk4x4_sum_PE2_out,blk4x4_sum_PE3_out,
|
24 |
|
|
|
25 |
|
|
DF_duration,end_of_MB_DF,DF_edge_counter_MR,one_edge_counter_MR,
|
26 |
|
|
DF_mbAddrA_RF_rd,DF_mbAddrA_RF_wr,DF_mbAddrB_RAM_rd,DF_mbAddrB_RAM_wr,
|
27 |
|
|
dis_frame_RAM_wr,dis_frame_RAM_wr_addr,dis_frame_RAM_din);
|
28 |
|
|
input clk;
|
29 |
|
|
input gclk_DF;
|
30 |
|
|
input gclk_end_of_MB_DEC;
|
31 |
|
|
input gclk_DF_mbAddrA_RF;
|
32 |
|
|
input gclk_DF_mbAddrB_RAM;
|
33 |
|
|
input reset_n;
|
34 |
|
|
input end_of_BS_DEC;
|
35 |
|
|
input disable_DF;
|
36 |
|
|
input [3:0] mb_num_h;
|
37 |
|
|
input [3:0] mb_num_v;
|
38 |
|
|
input [11:0] bs_V0,bs_V1,bs_V2,bs_V3;
|
39 |
|
|
input [11:0] bs_H0,bs_H1,bs_H2,bs_H3;
|
40 |
|
|
input [5:0] QPy,QPc;
|
41 |
|
|
input [3:0] slice_alpha_c0_offset_div2;
|
42 |
|
|
input [3:0] slice_beta_offset_div2;
|
43 |
|
|
input [31:0] rec_DF_RAM_dout;
|
44 |
|
|
input [2:0] blk4x4_sum_counter;
|
45 |
|
|
input [4:0] blk4x4_rec_counter_2_raster_order;
|
46 |
|
|
input [7:0] blk4x4_sum_PE0_out,blk4x4_sum_PE1_out,blk4x4_sum_PE2_out,blk4x4_sum_PE3_out;
|
47 |
|
|
|
48 |
|
|
output DF_duration;
|
49 |
|
|
output end_of_MB_DF;
|
50 |
|
|
output [5:0] DF_edge_counter_MR;
|
51 |
|
|
output [1:0] one_edge_counter_MR;
|
52 |
|
|
output DF_mbAddrA_RF_rd,DF_mbAddrA_RF_wr;
|
53 |
|
|
output DF_mbAddrB_RAM_rd,DF_mbAddrB_RAM_wr;
|
54 |
|
|
output dis_frame_RAM_wr;
|
55 |
|
|
output [13:0] dis_frame_RAM_wr_addr;
|
56 |
|
|
output [31:0] dis_frame_RAM_din;
|
57 |
|
|
|
58 |
|
|
wire end_of_MB_DF;
|
59 |
|
|
wire end_of_lastMB_DF;
|
60 |
|
|
wire [3:0] mb_num_h_DF;
|
61 |
|
|
wire [3:0] mb_num_v_DF;
|
62 |
|
|
wire [5:0] DF_edge_counter_MR,DF_edge_counter_MW;
|
63 |
|
|
wire [1:0] one_edge_counter_MR,one_edge_counter_MW;
|
64 |
|
|
wire [2:0] bs_curr_MR,bs_curr_MW;
|
65 |
|
|
wire [7:0] q0_MW,q1_MW,q2_MW,q3_MW;
|
66 |
|
|
wire [7:0] p0_MW,p1_MW,p2_MW,p3_MW;
|
67 |
|
|
wire [31:0] buf0_0,buf0_1,buf0_2,buf0_3;
|
68 |
|
|
wire [31:0] buf1_0,buf1_1,buf1_2,buf1_3;
|
69 |
|
|
wire [31:0] buf2_0,buf2_1,buf2_2,buf2_3;
|
70 |
|
|
wire [31:0] buf3_0,buf3_1,buf3_2,buf3_3;
|
71 |
|
|
wire [31:0] t0_0,t0_1,t0_2,t0_3;
|
72 |
|
|
wire [31:0] t1_0,t1_1,t1_2,t1_3;
|
73 |
|
|
wire [31:0] t2_0,t2_1,t2_2,t2_3;
|
74 |
|
|
wire DF_mbAddrA_RF_rd;
|
75 |
|
|
wire DF_mbAddrA_RF_wr;
|
76 |
|
|
wire [4:0] DF_mbAddrA_RF_rd_addr;
|
77 |
|
|
wire [4:0] DF_mbAddrA_RF_wr_addr;
|
78 |
|
|
wire [31:0] DF_mbAddrA_RF_din;
|
79 |
|
|
wire [31:0] DF_mbAddrA_RF_dout;
|
80 |
|
|
wire DF_mbAddrB_RAM_rd;
|
81 |
|
|
wire DF_mbAddrB_RAM_wr;
|
82 |
|
|
wire [8:0] DF_mbAddrB_RAM_addr;
|
83 |
|
|
wire [31:0] DF_mbAddrB_RAM_din;
|
84 |
|
|
wire [31:0] DF_mbAddrB_RAM_dout;
|
85 |
|
|
|
86 |
|
|
DF_pipeline DF_pipeline (
|
87 |
|
|
.clk(clk),
|
88 |
|
|
.gclk_DF(gclk_DF),
|
89 |
|
|
.gclk_end_of_MB_DEC(gclk_end_of_MB_DEC),
|
90 |
|
|
.reset_n(reset_n),
|
91 |
|
|
.disable_DF(disable_DF),
|
92 |
|
|
.end_of_BS_DEC(end_of_BS_DEC),
|
93 |
|
|
.end_of_MB_DF(end_of_MB_DF),
|
94 |
|
|
.end_of_lastMB_DF(end_of_lastMB_DF),
|
95 |
|
|
.bs_V0(bs_V0),.bs_V1(bs_V1),.bs_V2(bs_V2),.bs_V3(bs_V3),
|
96 |
|
|
.bs_H0(bs_H0),.bs_H1(bs_H1),.bs_H2(bs_H2),.bs_H3(bs_H3),
|
97 |
|
|
.QPy(QPy),
|
98 |
|
|
.QPc(QPc),
|
99 |
|
|
.slice_alpha_c0_offset_div2(slice_alpha_c0_offset_div2),
|
100 |
|
|
.slice_beta_offset_div2(slice_beta_offset_div2),
|
101 |
|
|
.DF_mbAddrA_RF_dout(DF_mbAddrA_RF_dout),
|
102 |
|
|
.DF_mbAddrB_RAM_dout(DF_mbAddrB_RAM_dout),
|
103 |
|
|
.rec_DF_RAM_dout(rec_DF_RAM_dout),
|
104 |
|
|
.buf0_0(buf0_0),.buf0_1(buf0_1),.buf0_2(buf0_2),.buf0_3(buf0_3),
|
105 |
|
|
.buf1_0(buf1_0),.buf1_1(buf1_1),.buf1_2(buf1_2),.buf1_3(buf1_3),
|
106 |
|
|
.buf2_0(buf2_0),.buf2_1(buf2_1),.buf2_2(buf2_2),.buf2_3(buf2_3),
|
107 |
|
|
.buf3_0(buf3_0),.buf3_1(buf3_1),.buf3_2(buf3_2),.buf3_3(buf3_3),
|
108 |
|
|
|
109 |
|
|
.DF_duration(DF_duration),
|
110 |
|
|
.DF_edge_counter_MR(DF_edge_counter_MR),
|
111 |
|
|
.DF_edge_counter_MW(DF_edge_counter_MW),
|
112 |
|
|
.one_edge_counter_MR(one_edge_counter_MR),
|
113 |
|
|
.one_edge_counter_MW(one_edge_counter_MW),
|
114 |
|
|
.bs_curr_MR(bs_curr_MR),
|
115 |
|
|
.bs_curr_MW(bs_curr_MW),
|
116 |
|
|
.q0_MW(q0_MW),.q1_MW(q1_MW),.q2_MW(q2_MW),.q3_MW(q3_MW),
|
117 |
|
|
.p0_MW(p0_MW),.p1_MW(p1_MW),.p2_MW(p2_MW),.p3_MW(p3_MW)
|
118 |
|
|
);
|
119 |
|
|
DF_reg_ctrl DF_reg_ctrl (
|
120 |
|
|
.gclk_DF(gclk_DF),
|
121 |
|
|
.reset_n(reset_n),
|
122 |
|
|
.DF_edge_counter_MW(DF_edge_counter_MW),
|
123 |
|
|
.one_edge_counter_MW(one_edge_counter_MW),
|
124 |
|
|
.mb_num_h_DF(mb_num_h_DF),
|
125 |
|
|
.mb_num_v_DF(mb_num_v_DF),
|
126 |
|
|
|
127 |
|
|
.q0_MW(q0_MW),.q1_MW(q1_MW),.q2_MW(q2_MW),.q3_MW(q3_MW),
|
128 |
|
|
.p0_MW(p0_MW),.p1_MW(p1_MW),.p2_MW(p2_MW),.p3_MW(p3_MW),
|
129 |
|
|
.buf0_0(buf0_0),.buf0_1(buf0_1),.buf0_2(buf0_2),.buf0_3(buf0_3),
|
130 |
|
|
.buf1_0(buf1_0),.buf1_1(buf1_1),.buf1_2(buf1_2),.buf1_3(buf1_3),
|
131 |
|
|
.buf2_0(buf2_0),.buf2_1(buf2_1),.buf2_2(buf2_2),.buf2_3(buf2_3),
|
132 |
|
|
.buf3_0(buf3_0),.buf3_1(buf3_1),.buf3_2(buf3_2),.buf3_3(buf3_3),
|
133 |
|
|
.t0_0(t0_0),.t0_1(t0_1),.t0_2(t0_2),.t0_3(t0_3),
|
134 |
|
|
.t1_0(t1_0),.t1_1(t1_1),.t1_2(t1_2),.t1_3(t1_3),
|
135 |
|
|
.t2_0(t2_0),.t2_1(t2_1),.t2_2(t2_2),.t2_3(t2_3)
|
136 |
|
|
);
|
137 |
|
|
|
138 |
|
|
DF_mem_ctrl DF_mem_ctrl (
|
139 |
|
|
.clk(clk),
|
140 |
|
|
.reset_n(reset_n),
|
141 |
|
|
.gclk_end_of_MB_DEC(gclk_end_of_MB_DEC),
|
142 |
|
|
.disable_DF(disable_DF),
|
143 |
|
|
.mb_num_h(mb_num_h),
|
144 |
|
|
.mb_num_v(mb_num_v),
|
145 |
|
|
.bs_curr_MR(bs_curr_MR),
|
146 |
|
|
.bs_curr_MW(bs_curr_MW),
|
147 |
|
|
.blk4x4_sum_counter(blk4x4_sum_counter),
|
148 |
|
|
.blk4x4_rec_counter_2_raster_order(blk4x4_rec_counter_2_raster_order),
|
149 |
|
|
.DF_edge_counter_MR(DF_edge_counter_MR),
|
150 |
|
|
.DF_edge_counter_MW(DF_edge_counter_MW),
|
151 |
|
|
.one_edge_counter_MR(one_edge_counter_MR),
|
152 |
|
|
.one_edge_counter_MW(one_edge_counter_MW),
|
153 |
|
|
.blk4x4_sum_PE0_out(blk4x4_sum_PE0_out),
|
154 |
|
|
.blk4x4_sum_PE1_out(blk4x4_sum_PE1_out),
|
155 |
|
|
.blk4x4_sum_PE2_out(blk4x4_sum_PE2_out),
|
156 |
|
|
.blk4x4_sum_PE3_out(blk4x4_sum_PE3_out),
|
157 |
|
|
.q0_MW(q0_MW),.q1_MW(q1_MW),.q2_MW(q2_MW),.q3_MW(q3_MW),
|
158 |
|
|
.p0_MW(p0_MW),.p1_MW(p1_MW),.p2_MW(p2_MW),.p3_MW(p3_MW),
|
159 |
|
|
.buf0_0(buf0_0),.buf0_1(buf0_1),.buf0_2(buf0_2),.buf0_3(buf0_3),
|
160 |
|
|
.buf2_0(buf2_0),.buf2_1(buf2_1),.buf2_2(buf2_2),.buf2_3(buf2_3),
|
161 |
|
|
.buf3_0(buf3_0),.buf3_1(buf3_1),.buf3_2(buf3_2),.buf3_3(buf3_3),
|
162 |
|
|
.t0_0(t0_0),.t0_1(t0_1),.t0_2(t0_2),.t0_3(t0_3),
|
163 |
|
|
.t1_0(t1_0),.t1_1(t1_1),.t1_2(t1_2),.t1_3(t1_3),
|
164 |
|
|
.t2_0(t2_0),.t2_1(t2_1),.t2_2(t2_2),.t2_3(t2_3),
|
165 |
|
|
|
166 |
|
|
.mb_num_h_DF(mb_num_h_DF),
|
167 |
|
|
.mb_num_v_DF(mb_num_v_DF),
|
168 |
|
|
.end_of_MB_DF(end_of_MB_DF),
|
169 |
|
|
.end_of_lastMB_DF(end_of_lastMB_DF),
|
170 |
|
|
.DF_mbAddrA_RF_rd(DF_mbAddrA_RF_rd),
|
171 |
|
|
.DF_mbAddrA_RF_wr(DF_mbAddrA_RF_wr),
|
172 |
|
|
.DF_mbAddrA_RF_rd_addr(DF_mbAddrA_RF_rd_addr),
|
173 |
|
|
.DF_mbAddrA_RF_wr_addr(DF_mbAddrA_RF_wr_addr),
|
174 |
|
|
.DF_mbAddrA_RF_din(DF_mbAddrA_RF_din),
|
175 |
|
|
.DF_mbAddrB_RAM_rd(DF_mbAddrB_RAM_rd),
|
176 |
|
|
.DF_mbAddrB_RAM_wr(DF_mbAddrB_RAM_wr),
|
177 |
|
|
.DF_mbAddrB_RAM_addr(DF_mbAddrB_RAM_addr),
|
178 |
|
|
.DF_mbAddrB_RAM_din(DF_mbAddrB_RAM_din),
|
179 |
|
|
.dis_frame_RAM_wr(dis_frame_RAM_wr),
|
180 |
|
|
.dis_frame_RAM_wr_addr(dis_frame_RAM_wr_addr),
|
181 |
|
|
.dis_frame_RAM_din(dis_frame_RAM_din)
|
182 |
|
|
);
|
183 |
|
|
ram_sync_1r_sync_1w # (`DF_mbAddrA_RAM_data_width,`DF_mbAddrA_RAM_data_depth)
|
184 |
|
|
DF_mbAddrA_RAM (
|
185 |
|
|
.clk(gclk_DF_mbAddrA_RF),
|
186 |
|
|
.rst_n(reset_n),
|
187 |
|
|
.wr_n(~DF_mbAddrA_RF_wr),
|
188 |
|
|
.rd_n(~DF_mbAddrA_RF_rd),
|
189 |
|
|
.wr_addr(DF_mbAddrA_RF_wr_addr),
|
190 |
|
|
.rd_addr(DF_mbAddrA_RF_rd_addr),
|
191 |
|
|
.data_in(DF_mbAddrA_RF_din),
|
192 |
|
|
.data_out(DF_mbAddrA_RF_dout)
|
193 |
|
|
);
|
194 |
|
|
ram_sync_1r_sync_1w # (`DF_mbAddrB_RAM_data_width,`DF_mbAddrB_RAM_data_depth)
|
195 |
|
|
DF_mbAddrB_RAM (
|
196 |
|
|
.clk(gclk_DF_mbAddrB_RAM),
|
197 |
|
|
.rst_n(reset_n),
|
198 |
|
|
.wr_n(~DF_mbAddrB_RAM_wr),
|
199 |
|
|
.rd_n(~DF_mbAddrB_RAM_rd),
|
200 |
|
|
.wr_addr(DF_mbAddrB_RAM_addr),
|
201 |
|
|
.rd_addr(DF_mbAddrB_RAM_addr),
|
202 |
|
|
.data_in(DF_mbAddrB_RAM_din),
|
203 |
|
|
.data_out(DF_mbAddrB_RAM_dout)
|
204 |
|
|
);
|
205 |
|
|
endmodule
|