# US 11,119,787 B1 · Non-intrusive hardware profiling

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,119,787 B1
- Document ID: US11119787B1
- Status: Granted
- Kind: B1
- Application number: 16/368,263
- Filed: 2019-03-28
- Granted: 2021-09-14
- Earliest claimed: 2019-03-28
- Assignees: Amazon Technologies, Inc.
- Applicants: Amazon Technologies, Inc.
- Inventors: Mohammad El-Shabani; Ron Diamant; Samuel Jacob; Ilya Minkin; Richard John Heaton
- Web page: https://patentgrep.com/patent/US11119787B1

## CPC

- G06F 9/3856: {Reordering of instructions, e.g. using queues or age tags}
- G06F 11/3476: {Data logging (G06F11/14, G06F11/2205 take precedence)}
- G06F 11/2236: {to test CPU or processors}
- G06F 8/41: Compilation
- G06F 9/3017: {Runtime instruction translation, e.g. macros}
- G06F 9/4451: {User profiles; Roaming}
- G06F 9/45516: {Runtime code conversion or optimisation}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 11/3612: {by runtime analysis (performance monitoring G06F11/3466)}
- G06F 2009/45591: {Monitoring or debugging support}
- G06F 2201/835: Timestamp
- G06F 2201/86: Event-based monitoring
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for non-intrusive hardware profiling are provided. In some cases integrated circuit devices can be manufactured without native support for performance measurement and/or debugging capabilities, thereby limiting visibility into the integrated circuit device. Understanding the timing of operations can help to determine whether the hardware of the device is operating correctly and, when the device is not operating correctly, provide information that can be used to debug the device. In order to measure execution time of various tasks performed by the integrated circuit device, program instructions may be inserted to generate notifications that provide tracing information, including timestamps, for operations executed by the integrated circuit device.

## Claims

### Claim 1

A method for generating tracing information for execution engines of an integrated circuit device, the method comprising:
executing, by an execution engine, a first set of instructions from a first instruction queue, the first set of instructions including:
writing, with a first instruction generated by a processor of a host system executing a driver program, a first value to an event register associated with the first instruction queue, wherein upon writing the first value, notification logic generates a first notification that the first value was written to the event register associated with the first instruction queue, the first notification comprising a first timestamp and an identifier for the first instruction;
performing a first data movement operation by a second instruction generated by the processor of the host system executing a compiler; and
writing, with a third instruction generated by the processor of the host system executing the driver program, a second value to the event register associated with the first instruction queue, the third instruction being a last instruction in the first set of instructions, wherein upon writing the second value, the notification logic generates a second notification that the second value was written to the event register associated with the first instruction queue, the second notification comprising a second timestamp and an identifier for the third instruction.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
executing, by the execution engine, a second set of instructions from the first instruction queue, the second set of instructions including:
a fourth instruction generated by the processor of the host system executing the driver program to write a third value to the event register associated with the first instruction queue, wherein upon writing the third value the notification logic generates a third notification, the third notification comprising a third timestamp and an identifier for the fourth instruction;
a fifth instruction generated by the processor executing the compiler to perform a second data movement operation; and
a sixth instruction generated by the processor of the host system executing the driver program to write a fourth value to the event register associated with the first instruction queue, wherein upon writing the fourth value the notification logic generates a fourth notification, the fourth notification comprising a fourth timestamp and an identifier for the sixth instruction.

### Claim 3

A computer implemented method, comprising:
generating a set of instructions including:
an instruction inserted as a first instruction in the set of instructions to write a first value to a specified register;
a set of second instructions, the set of second instructions comprising memory instructions;
a third instruction to write a second value to the specified register inserted as a last instruction in the set of instructions; and
upon executing the set of instructions from a first instruction queue of a plurality of instruction queues:
executing the first instruction to write the first value to the specified register, the specified register being associated with the first instruction queue;
generating a first notification that the first value was written to the specified register, the first notification including a first timestamp;
executing the set of second instructions;
executing the third instruction to write the second value to the specified register; and
generating a second notification that the second value was written to the specified register, the second notification including a second timestamp.

### Claim 4 (depends on 3)

The computer implemented method of claim 3, wherein the specified register is an event register; and
the first instruction in the set of instructions is a set event instruction and the third instruction in the set of instructions is a clear event instruction.

### Claim 5 (depends on 4)

The computer implemented method of claim 4, wherein:
each instruction queue of the plurality of instruction queues is associated with a different one of a plurality of event registers;
other sets of instructions are executed from each of the plurality of instruction queues;
a first instruction in each of the other sets of instructions executed from each of the plurality of instruction queues is a set event instruction and a last instruction in each of the other sets of instructions executed from each of the plurality of instruction queues is a clear event instruction; and
notifications are generated for the set event instruction and the clear event instruction executed from each of the plurality of instruction queues when values are written by the set event and clear event instructions to the one of the plurality of event registers associated with each of the plurality of instruction queues.

