Re: Preferred manner of supporting bus errors in RISC-V
Greg Chadwick
Hello, Thanks for raising this Arjan, it's been a low-priority item on my TODO list to open a discussion on bus errors for a while now (I work on Ibex amongst other things at lowRISC). I think RISC-V should allow implementation to choose whether not they want precise or imprecise bus errors, which I think is the case now. However as you point out the specification is pretty silent on the matter. Some wording around what the possibilities might be and ensuring the specification doesn't prevent certain options from working without good reason seems prudent. In particular we have the issue of the mcause exception code for bus errors that you raise. I believe codes 1,5 and 7 are meant to be PMP faults only. Ibex is non-confirming at the moment due to its use of the same code for both PMP and bus errors. I think SweRV may do the same (look at the EH1 source here: https://github.com/chipsalliance/Cores-SweRV/blob/7332edc0adaa7e9a0c842d169154429e8d987786/design/lsu/lsu_lsc_ctl.sv#L211 when generating its exception packet it combines access and bus errors together and only alters type for misaligned or not). The Andes/Gowin N25 also looks to use the PMP mcause codes for precise bus errors (see page 87 of https://www.gowinsemi.com/upload/database_doc/586/document_ja/5de4c10ca33c9.pdf) I don't really mind if we introduce a new code here or broaden the definition of 'access fault' to include non PMP errors like bus errors. It could even be left implementation defined though I'd prefer a specification defined bus error mcause. I did also have some concerns around how precise bus errors interact with interrupts. In particular if you have an outstanding memory access (that may or may not see a bus error) and receive an interrupt is it permissible to effectively ignore the interrupt until the potential bus error is resolved? Again I think the specification gives implementations room to do different things here as it's up to the implementation how an interrupt becomes pending (see some extensive discussion here: https://github.com/riscv/riscv-isa-manual/issues/544) some extra wording somewhere to make it clear this is a possibility could be useful. Cheers, Greg Chadwick On Wed, Feb 3, 2021 at 11:35 AM Arjan Bink <Arjan.Bink@...> wrote:
|
|