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

@@ -13,20 +13,23 @@ module chanels_to_RGB #(
// 输出相关
input data_que, // 数据请求
output reg out_en,
output reg [3 * OUT_DEPTH - 1:0] data_out
output out_en,
output [3 * OUT_DEPTH - 1:0] data_out
);
reg [31:0] data_cal [2:0]; // 用于保存运算结果防止溢出
reg fifo_en;
wire [3 * OUT_DEPTH - 1:0] fifo_in; // 输入fifo中缓存
reg [3 * OUT_DEPTH - 1:0] fifo_in; // 输入fifo中缓存
wire fifo_empty;
// wire fifo_alempty;
always @(posedge clk or posedge reset) begin
if (reset) begin
// 初始化
out_en <= 0;
data_out <= 0;
data_cal[0] <= 0;
data_cal[1] <= 0;
data_cal[2] <= 0;
fifo_en <= 0;
fifo_in <= 0;
end
else begin
if (in_en) begin
@@ -55,10 +58,10 @@ module chanels_to_RGB #(
.winc(fifo_en),
.wdata(fifo_in),
// .wfull(),
// .awfull(),
.wfull(),
.awfull(),
// .arempty(fifo_alempty)
.arempty(),
.rempty(fifo_empty),
.rdata(data_out),
.rinc(out_en)