### Claim 6 (depends on 5)

The computer implemented method of claim 5, wherein the notifications are written to a set of notification queues configured in a host or a processor memory, each notification queue in the set of notification queues associated with one of the plurality of instruction queues.

### Claim 7 (depends on 5)

The computer implemented method of claim 5, wherein:
the notifications from each of the plurality of instruction queues are written to one notification queue configured in a host or a processor memory.

### Claim 8 (depends on 3)

The computer implemented method of claim 3, wherein the specified register is a notification register;
each instruction queue of the plurality of instruction queues is associated with the notification register;
other sets of instructions are executed from each of the plurality of instruction queues;
a first instruction in each of the other sets of instructions executed from each of the plurality of instruction queues is a first write instruction to the notification register and a last instruction in each of the other sets of instructions executed from each of the plurality of instruction queues is a second write instruction to the notification register; and
a notification is generated for each write instruction to the notification register executed from each of the plurality of instruction queues.

### Claim 9 (depends on 8)

The computer implemented method of claim 8, wherein each write instruction to the notification register includes information identifying the one of the plurality of instruction queues executing the write instructions; and
the notification generated by the write instruction includes the information identifying the one of the plurality of instruction queues executing the write instructions.

### Claim 10 (depends on 8)

The computer implemented method of claim 8, wherein notifications are written to a notification queue configured in a host or a processor memory, each instruction queue of the plurality of instruction queues associated with the notification queue.

### Claim 11 (depends on 3)

The computer implemented method of claim 3, wherein each of the plurality of instruction queues is associated with one execution engine.

### Claim 12 (depends on 3)

The computer implemented method of claim 3, wherein each of the plurality of instruction queues is associated with different execution engines.

### Claim 13 (depends on 3)

The computer implemented method of claim 3, wherein the set of second instructions is generated by a compiler at compile time.

### Claim 14 (depends on 3)

The computer implemented method of claim 3, wherein the first instruction, the set of second instructions, and the third instruction are generated by a compiler at compile time.

### Claim 15

A computing system, comprising:
a processor;
notification logic;
a processor memory communicatively coupled to the processor, the processor memory configured to store instructions implementing a program to configure instruction queues in the processor memory to store sets of instructions;
a set of registers; and
execution engines operable to execute the sets of instructions, each of the sets of instructions including:
a first instruction to write a first value to one register of the set of registers, wherein writing the first value causes the notification logic to generate a first notification, the first notification comprising a first timestamp and an identifier for the first instruction;
a second instruction to perform a first data movement operation; and
a third instruction to write a second value to the one register of the set of registers, wherein writing the second value causes the notification logic to generate a second notification, the second notification comprising a second timestamp and an identifier for the third instruction.

### Claim 16 (depends on 15)

The computing system of claim 15, wherein the second instruction is generated by the processor executing a compiler, and
the first and third instructions are inserted by a driver program.

### Claim 17 (depends on 15)

The computing system of claim 15, wherein each register in the set of registers is associated with one of the instruction queues.

### Claim 18 (depends on 15)

The computing system of claim 15, wherein the program implemented by the processor further configures notification queues in the processor memory, each of the notification queues associated with one instruction queue of the instruction queues.

### Claim 19 (depends on 18)

The computing system of claim 18, wherein the notification logic writes notifications to a notification queue of the notification queues associated with the one instruction queue of the instruction queues that causes the notifications to be generated.

### Claim 20 (depends on 15)

The computing system of claim 15, wherein one of the execution engines is a direct memory access (DMA) engine.

### Claim 21

A non-transitory computer readable storage medium having stored therein instructions that, when executed by one or more processors cause the one or more processors to execute a compiler, the compiler performing operations including:
generating a first instruction in a set of instructions, wherein the first instruction when executed causes a first notification to be generated to a notification queue configured in a host or processor memory, the first notification including a first timestamp indicating when the first notification was generated and an identifier for the first instruction;
generating a second instruction in the set of instructions, wherein the second instruction when executed causes a first data movement operation to be performed; and
generating a third instruction, the third instruction being a last instruction in the set of instructions, wherein the last instruction when executed causes a second notification to be generated to the notification queue configured in the host or processor memory, the second notification including a second timestamp indicating when the second notification was generated and an identifier for the last instruction.

### Claim 22

A non-transitory computer readable storage medium having stored therein instructions that, when executed by one or more processors cause the one or more processors to execute a driver program, the driver program performing operations including:
generating a first instruction;
inserting the first instruction as a first instruction in a set of instructions, wherein the first instruction when executed causes a first notification to be generated to a notification queue configured in a host or processor memory, wherein the first notification includes a first timestamp indicating when the first notification was generated and an identifier for the first instruction;
generating a second instruction; and
inserting the second instruction as a last instruction in the set of instructions, wherein the second instruction when executed causes a second notification to be generated to the notification queue configured in the host or processor memory, the second notification including a second timestamp indicating when the second notification was generated and an identifier for the last instruction.
