finish isp testbench but still have some errors waiting to be deat with

This commit is contained in:
SikongJueluo
2024-05-15 16:35:17 +08:00
parent e29dce1d7e
commit 0f7ba1a48a
5 changed files with 165 additions and 43 deletions

View File

@@ -1,6 +1,4 @@
module crop #(
parameter IN_WIDTH = 1936 - 2,
parameter IN_HEIGHT = 1088 - 2,
parameter OFFSET_X = 8,
parameter OFFSET_Y = 4,
parameter OUT_WIDTH = 640,
@@ -11,10 +9,10 @@ module crop #(
input reset,
input in_en,
output in_que,
output reg in_que,
input [3 * COLOR_DEPTH - 1:0] data_in,
output out_en,
output reg out_en,
output reg [3 * COLOR_DEPTH - 1:0] data_out
);
localparam READ_DATA = 0;
@@ -36,9 +34,9 @@ module crop #(
// 下一状态更新
always @(*) begin
case (state)
READ_DATA: nextState <= (in_que && in_en) ? HANDLE_DATA : READ_DATA;
HANDLE_DATA: nextState <= SEND_DATA;
SEND_DATA: nextState <= READ_DATA;
READ_DATA: nextState = (in_que && in_en) ? HANDLE_DATA : READ_DATA;
HANDLE_DATA: nextState = SEND_DATA;
SEND_DATA: nextState = READ_DATA;
endcase
end