Per Instruction Performance Event Sampling for Processor Pipelines

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Evaluating software performance on processor cores is challenging due to the difficulty in determining which instructions to sample, how often to sample, and what data to collect, especially when optimizing for different goals and software designs.

Innovation Solution

The implementation of a Per Instruction Performance Event Sampling (PIPES) system that uses a single set of counters to flexibly trigger and reset, enabling efficient sampling of performance events associated with processing instructions in a processor pipeline.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If instruction tracing is used to analyze processor history, then system performance information can be obtained, but the complexity of determining which instructions to sample and how often to sample increases

Engineering Contradiction:
Improveperformance measurement accuracyVSAvoidsampling control complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The sampling system dynamically adjusts the sampling rate based on processor state. The performance monitoring unit changes sampling frequency automatically according to detected conditions, allowing flexible adaptation to different operational scenarios without requiring complex external control logic.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The performance monitoring unit autonomously determines when to sample instructions based on internal state detection. The system self-regulates the sampling process by monitoring processor events and automatically triggering samples at appropriate moments, eliminating the need for complex external sampling control mechanisms.

Inventive Principle:
Principle #25Self-service

2Adaptability or versatility

If multiple counters are used to track different performance events, then measurement flexibility improves, but hardware resource utilization efficiency decreases

Engineering Contradiction:
Improveperformance event tracking flexibilityVSAvoidhardware resource consumption
Core Design Contradiction:
Adaptability or versatilityVSQuantity of substance

Solution Approach 1:

A single counter resource is designed to perform multiple functions by tracking different performance events sequentially. The performance monitoring unit can reconfigure the counter to measure various metrics (cache misses, branch predictions, instruction throughput) at different times, allowing one hardware resource to serve multiple measurement purposes.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The counter configuration is dynamically changed during operation. The system adjusts which performance event the counter tracks based on current measurement needs, enabling flexible adaptation to different monitoring goals without requiring dedicated counters for each event type.

Inventive Principle:
Principle #15Dynamics

3Measurement precision

If performance sampling is performed frequently, then measurement detail and accuracy improve, but processor performance impact increases

Engineering Contradiction:
Improveperformance measurement detailVSAvoidprocessor execution speed
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The system performs performance sampling periodically rather than continuously. The performance monitoring unit triggers samples at regular intervals or based on specific event thresholds, reducing the overall sampling frequency and minimizing interference with normal processor operation while still capturing sufficient performance data.

Inventive Principle:
Principle #19Periodic action

Solution Approach 2:

The system samples only a subset of instructions rather than every instruction. By selectively sampling based on performance criteria or random selection, the system obtains adequate measurement detail without the overhead of universal sampling, thus reducing the impact on processor productivity.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS20250036413A1Measuring Performance Associated with Processing Instructions
Publication Date: 2025.01.30 SIFIVE INC
  • US20250036413A1 patent drawing
  • US20250036413A1 patent drawing
  • US20250036413A1 patent drawing

AI summary

A system may include a processor having a pipeline, a plurality of counters, and trigger circuitry. The plurality of counters may mount events associated with processing instructions in the pipeline. Counters of the plurality of counters may count different events. The trigger circuitry may trigger a performance measurement for a first instruction after counters of the plurality of counters meet predefined values. Triggering the performance measurement may cause the plurality of counters to reset and then count events associated with processing the first instruction. In some implementations, the trigger circuitry may trigger the performance measurement based on an AND selection and/or an OR selection of multiple counters of the plurality of counters meeting predefined values.