Skip to content

Commit

Permalink
Buffer delayed CSR result data when XIF result is not ready
Browse files Browse the repository at this point in the history
If a CSR result with delayed result data cannot be transmitted to the
main core in the cycle after the result was received, then the result
data needs to be buffered as well.
  • Loading branch information
michael-platzer committed Jun 15, 2022
1 parent 917ee69 commit ce769e6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rtl/vproc_result.sv
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ module vproc_result #(
result_csr_delayed_d = result_csr_delayed_q;
result_csr_data_d = result_csr_data_q;

// for a delayed result the data is always available in the cycle after the result was
// received, but if the interface is not ready to return that result yet, the data has to
// be buffered as well
if (result_csr_delayed_q) begin
result_csr_delayed_d = 1'b0;
result_csr_data_d = result_csr_data_i;
end

if (result_source == RESULT_SOURCE_EMPTY_BUF) begin
// clear the lowest index ID if the XIF interface is ready
for (int i = 0; i < XIF_ID_CNT; i++) begin
Expand Down

0 comments on commit ce769e6

Please sign in to comment.