Skip to content

Commit

Permalink
Fixed enabling of TransmitFIFOReadIncrement and ReceiveFIFOWriteIncre…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
JacobPease committed Oct 30, 2024
1 parent ca1c090 commit 4f0723f
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/uncore/spi_apb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,22 @@ module spi_apb import cvw::*; #(parameter cvw_t P) (
always_ff @(posedge PCLK)
if (~PRESETn) begin
TransmitFIFOWriteIncrement <= 1'b0;
TransmitFIFOReadIncrement <= 1'b0;
end else begin
TransmitFIFOWriteIncrement <= (Memwrite & (Entry == SPI_TXDATA) & ~TransmitFIFOWriteFull);
TransmitFIFOReadIncrement <= TransmitLoad;
end

always_ff @(posedge PCLK)
if (~PRESETn) begin
TransmitFIFOReadIncrement <= 1'b0;
end else if (SCLKenable) begin
TransmitFIFOReadIncrement <= TransmitLoad;
end

// Setup TransmitStart state machine
always_ff @(posedge PCLK) begin
if (~PRESETn) begin
CurrState <= READY;
end else if (SCLKenable) begin
end else begin
CurrState <= NextState;
end
end
Expand Down Expand Up @@ -273,9 +278,14 @@ module spi_apb import cvw::*; #(parameter cvw_t P) (
always_ff @(posedge PCLK)
if (~PRESETn) begin
ReceiveFIFOReadIncrement <= 1'b0;
ReceiveFIFOWriteInc <= 1'b0;
end else begin
ReceiveFIFOReadIncrement <= ((Entry == SPI_RXDATA) & ~ReceiveFIFOReadEmpty & PSEL & ~ReceiveFIFOReadIncrement);
end

always_ff @(posedge PCLK)
if (~PRESETn) begin
ReceiveFIFOWriteInc <= 1'b0;
end else if (SCLKenable) begin
ReceiveFIFOWriteInc <= EndOfFrameDelay;
end

Expand Down

0 comments on commit 4f0723f

Please sign in to comment.