2024-05-09 22:56:32 +08:00
|
|
|
|
`timescale 1ns/1ps
|
|
|
|
|
|
|
|
|
|
module isp #(
|
2024-05-10 20:13:58 +08:00
|
|
|
|
parameter IN_WIDTH = 1936,
|
|
|
|
|
parameter IN_HEIGHT = 1088,
|
2024-05-11 17:43:26 +08:00
|
|
|
|
parameter OUT_WIDTH = 640,
|
|
|
|
|
parameter OUT_HEIGHT = 480,
|
|
|
|
|
parameter COLOR_DEPTH = 8,
|
2024-05-10 20:13:58 +08:00
|
|
|
|
parameter RAW_TYPE = 3 // 0:grbg 1:rggb 2:bggr 3:gbrg
|
2024-05-09 22:56:32 +08:00
|
|
|
|
) (
|
2024-05-10 20:13:58 +08:00
|
|
|
|
// 基本信号
|
|
|
|
|
input clk,
|
|
|
|
|
input reset,
|
2024-05-09 23:23:23 +08:00
|
|
|
|
|
2024-05-10 20:13:58 +08:00
|
|
|
|
// 数据输入信号
|
|
|
|
|
input data_en,
|
|
|
|
|
input [15:0] data_in [2:0], // 数据输入线,0、1、2分别表示第一、二、三行
|
|
|
|
|
output reg data_que, // 数据请求线,高电平:请求三个数据,直到读取完才拉低
|
|
|
|
|
output reg data_line, // 新一行请求数据线,高电平:请求九个数据,直到读取完才拉低
|
|
|
|
|
|
|
|
|
|
// en: 输出数据有效信号,高电平有效
|
|
|
|
|
output reg out_en,
|
|
|
|
|
output reg [15:0] out_r,
|
|
|
|
|
output reg [15:0] out_g,
|
|
|
|
|
output reg [15:0] out_b
|
2024-05-09 22:56:32 +08:00
|
|
|
|
);
|
2024-05-10 20:13:58 +08:00
|
|
|
|
|
|
|
|
|
demosaic2 #(IN_WIDTH, IN_HEIGHT, RAW_TYPE) CFA (
|
|
|
|
|
.clk(clk),
|
|
|
|
|
.reset(reset),
|
|
|
|
|
.data_en(data_en),
|
|
|
|
|
.data_in(data_in),
|
|
|
|
|
.data_que(data_que),
|
|
|
|
|
.data_line(data_line),
|
|
|
|
|
.out_en(out_en),
|
|
|
|
|
.out_r(out_r),
|
|
|
|
|
.out_g(out_g),
|
|
|
|
|
.out_b(out_b)
|
|
|
|
|
);
|
2024-05-09 22:56:32 +08:00
|
|
|
|
|
2024-05-10 21:41:47 +08:00
|
|
|
|
endmodule
|