14.06.2015 Views

Power ISA™ Version 2.03 - Power.org

Power ISA™ Version 2.03 - Power.org

Power ISA™ Version 2.03 - Power.org

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Version</strong> <strong>2.03</strong><br />

Appendix E. Example Performance Monitor<br />

[Category: Embedded.Performance Monitor]<br />

E.1 Overview<br />

This appendix describes an example of a Performance<br />

Monitor facility. It defines an architecture suitable for<br />

performance monitoring facilities in the Embedded<br />

environment. The architecture itself presents only programming<br />

model visible features in conjunction with<br />

architecturally defined behavioral features. Much of the<br />

selection of events is by necessity implementationdependent<br />

and is not described as part of the architecture;<br />

however, this document provides guidelines for<br />

some features of a performance monitor implementation<br />

that should be followed by all implementations.<br />

The example Performance Monitor facility provides the<br />

ability to monitor and count predefined events such as<br />

processor clocks, misses in the instruction cache or<br />

data cache, types of instructions decoded, or mispredicted<br />

branches. The count of such events can be used<br />

to trigger the Performance Monitor exception. While<br />

most of the specific events are not architected, the<br />

mechanism of controlling data collection is.<br />

The example Performance Monitor facility can be used<br />

to do the following:<br />

<br />

<br />

<br />

Improve system performance by monitoring software<br />

execution and then recoding algorithms for<br />

more efficiency. For example, memory hierarchy<br />

behavior can be monitored and analyzed to optimize<br />

task scheduling or data distribution algorithms.<br />

Characterize processors in environments not easily<br />

characterized by benchmarking.<br />

Help system developers bring up and debug their<br />

systems.<br />

E.2 Programming Model<br />

The example Performance Monitor facility defines a set<br />

of Performance Monitor Registers (PMRs) that are<br />

used to collect and control performance data collection<br />

and an interrupt to allow intervention by software. The<br />

PMRs provide various controls and access to collected<br />

data. They are categorized as follows:<br />

<br />

<br />

<br />

Counter registers. These registers are used for<br />

data collection. The occurrence of selected events<br />

are counted here. These registers are named<br />

PMC0..15. User and supervisor level access to<br />

these registers is through different PMR numbers<br />

allowing different access rights.<br />

Global controls. This register control global settings<br />

of the Performance Monitor facility and affect<br />

all counters. This register is named PMGC0. User<br />

and supervisor level access to these registers is<br />

through different PMR numbers allowing different<br />

access rights. In addition, a bit in the MSR<br />

(MSR PMM ) is defined to enable/disable counting.<br />

Local controls. These registers control settings<br />

that apply only to a particular counter. These registers<br />

are named PMLCa0..15 and PMLCb0..15.<br />

User and supervisor level access to these registers<br />

is through different PMR numbers allowing different<br />

access rights. Each set of local control<br />

registers (PMLCan and PMLCbn) contains controls<br />

that apply to the associated same numbered<br />

counter register (e.g. PMLCa0 and PMLCb0 contain<br />

controls for PMC0 while PMLCa1 and<br />

PMLCb1 contain controls for PMC1).<br />

Assembler Note<br />

The counter registers, global controls, and local<br />

controls have alias names which cause the assembler<br />

to use different PMR numbers. The names<br />

PMC0...15, PMGC0, PMLCa0...15, and<br />

PMLCb0...15 cause the assembler to use the<br />

supervisor level PMR number, and the names<br />

UPMC0...15, UPMGC0, UPMLCa0...15, and<br />

UPMLCb0...15 cause the assembler to use the<br />

user-level PMR number.<br />

A given implementation may implement fewer counter<br />

registers (and their associated control registers) than<br />

are architected. Architected counter and counter control<br />

registers that are not implemented behave the<br />

same as unarchitected Performance Monitor Registers.<br />

PMRs are described in Section E.3.<br />

Software uses the global and local controls to select<br />

which events are counted in the counter registers,<br />

when such events should be counted, and what action<br />

Appendix E. Example Performance Monitor [Category: Embedded.Perfor-<br />

631

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!