openpower-cores / a2i

Other
243 stars 40 forks source link

Why choosing ex4 to deal with interrupt and exception #44

Open Grubby-CPU opened 2 years ago

Grubby-CPU commented 2 years ago

As shown in xuq_cpl.vhdl, ex4 is used to deal with the interrupt and exception. Why ex4 instead of ex3 or ex5? Any comments about this?

zhaoxiahust commented 2 years ago

I think there are many reasons related to this. First, you want to move this function as early as possible since it flushes the whole pipeline which degrades the performance. Second, you need to put this function behind some events such as injecting a load miss into the LMQ, getting the right branch prediction result and so on. Yep, you also need to consider the exception happening time of some instructions such as a load instruction which causes a TLB exception.

Let's look forward to the detailed explanation from @openpowerwtf .

openpowerwtf commented 2 years ago

Have you read Appendix D of the spec? There are lots of details about the pipe in general, and arbitration, stalls, and flushes.