riscv-non-isa/riscv-trace-spec

Question on recover_status_fields

cetola opened this issue · 3 comments

Had a question come up regarding the decoder model:

(te_inst.format == format_t.BRANCH) and te_inst.branches == 31

Specifically for branch with address packet, why must te_inst.branches == 31?

It's a long time since I looked at this ;-)
I believe that check is trying to differentiate between the two types of format 1 packet (format_t.BRANCH), described in Table 7.6 and Table 7.7. As suggested, it looks like this check is incorrect because branches == 0 means "no address is present".
The suggested fix of changing this to:
(te_inst.format == format_t.BRANCH) and te_inst.branches != 0
would seem to be correct.

Apologies that this wasn't picked up in my testing.

Thanks @andyduller, that was my guess, that te_inst.branches != 0 would make more sense.

Would you like me to have a PR sent in or will you handle this?

I have made the change so that we are now using te_inst.branches != 0. So closing this issue