diff options
Diffstat (limited to 'debug/risc-v-gsp-rm-vm/greeneye/analyze.py')
| -rw-r--r-- | debug/risc-v-gsp-rm-vm/greeneye/analyze.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/debug/risc-v-gsp-rm-vm/greeneye/analyze.py b/debug/risc-v-gsp-rm-vm/greeneye/analyze.py index 07c24eb..66429e9 100644 --- a/debug/risc-v-gsp-rm-vm/greeneye/analyze.py +++ b/debug/risc-v-gsp-rm-vm/greeneye/analyze.py @@ -110,6 +110,34 @@ def render_summary_from(meta: dict, events: list[dict], symbols=None, max_rows: lines.append("* recorder counts: " + ", ".join(f"{k}={v}" for k, v in sorted(counts_meta.items()))) lines.append("") + # QEMU exception report (probe sessions) + fault_count = meta.get("qemu_fault_count") + first = meta.get("qemu_first_fault") + if fault_count or first: + lines.append("## QEMU exceptions") + lines.append("") + lines.append(f"* total exceptions: {fault_count if fault_count is not None else '?'}") + if meta.get("qemu_log_blob"): + lines.append(f"* qemu log blob: `{meta['qemu_log_blob']}`") + if first: + access = first.get("access") or {} + lines.append("") + lines.append("| field | value |") + lines.append("|---|---|") + lines.append(f"| descriptor | `{first.get('desc', '?')}` |") + lines.append(f"| cause | `{first.get('cause', 0):#x}` ({_RISCV_CAUSES.get(first.get('cause', 0) & 0xFF, '?')}) |") + epc = first.get("epc", 0) + bias = meta.get("bias") or 0 + epc_cell = f"`{epc:#x}`" + (f" (firmware vaddr `{epc - bias:#x}`)" if bias else "") + lines.append(f"| epc | {epc_cell} |") + lines.append(f"| tval | `{first.get('tval', 0):#x}` |") + if access: + lines.append( + f"| first access | `{access.get('rw')}` at `{access.get('access_addr', 0):#x}` " + f"({access.get('size')} bytes, reason `{access.get('reason')}`) |" + ) + lines.append("") + def annotate(addr): if not isinstance(addr, int): return "" |
