riscv-perf-model
riscv-perf-model copied to clipboard
Fix flushing to rewind Fetch back to flush point
For STF reading (and possibly JSON), when the core is flushed, Fetch needs to refetch instructions from the flushed point. Currently it just flushes and keeps going.
After attending the perf-model meeting, I got the point that the difficulties are the iterator always goes forward and the STF cannot be read using the index.
So I think we can store the iterator for every branch instruction ( maybe store it in Inst class ), assign it to next_it_
when flushing to rewind Fetch back to the flush point
So I think we can store the iterator for every branch instruction ( maybe store it in Inst class ), assign it to
next_it_
when flushing to rewind Fetch back to the flush point
Yep, you can definitely do that. Or, since it's copyable, store the STF iterator to the instruction itself. Then we can support the two types of flushes:
- Inclusive: The instruction should be included in the flush (think about loads/stores that miss in the TLB)
- Redirecting: The instruction should not be included in the flush, but fetching starts at the next instruction (think mispredicted branches, RFIs, etc)
If the instruction had the iterator to itself, this can be used to start fetching from either the flushing instruction OR the next instruction. Remember, you can ++
the iterator to get to the next instruction.
Hey! I am participating in LFX with this project. Can I work on this issue?
Absolutely! Feel free to assign to yourself and let us know (either in this issue or in a discussion post) how you'll be tackling it. Thanks!