Change data count to have proper width (9)

This was probably an off-by-one mistage, with the width set to 10
instead of 9. The width should be 9 since the buffer is 512 bytes.
This commit is contained in:
Byron Lathi
2022-04-14 11:19:08 -05:00
parent c9269b2fb8
commit 3a59de2947

View File

@@ -24,7 +24,7 @@ logic [47:0] rxcmd_buf;
logic [31:0] rx_val;
logic [7:0] rxdata_buf [512];
logic [9:0] data_count;
logic [8:0] data_count;
logic [15:0] data_crc;
@@ -89,7 +89,7 @@ always_ff @(posedge clk) begin
end
if (cs & addr == 4'h5 && sd_clk) begin
data_count <= data_count + 9'b1;
data_count <= data_count + 8'b1;
end
if (state.macro == RXCMD) begin
@@ -102,6 +102,7 @@ always_ff @(posedge clk) begin
if (state.macro == RXDCRC && ~sd_clk) begin
data_crc[4'd15-state.count] <= i_sd_data;
data_count <= '0;
end
end