shioyadan / Konata

Konata is an instruction pipeline visualizer for Onikiri2-Kanata/Gem5-O3PipeView formats. You can download the pre-built binaries from https://github.com/shioyadan/Konata/releases
BSD 3-Clause "New" or "Revised" License
390 stars 36 forks source link

Introduce opportunistic automatic horizontal scroll #18

Open akihikodaki opened 6 months ago

akihikodaki commented 6 months ago
tl; dr: The old algorithm made a large amount of automatic horizontal
scroll in some scenarios and hurt usability. Introduce a new
"opportunistic" algorithm that horizontally scrolls to the extent that
will show more of pipeline stages.

Konata automatically scrolls horizontally when the user inputs a
vertical scroll. Previously, the amount of automatic horizontal scroll
was determined by the difference between the fetch timing of the op at
the top before the vertical scroll and one of the op at the top after
the vertical scroll.

The old algorithm resulted in an excessive scroll when the fetch
timing difference is large. For example, think of a scenario that
an op immediately after a branch misprediction is at the top. You
naturally scroll upward to see what happened just before the op, but
since the mispredicted branch was fetched much earlier, the old
algorithm decides to travel to the past too distant, and you miss the
pipeline stages you intended to observe. There will be completely
unobservable regions in the worst scenario where branch mispredictions
frequently happen.

By contrast, the new algorithm behaves opportunistically; it
horizontally scrolls only if there is some margin and scrolling will
show more of pipeline stages, hence immune to excessive scroll in the
scenario described earlier.

The new algorithm also preserves a margin present before the vertical
scroll because a user may want to display somewhere away from the
currently active pipeline because the user is interested in another
pipeline shown in the transparent mode.