Reading a perf counter above the implemented ones is now returning 0

This commit is contained in:
Germain Haugou 2017-09-11 15:34:44 +02:00
parent 22dd8f3ce0
commit bac9faedf1

View file

@ -365,7 +365,7 @@ module zeroriscy_cs_registers
`ifdef ASIC_SYNTHESIS
perf_rdata = PCCR_q[0];
`else
perf_rdata = PCCR_q[csr_addr_i[4:0]];
perf_rdata = csr_addr_i[4:0] < N_PERF_COUNTERS ? PCCR_q[csr_addr_i[4:0]] : '0;
`endif
end
end