Text preview for : Collecting_and_Analyzing_Pair_Frequency_Data_for_Mesa_Opcodes_May81.pdf part of xerox Collecting and Analyzing Pair Frequency Data for Mesa Opcodes May81 xerox sdd memos_1981 Collecting_and_Analyzing_Pair_Frequency_Data_for_Mesa_Opcodes_May81.pdf



Back to : Collecting_and_Analyzing_ | Home

Inter-Office Memorandum
To dragon interest Date May 12. 1981

From Gene McDaniel Location Palo Alto

Subject Collecting and AnalY7jng Organization csl
Pair Frequency Data for Mesa Opcodes


ROX
Filed on: [ivy]


1. Introduction
This memo describes available facilities that provide for the collection and analysis of dynamic
opcode pair-frequency information for Mesa programs. By dynamic w<;, refer to the execution time
occurrence of instructions rather than the static or compile time occurence of instructions. By pair-
frequency we refer to the frequency with which one instruction or class of instructions is followed
by another specific instruction or class of instructions.

This memo assumes the reader is familiar with the details of Mesa, the Mesa instruction set and
the Prine Ops architecture in general. The tools described herein provide information that will be
of interest mostly to hardware and instruction set designers. Ideally these facilities will help
investigators gain insights as to what combinations of instructions frequently occur and as to what
dependencies among instructions may cause performance penalties in a pipeline. Informati'on of
this sort is limited because it describes what is rather than what could be. There are analysis
facilities that the author hopes will partially mitigate this situation.

These facilities are easy to use: There is a data collection phase and a data analysis phase, each
of which' has convenient defaults. There are such files of data from specific experiments and
standard analyses that some investigators may not choose to run other experiments or to use the
interactive data analysis facilities. Those who wish to gather data about other programs will find it
fairly simple to do. In simple cases it is not necessary to modify the target program (the program
for which pariwise instruction data is gathered). The analysis program provides a 'standard- analysis
that the investigator can apply directly to the data by invoking a program from the executive.
There are additional facilities within the analysis program that enable the investigator to construct
inquires about the data. By this means the investigator can determine how often arbitrary
collections of instructions were followed by other, arbitrary c911ections of instructions.

There are important restrictions associated with this facility. It runs only on a 1M-word
Dorado. It does not work for pilot programs, programs that require the color ,display, garbage
collection or any other special microcode.

The remainder of this memo comes in five parts. The section below provides a simple scenario
whereby the investigator can analyze the dynamic pair frequencies associated with a program. The
next section discusses the mechanism whereby the special microcode collects the data. Following
that, there are two section,s that discuss the standard data analysis and interactive queries
respectively. The appendix details specific features in the standard analysis of data and documents
the program interface.
2
Collecting and Analyzing Pair Frequency Data for Mesa Opcodes

Where to find the Files. All files are localed in [ivy] or . There is a
command tile, selUpFori>airs.cm on [ivy] that will fetch all the program modules the
investigator will need. The author conducted two experiments whose results may be found on ivy:

[ivy]pairs>compiler.press, compiler.counts
[ivy]pairs>static.press, static.counts

The .press files are the standard output produced by the PairFreq program, and the .counts
tiles contain the raw data for experiments. The "compiler" files are the analysis and data files
associated with a run of the mesa compiler. Pair-counting was turned off while disk 10 was
performed. The static files are the analysis .and data files associated with a run of the "static"
program written by Baskett. Pair-counting was turned-off when disk 10 was likely to be performed,
however, some disk )0 probably was measured. Static makes use of the extra memory available on
a 0* machine and performs a lot of floating point arithmetic.

Section 5 describes the interactive commands of PairFreq. The reader can usc them to read
one of the .counts files with PairFreq and then to perform further analysis.

2. A Simple Scenario
Suppose you have a program for which you wish to collect dynamic pair frequency
information. Proceed with the following steps:

1. Find aIM-word Dorado.
2. Move your program to that Dorado
3. Fetch [ivy]setUpForPairs.cm
4. Type "@setUpForPairs.cm"(carriage return)
5. Run you program
6. Type "StopM icroPcPairs (carriage return)"
7. Type "PairFreq (carriage return)"
8. Print Mesa.typescript to see the standard analysis.

3. About Data Collection
The author modified the Mesa microcode to provide for gathering instruction pair data. There
is a "miscellaneous" instruction whose parameter is a LONG POINTER to an array of 2t16 LONG
CARDINALS! This array is named "pairData". When the pointer is 0, the microcode does not
collect pair frequency data. The microcode entry point for most instructions has been modified so
that it contains a subroutine call to the pair frequency collector. The pair frequency collector
increments the LONG. CARDINAL whose index is indicated by the concatenation of the last
opcode with the current opcode. To provide a better gauge for true PRINe OPS and Dragon
behavior, the microcode ignores no-op instructions. The effect is as if the sequence op> were really . This has been done because the Alto/Mesa
implementation has an unnatural number of no-ops. An instruction that has not been instrumented
will be counted as if it were instruction 377B.

Ease of microcode implementation requires