riscv-non-isa/riscv-trace-spec

After mret/sret retires, the privilege mode is switched at the same time, but pc missing situation occurs in a scene (details are described below).

ZeyueShen opened this issue · 4 comments

clipbord_1704162679288
figure 1
clipbord_1704163006373
figure 2
The pc flow shown in the figure 1, according to E-Trace Spec, address 8000101c will generate formart1\2 pkt. When mret is executed and the privilege mode changes, the priority of the algorithm will generate formart3 sub0 pkt(shown in figure 2), But the packet address is 80001020. The same address also exists in the pc flow before mret, which will cause the pc to be lost when decoder decoding(shown in figure 3)
clipbord_1704163452822
figure 3

Thanks for your answer, I understand what you mean, but in this scenario, address 80001020 appears before mret, and there are no other branches in between, so according to the code in Chapter 11 (as shown in Figure 1), it will end at 80001020 before mret.
clipbord_1704245174829
Figure 1

Well, thank you very much for your answer

Zeyue Shen