74K™ core features for debug and profiling
119
Programming the MIPS32® 74K™ Core Family, Revision 02.14
used intrusive interrupt-based PC-sampling for many years, so there are tools which can readily interpret this sort of
data.
When PC sampling is configured in your core, it runs continuously. Some sleight of hand is used if the CPU is hang-
ing on a
wait
instruction. Rather than wasting even a small amount of power running the counter and resampling the
PC of the
wait
instruction, the hardware simply keeps the “new” bit set while it is in this state telling the profiling
software that yes, we are still at that instruction. You can choose to sample as often as once per 32 cycles or as rarely
as once per 4096 cycles
30
; at every sampling point the address of the instruction completing in that cycle (or if none
completes, the address of the next instruction to complete) is deposited in a JTAG-accessible register. Sampling rate is
controlled by the
DCR[PCR]
field of the debug control register shown in Figure 7-5.
In addition to the 32 bits of the instruction address, several other fields are stored by the hardware to help identify the
instruction. The aforementioned “new” bit indicates a new sample, which a probe can use to avoid double-counting
the same sample. On multi-threaded CPUs where there might be several copies of the code running, a TCID field is
also appended. The then-current ASID may also be included so that you can interpret the virtual PC. The ASID is
included unless the
DCR[PCnoASID]
bit is set. This bit may be hardwired in a given implementation or the bit might
be writable, so go ahead and try to change it if you feel like it (but be sure to read it back and see if the write ‘stuck’
so that you know how many bits to scan and how to interpret them).
EJTAG revision 5.0 adds a new optional mechanism for triggering PC sampling when an instruction fetch misses in
the I-cache. When the
PCIM
and
PCSe
fields of the
Debug Control Register
(
DCR[26]
and
DCR[5]
) are set to 1,
instructions that miss in the I-cache and all the uncached fetches are captured. The capturing of the I-cache misses
does not depend on the PC Sampling Rate (
DCR[8:6]
). Whenever there is a miss, that PC will be captured. The cap-
tured PC will be sent to EJTAG to shift out through
PCSAMPLE
. Over time, this collection mode results in an overall
picture of the instruction cache behavior and can be used to increase performance by re-arranging code to minimize
cache thrashing.
8.1.15 JTAG-accessible and memory-mapped PDtrace TCB Registers
The DCR and the hardware breakpoint registers are EJTAG registers that are both JTAG-accessible and memory-
mapped. In addition to the DCR and the hardware breakpoint registers, the EJTAG PDtrace Registers listed in
are also memory-mapped to drseg. These registers allow software to access the on-chip trace memory. A load
from the EJAG register
TCBTW
will return the data at the address location pointed to by the read pointer
TCBRDP
.
See the Software User’s Manual for more details and rules to access the on-chip trace memory.
30. Since it runs continuously, it’s a good thing that from reset the sampling period defaults to its maximum.
Table 8.5 Mapping TCB Registers in drseg
Offset in drseg
Register Name
Description
0x3000
TCBControlA
The TCBControlA register.
0x3008
TCBControlB
The TCBControlB register.
0x3010
TCBControlC
The TCBControlC register.
0x3018
TCBControlD
The TCBControlD register.
0x3020
TCBControlE
The TCBControlE register.
0x3028
TCBConfig
The TCBConfig register.
Содержание MIPS32 74K Series
Страница 1: ...Document Number MD00541 Revision 02 14 March 30 2011 Programming the MIPS32 74K Core Family...
Страница 10: ...Programming the MIPS32 74K Core Family Revision 02 14 10...
Страница 20: ...1 4 A brief guide to the 74K core implementation Programming the MIPS32 74K Core Family Revision 02 14 20...
Страница 28: ...2 2 PRId register identifying your CPU type Programming the MIPS32 74K Core Family Revision 02 14 28...
Страница 54: ...3 8 The TLB and translation Programming the MIPS32 74K Core Family Revision 02 14 54...
Страница 83: ......
Страница 86: ...6 5 FPU pipeline and instruction timing Programming the MIPS32 74K Core Family Revision 02 14 86...
Страница 101: ...The MIPS32 DSP ASE 101 Programming the MIPS32 74K Core Family Revision 02 14...
Страница 134: ...8 4 Performance counters Programming the MIPS32 74K Core Family Revision 02 14 134...
Страница 154: ...C 3 FPU changes in Release 2 of the MIPS32 Architecture Programming the MIPS32 74K Core Family Revision 02 14 154...