Each trace record contains six (6) bytes of information. The first four (4)
bytes contain the physical address of the reference, the next byte contains
the Intel Pentium byte enable signals, and the final byte contains control
information.
Address Field
The address field of the trace is a 32 bit physical address. This field is
in big endian format and represents the address generated by the processor
being traced.
Byte Enable Field
The byte enable field describes which of the bytes fetched by the
processor are actually being requested. Each bit in the byte enable
field represents a byte in the eight bytes that are fetched by the
processor. If a bit is a zero the associated byte was requested by
the processor. If a bit is set the byte was not requested. The most
significant bit represents the most significant byte and the rest are
in descending order. For example, if the processor is requesting all
eight bytes being fetched the byte enable field will be 0x00. If only
the upper four bytes are being requested the field will contain 0x0f.
Control Field
The control field consists of eight bits that represent particular CPU
signals identifying the type of bus transaction taking place during
this reference. Currently only the upper four bits contain useful
information. If the control byte is shifted right four bits the
remaining value has the following meaning.
Value Description
0 Invalid
1 Interrupt Acknowledge
2 Invalid
3 Special Bus Cycle
4 Invalid
5 Input/Output Read
6 Invalid
7 Input/Output Write
8 Instruction Fetch
9 Noncacheable Instruction Fetch
10 Invalid
11 Invalid
12 Data Read
13 Noncacheable Data Read
14 Data Writeback
15 Data Write
In complete address traces all instruction fetches and data reads are noncacheable because
the first-level instruction and data caches are disabled. In trace data that is acquired
with the first-level caches enabled only those references that are truly noncacheable are
marked as such.
Included below is a very simple piece of C source code that reads the binary traces and
prints an ASCII representation to stdout. This may be useful as both an introductory tool
and as further trace format specification.
#include
char op[16][11] = {"INVALID",
"INT_ACK",
"INVALID",
"SPECIAL",
"INVALID",
"IO_READ",
"INVALID",
"IO_WRITE",
"I_FETCH",
"NC_I_FETCH",
"INVALID",
"INVALID",
"D_READ",
"NC_D_READ",
"WRITE_BACK",
"D_WRITE"};
main()
{
unsigned long addr;
unsigned char be, control;
fread(&addr, 4, 1, stdin);
fread(&be, 1, 1, stdin);
fread(&control, 1, 1, stdin);
while(!feof(stdin))
{
printf("%08x %02x %s\n", addr, be, op[control>>4]);
fread(&addr, 4, 1, stdin);
fread(&be, 1, 1, stdin);
fread(&control, 1, 1, stdin);
}
}