hackt
hackt copied to clipboard
hacprsim: replay/rewind using trace files (time machine)
Scratchpad - 1:
WISHLIST: time-travel/time-warp debugging in hacprsim
Considering extending an interactive mode that allows one to jump to any point in time, in the history of a prsim trace file. (We already have such a trace file from feature/bug 1137.) Prompt would change to "prsim@ " to indicate this mode.
The commands allowed to the user would be limited to those that do NOT modify state, leaving only informational commands (which is most of them). This is similar to the set of commands allowed through VPI.
Event queue commands will be blocked or altered because it is possible-but-not-trivial to precisely reconstruct the event queue for any given moment. The alternative will be a set of commands that will allow one to view future and past events (window).
Exiting time-travel mode should take the user back to the state where the user first entered time-travel mode, probably through the use of checkpoints.
Saving/loading checkpoints within time-travel mode could be tricky though.
I could really use this now as I'm debugging co-simulation of the fabric, bug 2719.
some proposed commands:
time-machine -- enter time-machine mode (should be able to do recursively) time-step [n] -- advance N events time-unstep [n] -- reverse N events time-jump [t] -- go to a specific time T time-advance [t] -- advance or rewind a relative amount of time +/- time-queue [n] -- show the next N events, use negative N for past events back-to-the-future -- exit time-machine mode (the name is a joke)
Scratchpad - 2:
I'm really wishing for this now while debugging large and long-running sims.
Also it would be nice to be able to do this with vcd files, even if it is suboptimal.
Scratchpad - 3:
Note, with the implementation of atomic expression/node updates, we need to be careful about how to replay atomic nodes. It would be good to include atomic node updates explicitly in the trace files, however, since they are not user-settable and only respond to non-atomic bools, the replay could omit them and let the evaluation engine automatically update them to stay coherent with the non-atomic state.
The atomic expressions should always reflect the current non-atomic state.