DPC writes treated differently based on PULP_SECURE parameter
Created by: Silabs-ArjanB
The code for DPC writes are slightly different based on the PULP_SECURE parameter. This type of typo's likely derive from the high amount of code duplication in riscv_cs_registers.sv.
PULP_SECURE==1 section:
CSR_DPC:
if (csr_we_int)
begin
depc_n = csr_wdata_int & ~32'b1; // force 16-bit alignment
end
PULP_SECURE == 0 section:
CSR_DPC:
if (csr_we_int)
begin
depc_n = csr_wdata_int;
end
Is it maybe an idea to restructure riscv_cs_registers.sv such that the duplicate code is avoided (and parameters are used inside the expressions in the read/write logic case statements to achieve the same effect as is now achieved with generate statements)?