Debug Circuit Trace Register Annotation for Low-Bandwidth Tracing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current debug trace modes in computer systems require recording information for all executed instructions, which increases bandwidth requirements and can disrupt program execution, making it difficult to insert debug messages without affecting the normal flow of the program, thereby reducing the accuracy of trace results.

Innovation Solution

A novel digital circuit that uses a trace register to annotate a trace stream with data values and core register information, allowing for the insertion of debug messages with minimal disruption, and a low-bandwidth trace mode that limits trace data to subroutine call and return instructions to reduce execution impact.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of information

If debug trace mode records information for all executed instructions, then trace data completeness is improved, but bandwidth requirements increase and program execution is disrupted

Engineering Contradiction:
Improvetrace data completenessVSAvoidbandwidth requirements
Core Design Contradiction:
Loss of informationVSQuantity of substance

Solution Approach 1:

The patent segments the trace data into two categories: essential trace information (program counter, branch information) that is always collected, and optional debug information (register values, memory contents) that is collected selectively based on breakpoints and triggers. This segmentation reduces the overall bandwidth requirements while maintaining trace data completeness for essential debugging functions.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies local quality by collecting detailed debug information only at specific locations in the program execution (breakpoints, triggers, exception handlers) rather than uniformly across all instructions. This allows the system to maintain high trace data quality where needed while reducing bandwidth consumption in other regions.

Inventive Principle:
Principle #3Local quality

2Adaptability or versatility

If debug messages are inserted into trace stream, then debugging capability is improved, but program execution disruption increases

Engineering Contradiction:
Improvedebugging capabilityVSAvoidprogram execution disruption
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent prepares debug information in advance by pre-configuring breakpoints, triggers, and filter criteria before program execution. This preliminary action allows the debug circuit to efficiently capture and insert relevant debug messages without requiring real-time processing that would disrupt program execution.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces a debug circuit as an intermediary component that sits between the program execution and the trace stream. This intermediary selectively captures debug information and inserts it into the trace stream without directly interfering with the normal program execution flow, thereby maintaining both debugging capability and execution speed.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If low-bandwidth trace mode limits trace data to subroutine calls and returns, then execution impact is reduced, but trace data detail is lost

Engineering Contradiction:
Improveexecution speedVSAvoidtrace data detail
Core Design Contradiction:
ProductivityVSLoss of information

Solution Approach 1:

The patent implements dynamic trace data collection by allowing the trace mode to switch between different levels of detail based on execution context. In normal execution, only essential trace information is collected to maintain high execution speed. When breakpoints or triggers are encountered, the system dynamically increases the detail level to capture comprehensive debug information.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent changes the parameter of trace data granularity based on execution conditions. By adjusting the amount and type of trace information collected according to specific events (breakpoints, exceptions, function calls), the system optimizes the balance between execution speed and trace data detail, ensuring sufficient information is available for bug diagnosis without excessive bandwidth consumption.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS12182003B1Hardware support for software event collection
Publication Date: 2024.12.31 APPLE INC
  • US12182003B1 patent drawing
  • US12182003B1 patent drawing
  • US12182003B1 patent drawing

AI summary

An apparatus includes a processor circuit that includes a memory circuit, one or more processor cores, and a debug circuit. The debug circuit may be configured, in response to activation of a trace mode to record information indicative of instructions executing on the one or more processor cores, to write a trace data stream to the memory circuit that includes trace data collected on the instructions executing on the one or more processor cores. In response to a particular instruction within one of the processor cores specifying a write of a data value to an architecturally visible trace register, the debug circuit may be further configured to output the data value to the trace data stream as part of executing the particular instruction.