|
楼主 |
发表于 2013-6-2 13:54:21
|
显示全部楼层
回复 3# warmheard
这是综合出来的报告:
这是代码:
always @ ( posedge hclk or negedge hrstn )
if ( !hrstn )
EN_int_req_reg <= 'b0;
else
EN_int_req_reg <= EN_int_req;
// "EN_gen_req"
always @ ( posedge hclk or negedge hrstn )
if ( !hrstn )
EN_gen_req <= 'b0;
else if ( int_req_eva || int_req_xy || int_req_sum )
EN_gen_req <= 1'b1;
else
if ( EN_int_req && !EN_int_req_reg )
EN_gen_req <= 'b0;
else
EN_gen_req <= EN_gen_req;
// "clear" will be active if "1 == row_y_pic" and "count_1023_hclk"
// is active.
always @ ( posedge hclk or negedge hrstn )
if ( !hrstn )
clear <= 'b0;
else if ( int_req_cfg )
clear <= 'b0;
else
if ( 1 == row_y_pic && count_1023_hclk )
clear <= 1'b1;
else
clear <= clear;
/** ^ Generate "refer_ok" which is in-phase with "ad_clk" ^ **/
// "hclk_gt" will be assign to "hclk" while "stall_b" is active.
assign hclk_gt = stall_b && hclk;
// Generate "stall_b"
always @ ( refer_ok_hclk or ref_ok_s2f2 )
if ( ref_ok_s2f2 )
stall_b = 1'b1;
else
if ( refer_ok_hclk )
stall_b = 'b0;
else
stall_b = 1'b1;
// Generate "ref_ok_s2f1"
always @ ( posedge hclk or negedge hrstn )
if ( !hrstn )
ref_ok_s2f1 <= 'b0;
else
if ( refer_ok )
ref_ok_s2f1 <= 1'b1;
else
ref_ok_s2f1 <= 'b0;
// Generate "ref_ok_s2f2"
always @ ( posedge hclk or negedge hrstn )
if ( !hrstn )
ref_ok_s2f2 <= 'b0;
else
ref_ok_s2f2 <= ref_ok_s2f1;
// The "beg_region" will be set to "1" while "row_y_pic"
// reach the first row of the last 3 "1/4 region".
assign beg_region = ( 256 == row_y_pic || 512 == row_y_pic )
? 1'b1
: ( 768 == row_y_pic || 0 == row_y_pic)
? 1'b1
: 'b0;
// "refer_ok_hclk" will be set to "1" if "beg_region" while
// "count_1023_hclk" is active and "break" is inactive.
always @ ( posedge hclk_gt or negedge hrstn ) begin
if ( !hrstn )
refer_ok_hclk <= 'b0;
else begin
if ( !break ) begin
if ( beg_region && count_1023_hclk )
refer_ok_hclk <= 1'b1;
else
refer_ok_hclk <= 'b0;
end
else
refer_ok_hclk <= 'b0;
end
end
// Generate "ref_ok_f2s1"
always @ ( posedge ad_clk or negedge hrstn )
if ( !hrstn )
ref_ok_f2s1 <= 'b0;
else
if ( refer_ok_hclk )
ref_ok_f2s1 <= 1'b1;
else
ref_ok_f2s1 <= 'b0;
// Generate "ref_ok_f2s2" and "ref_ok_f2s3".
always @ ( posedge ad_clk or negedge hrstn )
if ( !hrstn )
{ ref_ok_f2s3, ref_ok_f2s2 } <= 2'b00;
else
{ ref_ok_f2s3, ref_ok_f2s2 } <= { ref_ok_f2s2, ref_ok_f2s1 };
// Generate "refer_ok"
always @ ( ref_ok_f2s3 or ref_ok_f2s2 )
case ( { ref_ok_f2s3, ref_ok_f2s2 } )
2'b01 : refer_ok = 1'b1;
default : refer_ok = 'b0;
endcase
/** v Generate "refer_ok" which is in-phase with "ad_clk" v **/
//---------------------------------------------------------------------
/********** ^ Generate "int_req" ^ **********/
// Generate "count_1023_hclk".
assign count_1023_hclk = ( count_1023_pic && !count_1023_pic_reg )
? 1'b1
: 'b0;
// "count_1023_pic_reg" is a circle later than "count_1023_pic"
always @ ( posedge hclk or negedge hrstn )
if( !hrstn )
count_1023_pic_reg <= 'b0;
else
count_1023_pic_reg <= count_1023_pic;
// "beg_region_reg"
always @ ( posedge hclk or negedge hrstn )
if ( !hrstn )
beg_region_reg <= 'b0;
else
beg_region_reg <= beg_region;
// Indicate the generation of "int_req" to CPU to read the row
// of "0", "256", "512" and "768".
always @ ( posedge hclk or negedge hrstn )
if ( !hrstn )
beg_region_index <= 'b0;
else if ( int_req_ref_ok )
beg_region_index <= 'b0;
else
if ( beg_region && !beg_region_reg )
beg_region_index <= 1'b1;
else
beg_region_index <= beg_region_index; |
|