You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB
Coq

// fifo, ,
module fifo_rd(
input rd_clk,
input rst,
input [7:0] fifo_rd_data, // fifo
input is_full, // ,
input is_almost_empty, //
input is_rd_rst_busy, //
output reg fifo_rd_en //
);
reg is_full_0;
reg is_full_1;
always @(posedge rd_clk or negedge rst) begin
if (!rst) begin
is_full_0 <= 1'b0;
is_full_1 <= 1'b0;
end
else begin
is_full_0 <= is_full;
is_full_1 <= is_full_0;
end
end
//
always @(posedge rd_clk or negedge rst) begin
if (!rst) begin
fifo_rd_en <= 1'b0;
end
else if (!is_rd_rst_busy) begin //
if (is_full_1) begin // ,
fifo_rd_en <= 1'b1;
end
else if(is_almost_empty) begin // ,
fifo_rd_en <= 1'b0;
end
else begin
end
end
else begin
end
end
endmodule