BBV: an experimental basic block vector generation tool
The outputs from the SimPoint run are the
results.simpts
and
results.weights
files. The first holds the
5 most relevant intervals of the program. The seconds holds the weight to scale each interval by when extrapolating
full-program behavior. The intervals and the weights can be used in conjunction with a simulator that supports fast-
forwarding; you fast-forward to the interval of interest, collect stats for the desired interval length, then use statistics
gathered in conjunction with the weights to calculate your results.
12.3. BBV Command-line Options
BBV-specific command-line options are:
--bb-out-file=<name> [default:
bb.out.%p]
This option selects the name of the basic block vector file. The
%p
and
%q
format specifiers can be used to embed the
process ID and/or the contents of an environment variable in the name, as is the case for the core option
--log-file
.
--pc-out-file=<name> [default:
pc.out.%p]
This option selects the name of the PC file. This file holds program counter addresses and function name info for
the various basic blocks. This can be used in conjunction with the basic block vector file to fast-forward via function
names instead of just instruction counts. The
%p
and
%q
format specifiers can be used to embed the process ID and/or
the contents of an environment variable in the name, as is the case for the core option
--log-file
.
--interval-size=<number> [default:
100000000]
This option selects the size of the interval to use. The default is 100 million instructions, which is a commonly used
value. Other sizes can be used; smaller intervals can help programs with finer-grained phases.
However smaller
interval size can lead to accuracy issues due to warm-up effects (When fast-forwarding the various architectural
features will be un-initialized, and it will take some number of instructions before they "warm up" to the state a
full simulation would be at without the fast-forwarding. Large interval sizes tend to mitigate this.)
--instr-count-only [default:
no]
This option tells the tool to only display instruction count totals, and to not generate the actual basic block vector file.
This is useful for debugging, and for gathering instruction count info without generating the large basic block vector
files.
12.4. Basic Block Vector File Format
The Basic Block Vector is dumped at fixed intervals.
This is commonly done every 100 million instructions; the
--interval-size
option can be used to change this.
The output file looks like this:
T:45:1024 :189:99343
T:11:78573 :15:1353
:56:1
T:18:45 :12:135353 :56:78 314:4324263
Each new interval starts with a T. This is followed on the same line by a series of basic block and frequency pairs, one
for each basic block that was entered during the interval. The format for each block/frequency pair is a colon, followed
by a number that uniquely identifies the basic block, another colon, and then the frequency (which is the number of
times the block was entered, multiplied by the number of instructions in the block). The pairs are separated from each
other by a space.
The frequency count is multiplied by the number of instructions that are in the basic block, in order to weigh the count
so that instructions in small basic blocks aren’t counted as more important than instructions in large basic blocks.
159