Next: , Previous: Sampling, Up: Sampling


3.1 Sampling and Trace Mode Concepts

Normally RSIML simulates the target in enough detail to determine how long it would take a program to run on the target, when it does so it is said to be performing timing simulation. It can also perform functional simulation, in which simulation only maintains the state of registers and memory. For timing simulation the simulator must keep track of numerous processor features such as buses, instruction queues, the cache, etc, and so it takes much longer than functional simulation.

When the simulator is collecting data it is said to be in sample mode. (In an unsampled run the simulator is always in sample mode.) At other times the simulator is either in skip mode or warmup mode. In skip mode the simulator is performing functional simulation so it can quickly reach warmup mode. In warmup mode data is not collected (or it's collected but then discarded).

If trace_mode is 0 (the default) then warmup mode and sample mode are performed using timing simulation and so warmup mode is only slightly faster than sample mode. (In the future a fast warmup mode may be added.) If trace_mode is 1 warmup mode is not used, instead the simulator goes directly from skip mode to sample mode, and sample mode is performed using functional simulation.

If trace_mode is 0 and sampling is on the order of modes is skip, warmup, sample, skip, warmup, sample, and so on. Warmup mode is intended to bring the state of caches, branch predictors, and other structures sufficiently close to their correct state when sample mode starts (the correct state is the state in an unsampled simulation at the same point in the benchmark).

The scheduling of the three modes should be chosen so that data of sufficient quality is obtained with the minimum host time. RSIML has three schemes for scheduling modes, they are single sample, periodic sampling, and targeted sampling. It is up to the user to determine whether a particular scheduling achieves sufficient quality in acceptable time (or for that matter, just what constitutes sufficient quality).

For all schemes the location of a sample is specified by the number of instructions since benchmark start. (The count is of correct path program instructions, squashed instructions don't count.) The duration of a sample and the duration of warmup mode is also specified by the number of instructions. In trace mode warmup size is ignored but skip size is chosen so that sample mode starts at the same instruction it would if trace mode were off.

As the name suggests there is a single sample under single-sample sampling. Under periodic sampling samples start at fixed intervals, under targeted sampling the start of each sample is individually specified.

Single-sample mode is least accurate (except for the case when the sample covers the entire benchmark run) and should only be used when there is a need to investigate part of a run, such as for debugging.

Targeted sampling is potentially the fastest, but requires analysis of the benchmark program (which is not yet part of RSIML) and will not work for benchmarks with variable run times. (A good benchmark shouldn't have variable run times.)