Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hw,dma,rtl] Only set error code when entering the error state #23687

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions hw/ip/dma/rtl/dma.sv
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module dma

logic dma_state_error;
dma_ctrl_state_e ctrl_state_q, ctrl_state_d;
logic clear_go, clear_status, clear_sha_status;
logic set_error_code, clear_go, clear_status, clear_sha_status;

logic [INTR_CLEAR_SOURCES_WIDTH-1:0] clear_index_d, clear_index_q;
logic clear_index_en, intr_clear_tlul_rsp_valid;
Expand Down Expand Up @@ -1297,15 +1297,18 @@ module dma
end
end

// Set the error code only when entering the error state
set_error_code = (ctrl_state_q != DmaError) && (ctrl_state_d == DmaError);

// Fiddle out error signals
hw2reg.error_code.src_addr_error.de = (ctrl_state_d == DmaError) | clear_status;
hw2reg.error_code.dst_addr_error.de = (ctrl_state_d == DmaError) | clear_status;
hw2reg.error_code.opcode_error.de = (ctrl_state_d == DmaError) | clear_status;
hw2reg.error_code.size_error.de = (ctrl_state_d == DmaError) | clear_status;
hw2reg.error_code.bus_error.de = (ctrl_state_d == DmaError) | clear_status;
hw2reg.error_code.base_limit_error.de = (ctrl_state_d == DmaError) | clear_status;
hw2reg.error_code.range_valid_error.de = (ctrl_state_d == DmaError) | clear_status;
hw2reg.error_code.asid_error.de = (ctrl_state_d == DmaError) | clear_status;
hw2reg.error_code.src_addr_error.de = set_error_code | clear_status;
hw2reg.error_code.dst_addr_error.de = set_error_code | clear_status;
hw2reg.error_code.opcode_error.de = set_error_code | clear_status;
hw2reg.error_code.size_error.de = set_error_code | clear_status;
hw2reg.error_code.bus_error.de = set_error_code | clear_status;
hw2reg.error_code.base_limit_error.de = set_error_code | clear_status;
hw2reg.error_code.range_valid_error.de = set_error_code | clear_status;
hw2reg.error_code.asid_error.de = set_error_code | clear_status;

hw2reg.error_code.src_addr_error.d = clear_status? '0 : next_error[DmaSrcAddrErr];
hw2reg.error_code.dst_addr_error.d = clear_status? '0 : next_error[DmaDstAddrErr];
Expand Down
Loading