Next: , Previous: Modes Commands, Up: Commands


3.8 tracing Commands

Checkpointing is useful for saving the state of the simulator, which allows one to interrupt and resume long simulations, and also examine points of failure in detail.

— Command: save ckpt

Saves the current state of the production rules and nodes into a checkpoint file ckpt. The checkpoint file can be loaded to resume or replay a simulation later.

— Command: load ckpt

Loads a hacprsim checkpoint file into the simulator state. Loading a checkpoint will not overwrite the current status of the auto-save file, the previous autosave command will keep effect. Loading a checkpoint, however, will close any open tracing streams.

— Command: autosave [on|off [file]]

Automatically save checkpoint upon end of simulation, regardless of exit status. The reset command will turn off auto-save; to re-enable it with the same file name, just autosave on. The -a command line option is another way of enabling and specifying the autosave checkpoint name.

The simulator supports trace file recording, using its own trace file format. Unlike checkpoints, trace files contain information for the entire history of execution, not just the state at one point in time.

— Command: trace file

Record events to tracefile file. Overwrites file if it already exists. A trace stream is automatically closed when the initialize or reset commands are invoked. See the -r option for starting up the simulator with a newly opened trace stream. The format of this trace file is unique to hacprsim.

— Command: trace-file

Print the name of the currently opened trace file.

— Command: trace-close

Finish writing the currently opened trace file by flushing out the last epoch and concatenating the header with the stream body. Trace is automatically closed when the simulator exits.

— Command: trace-flush-notify [0|1]

Enable (1) or disable (0) notifications when trace epochs are flushed.

— Command: trace-flush-interval steps

If steps is given, set the size of each epoch according to the number of events executed, otherwise report the current epoch size. This regulates the granularity of saving traces in a space-time tradeoff.

— Command: trace-dump file

Produce textual dump of trace file contents in file.

This simulator now has support for recording vector-change-dump (VCD) files.

— Command: vcd file

Record events to vcd file. Overwrites file if it already exists. A vector-change-dump (VCD) stream is automatically closed when the initialize or reset commands are invoked. See the -r option for starting up the simulator with a newly opened trace stream.

— Command: vcd-file

Print the name of the currently opened vcd file.

— Command: vcd-timescale [val]

Sets/gets the time scale by which real-valued actual times are multiplied to get the output vcd timestamps. This is needed because vcd files don't necessary support floating-point values, so a scale factor can be used to select a suitable time granularity. Default: 1.0

— Command: vcd-close

Finish writing the currently opened vcd file by flushing out buffered events to file. VCD files are automatically flushed and closed when the simulator exits.