Skip to content

Commit

Permalink
[hw,dma,rtl] Set interrupt only when transition to done / error
Browse files Browse the repository at this point in the history
Previously, clearing the DONE or ERROR interrupt before clearing STATUS.done
would lead to raise the same interrupt a second time, which could bring FW
out of sync.

With this change, the DONE and ERROR interrupt are only sent once, when
transitioning into the DONE or ERROR state.

Signed-off-by: Robert Schilling <[email protected]>
  • Loading branch information
Razer6 committed Jun 30, 2024
1 parent 628dfc9 commit 2e2f972
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hw/ip/dma/rtl/dma.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1320,11 +1320,11 @@ module dma
hw2reg.control.abort.de = hw2reg.status.aborted.de;
hw2reg.control.abort.d = 1'b0;

// interrupt management
hw2reg.intr_state.dma_done.de = reg2hw.status.done.q | test_done_interrupt;
// Interrupt management - Set interrupts only in the transition to done / error
hw2reg.intr_state.dma_done.de = hw2reg.status.done.de | test_done_interrupt;
hw2reg.intr_state.dma_done.d = 1'b1;

hw2reg.intr_state.dma_error.de = reg2hw.status.error.q | test_error_interrupt;
hw2reg.intr_state.dma_error.de = hw2reg.status.error.de | test_error_interrupt;
hw2reg.intr_state.dma_error.d = 1'b1;

hw2reg.intr_state.dma_memory_buffer_limit.de = send_memory_buffer_limit_interrupt |
Expand Down

0 comments on commit 2e2f972

Please sign in to comment.