fix some bugs

This commit is contained in:
2024-05-13 16:52:13 +08:00
parent 6111180f7a
commit 509b86c168
5 changed files with 30 additions and 28 deletions

View File

@@ -11,16 +11,16 @@ module crop #(
input reset,
input in_en,
output reg in_que,
output in_que,
input [3 * COLOR_DEPTH - 1:0] data_in,
output reg out_en,
output out_en,
input out_que,
output reg [3 * COLOR_DEPTH - 1:0] data_out
);
wire fifo_en;
wire fifo_full, fifo_empty;
reg [11:0] cnt_x, cnt_y;
reg fifo_en;
async_fifo #(
.DSIZE(3 * COLOR_DEPTH),
@@ -34,10 +34,12 @@ module crop #(
.winc(fifo_en),
.wdata(data_in),
.wfull(fifo_full),
.awfull(),
.rinc(out_en),
.rdata(data_out),
.rempty(fifo_empty)
.rempty(fifo_empty),
.arempty()
);
assign in_que = !fifo_full;
@@ -45,10 +47,7 @@ module crop #(
always @(posedge clk or posedge reset) begin
if (reset) begin
in_que <= 0;
out_en <= 0;
data_out <= 0;
fifo_en <= 0;
cnt_x <= 0;
cnt_y <= 0;