always@(posedge clk or negedge rst_n )begin
if(rst_n==1'b0)begin
fifo_wren <= 1'b0;
end
else if(din_vld && fifo_wrcount <= 1024)begin
fifo_wren<=1'b1;
end
else begin
fifo_wren <= 1'b0;
end
end
always@(posedge clk or negedge rst_n )begin
if(rst_n==1'b0)begin
fifo_din <= 32'b0;
end
else if(din_vld)begin
fifo_din <= gateway_out;
end
end
always@(posedge clk or negedge rst_n )begin
if(!rst_n)begin
cnt <= 0;
end
else if(add_cnt)begin
if(end_cnt)
cnt <= 0;
else
cnt = cnt+1;
end
end
always@(posedge clk or negedge rst_n) begin
if (rst_n == 1'b0)begin
dout <= 8'b0;
end
else begin
dout <= fifo_din[31-8*cnt -:8];//fifo_dout 没数据
end
end
always@(posedge clk or negedge rst_n) begin
if (rst_n == 1'b0)begin
dout_vld <= 1'b0;
end
else if(add_cnt) begin
dout_vld <= 1'b1;
end
else begin
dout_vld <= 1'b0;
end
end