05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Performance Monitors<br />

C9.1 About the performance monitors<br />

The basic organization of the performance monitors is:<br />

A cycle counter. This can be programmed to increment either on every cycle, or once every 64 cycles.<br />

A number of event counters. Each counter is configured to select the event that increments the<br />

counter. Space is provided in the architecture for up to 31 counters. The actual number of counters is<br />

IMPLEMENTATION DEFINED, <strong>and</strong> there is an identification mechanism for the counters.<br />

Controls for enabling the counters, resetting the counters, flagging overflows, <strong>and</strong> enabling interrupts<br />

on counter overflow.<br />

The cycle counter can be enabled independently of the event counters.<br />

The counters are held in a set of registers that can be accessed in coprocessor space. This means the counters<br />

can be accessed from the operating system running on the processor, enabling a number of uses, including:<br />

dynamic compilation techniques<br />

energy management.<br />

In addition, you can provide access to the counters from application code, if required. This enables<br />

applications to monitor their own performance with fine grain control without requiring operating system<br />

support. For example, an application might implement per-function performance monitoring.<br />

There are many situations where performance monitoring features integrated into the processor are valuable<br />

for applications <strong>and</strong> for application development. When an operating system does not use the performance<br />

monitors itself, <strong>ARM</strong> recommends that it enables application code access to the performance monitors.<br />

However an implementation can choose not to implement any performance monitors.<br />

To enable interaction with external monitoring, an implementation might consider additional enhancements,<br />

including:<br />

Providing a set of events, from which a selection can be exported onto a bus for use as external events.<br />

For very high frequency operation, this might introduce unacceptable timing requirements, but the<br />

bus could be interfaced to the trace macrocell or another closely coupled resource.<br />

Providing the ability to count external events. Here, again, there are clock frequency issues between<br />

the processor <strong>and</strong> the system. A suitable approach might be to edge-detect changes in the signals <strong>and</strong><br />

to use those changes to increment a counter.<br />

This enhancement requires the processor to implement a set of external event input pins.<br />

Providing memory-mapped <strong>and</strong> external debug access to the performance monitor registers, to enable<br />

the counter resources to be used for system monitoring in systems where they are not used by the<br />

software running on the processor.<br />

Such access is not described in this manual. Contact <strong>ARM</strong> if you require more information about this<br />

option.<br />

C9-2 Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0406B

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

Saved successfully!

Ooh no, something went wrong!