|
写计数器只能增长为1,不知道为什么第二个数据写不进去,代码如下:
case(wr_cnt)
5'd0: begin
wr_cnt <= wr_cnt + 5'd1;
c3_p0_wr_en <= 1'b0;
c3_p0_wr_data <= 32'd0;
c3_p0_rd_en <= 1'b0;
c3_p0_cmd_en <= 1'b0;
c3_p0_cmd_instr <= 3'd2;
c3_p0_cmd_bl <=6'b000011;
c3_p0_cmd_byte_addr <= 30'd5952500;
end
5'd1: begin
c3_p0_cmd_en <= 1'b1;
wr_cnt <= wr_cnt + 5'd1;
end
5'd2: begin
c3_p0_cmd_en <= 1'b0;
wr_cnt <= wr_cnt + 5'd1;
end
5'd3: begin
if(~c3_p0_cmd_empty)
begin
wr_cnt <= wr_cnt + 5'd1;
end
end
5'd4: begin
c3_p0_wr_en <= 1'b1;
c3_p0_wr_data<= {data1,data1};
wr_cnt <= wr_cnt + 5'd1;
end
5'd5: begin
c3_p0_wr_data<={data1,data1};
wr_cnt <= wr_cnt + 5'd1;
end
5'd6: begin
if(c3_p0_wr_count == 7'd2)begin //写入1个数据成功
led2 <= 1'b0;
c3_p0_wr_en <=1'b1;
c3_p0_wr_data<={data1,data1};
wr_cnt <= wr_cnt + 5'd1;
|
|