finish crop ip and update isp
This commit is contained in:
		
							
								
								
									
										12
									
								
								Crop/crop.v
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Crop/crop.v
									
									
									
									
									
								
							@@ -56,6 +56,18 @@ module crop #(
 | 
			
		||||
        else begin
 | 
			
		||||
            if (in_en) begin
 | 
			
		||||
 | 
			
		||||
                if (OFFSET_Y <= cnt_y && cnt_y < (OFFSET_Y + OUT_HEIGHT)) begin
 | 
			
		||||
                    if (OFFSET_X <= cnt_x && cnt_x < (OFFSET_X + OUT_WIDTH)) begin
 | 
			
		||||
                        fifo_en <= 1;
 | 
			
		||||
                    end 
 | 
			
		||||
                    else begin
 | 
			
		||||
                        fifo_en <= 0;
 | 
			
		||||
                    end
 | 
			
		||||
                end
 | 
			
		||||
                else begin
 | 
			
		||||
                    fifo_en <= 0;
 | 
			
		||||
                end
 | 
			
		||||
 | 
			
		||||
                cnt_x <= cnt_x + 1;
 | 
			
		||||
                if (cnt_x >= (OFFSET_X + OUT_WIDTH)) begin
 | 
			
		||||
                    cnt_x <= 0;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										30
									
								
								isp.v
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								isp.v
									
									
									
									
									
								
							@@ -18,6 +18,9 @@ module isp #(
 | 
			
		||||
    output reg data_que,            // 数据请求线,高电平:请求三个数据,直到读取完才拉低
 | 
			
		||||
    output reg data_line,           // 新一行请求数据线,高电平:请求九个数据,直到读取完才拉低
 | 
			
		||||
 | 
			
		||||
    input out_que,
 | 
			
		||||
    output out_en,
 | 
			
		||||
    output [15:0] data_out
 | 
			
		||||
);
 | 
			
		||||
    // 三通道合成RGB图像
 | 
			
		||||
    wire rgb_en;
 | 
			
		||||
@@ -28,6 +31,11 @@ module isp #(
 | 
			
		||||
    wire scale_in_que;        // scaler 请求数据
 | 
			
		||||
    wire [3 * COLOR_DEPTH - 1:0] scale_in_data;
 | 
			
		||||
 | 
			
		||||
    // 写入RAM
 | 
			
		||||
    wire RAM_in_en;
 | 
			
		||||
    wire RAM_in_que;        // RAM 请求数据
 | 
			
		||||
    wire [3 * COLOR_DEPTH - 1:0] RAM_in_data;
 | 
			
		||||
 | 
			
		||||
    demosaic2 #(
 | 
			
		||||
        .IM_WIDTH(1936),
 | 
			
		||||
        .IM_HEIGHT(1088),
 | 
			
		||||
@@ -57,8 +65,30 @@ module isp #(
 | 
			
		||||
        .data_out(scale_in_data)
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    crop crop_process (
 | 
			
		||||
        .clk(clk),
 | 
			
		||||
        .reset(reset),
 | 
			
		||||
 | 
			
		||||
        .in_en(scale_en),
 | 
			
		||||
        .in_que(scale_que),
 | 
			
		||||
        .data_in(scale_in_data),
 | 
			
		||||
 | 
			
		||||
        .out_en(RAM_in_en),
 | 
			
		||||
        .out_que(RAM_in_que),
 | 
			
		||||
        .data_out(RAM_in_data)
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    RGB_to_RAM write_to_RAM (
 | 
			
		||||
        .clk(clk),
 | 
			
		||||
        .reset(reset),
 | 
			
		||||
 | 
			
		||||
        .in_en(scale_en),
 | 
			
		||||
        .in_que(scale_que),
 | 
			
		||||
        .data_in(scale_in_data),
 | 
			
		||||
 | 
			
		||||
        .write_que(out_que),
 | 
			
		||||
        .write_en(out_en),
 | 
			
		||||
        .data_write(data_out)
 | 
			
		||||
    );
 | 
			
		||||
    
 | 
			
		||||
endmodule
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user