修正写入长度的代码,aqspi\bqspi的实际长度比写入/读取长度多1个字节

This commit is contained in:
2026-02-09 16:20:08 +08:00
parent d3e2f2969c
commit eabaa215bf

View File

@@ -701,10 +701,14 @@ task spi_trans( input [15:0] saddress, input [7:0] scmd, input [12:0] slength, i
`else
txBuf[2] <= (scmd | slength[12:8]);
txBuf[3] <= slength[7:0];
if (sidx >=(`ALL_DEV_NUM * 3)) begin
length <= slength + 4 + 1;
end else begin
if (sidx < (`ALL_DEV_NUM * 3)) begin
length <= slength + 4;
end else if (sidx < (`ALL_DEV_NUM * 4)) begin
length <= slength + 4 + 1;
end else if (sidx < (`ALL_DEV_NUM * 5)) begin
length <= slength + 4;
end else begin
length <= slength + 4 + 1;
end
`endif