# US 2015/0106793 A1 · Detecting Byte Ordering Type Errors in Software Code

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

- Number: US 2015/0106793 A1
- Document ID: US20150106793A1
- Status: Published application
- Kind: A1
- Application number: 14/054,484
- Filed: 2013-10-15
- Published: 2015-04-16
- Earliest claimed: 2013-10-15
- Assignees: NXP USA, Inc.
- Inventors: Brian C. Kahne; John H. Arends; Richard G. Collins; James C. Holt
- Web page: https://patentgrep.com/patent/US20150106793A1

## CPC

- G06F 11/3648: {using additional hardware}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An approach is provided in which an endianness violation detection sub-system detects endianness violations between hardware units. The endianness violation detection sub-system tracks memory operations performed by multiple hardware units via debug channels and generates lookup table entries that are stored in a lookup table. When the endianness violation detection sub-system detects endianness relevant load attributes of a load operation that are different than corresponding endianness relevant store attributes of a store operation, the endianness violation detection sub-system generates an endianness violation. In one embodiment, the endianness violation detection sub-system identifies an endianness violation when the endianness violation detection sub-system detects a difference in the byte ordering type between a hardware unit performing a store operation and a hardware unit performing a load operation.

## Claims

### Claim 1

A method comprising:
locating, by one or more processors included in an endianness violation detection sub-system, a store real data address range that overlaps a load real data address range, wherein the store real data address range is included in store debug data generated in response to execution of a store operation, and wherein the load real data address range is included in load debug data generated in response to execution of a load operation;
determining, by at least one of the one or more processors, that at least one endianness relevant load attribute corresponding to the load operation is different than at least one endianness relevant store attribute corresponding to the store operation; and
generating an endianness violation, by at least one of the one or more processors, in response to the determination.

### Claim 2 (depends on 1)

The method of claim 1 further comprising:
retrieving, by at least one of the one or more processors, a load size corresponding to the load operation and a store size corresponding to the store operation, the load size included in the one or more endianness relevant load attributes and the store size included in the one or more endianness relevant store attributes;
determining that the load size is different than the store size; and
performing the generation of the endianness violation in response to the determination that the load size is different than the store size.

### Claim 3 (depends on 2)

The method of claim 2 further comprising:
retrieving, by at least one of the one or more processors, a load real data address corresponding to the load operation, the load real data address included in the one or more endianness relevant load attributes;
computing the load real data address range based upon the load real data address and the load size;
retrieving a store real data address corresponding to the store operation, the store real data address included in the one or more endianness relevant store attributes; and
computing the store real data address range utilizing the store real data address and the store size.

### Claim 4 (depends on 1)

The method of claim 1 wherein, prior to the locating of the store real data address range that overlaps the load real data address range, the method further comprises:
obtaining, by at least one of the one or more processors, the store debug data from one of a plurality of hardware units over one of a plurality of debug channels;
extracting, by at least one of the one or more processors, a store effective data address from the store debug data;
translating the store effective data address to a store real data address using a shadow memory management unit, wherein the shadow memory management unit receives memory management unit update information over one or more of the plurality of debug channels; and
storing the received store debug data and the store real data address in a lookup table entry.

### Claim 5 (depends on 1)

The method of claim 1 wherein a first hardware unit executes the store operation and generates the store debug data, and wherein a second hardware unit executes the load operation and generates the load debug data.

### Claim 6 (depends on 5)

The method of claim 5 further comprising:
retrieving, by at least one of the one or more processors, a first byte ordering type identifier corresponding to the first hardware unit, the first byte ordering type identifier included in the one or more endianness relevant store attributes;
retrieving a second byte ordering type identifier corresponding to the second hardware unit, the second byte ordering type identifier included in the one or more endianness relevant load attributes; and
generating the endianness violation in response to determining that the first byte ordering type identifier is different than the second byte ordering type identifier.

### Claim 7 (depends on 5)

The method of claim 5 wherein the first hardware unit and the second hardware unit are different hardware unit types selected from the group consisting of a processor core and a hardware accelerator.

### Claim 8 (depends on 5)

The method of claim 5 further comprising:
filtering, by at least one of the one or more processors, unfiltered debug data according to one or more filter rules that includes one or more address ranges and one or more hardware unit identifiers that identify at least one of a plurality of hardware units, the first hardware unit and the second hardware unit included in the plurality of hardware units.

### Claim 9 (depends on 8)

The method of claim 8 wherein, in response to generating the endianness violation, the method further comprises:
generating, by at least one of the one or more processors, a first filter rule that filters out subsequent debug data corresponding to the first hardware unit and the store real data address range; and
generating a second filter rule that filters out the subsequent debug data corresponding to the second hardware unit and the store real data address range.

### Claim 10 (depends on 1)

The method of claim 1 further comprising:
determining, by at least one of the one or more processors, a load effective instruction address of a load instruction and a store effective instruction address of a store instruction, the load instruction corresponding to the load operation and the store instruction corresponding to the store operation; and
including the load effective instruction address and the store effective instruction address in the endianness violation.

### Claim 11 (depends on 10)

The method of claim 10 further comprising:
correlating, by a code correlation system, the load effective instruction address to a first source code address corresponding to the load instruction; and
correlating, by the code correlation system, the store effective instruction address to a second source code address corresponding to the store instruction.

### Claim 12

A system comprising:
one or more hardware units;
one or more memories accessible by at least one of the one or more hardware units; and
endianness analyzer circuitry configured to:
locate a store real data address range that overlaps a load real data address range, wherein the store real data address range is included in store debug data generated in response to execution of a store operation, and wherein the load real data address range is included in load debug data generated in response to execution of a load operation;
determine that at least one endianness relevant load attribute corresponding to the load operation is different than at least one endianness relevant store attribute corresponding to the store operation; and
generate an endianness violation in response to the determination.

### Claim 13 (depends on 12)

The system of claim 12 wherein the endianness analyzer circuitry is further configured to:
retrieve a load size corresponding to the load operation and a store size corresponding to the store operation, the load size included in the one or more endianness relevant load attributes and the store size included in the one or more endianness relevant store attributes;
determine that the load size is different than the store size; and
perform the generation of the endianness violation in response to the determination that the load size is different than the store size.

### Claim 14 (depends on 13)

The system of claim 13 wherein the endianness analyzer circuitry is further configured to:
retrieve a load real data address corresponding to the load operation, the load real data address included in the one or more endianness relevant load attributes;
compute the load real data address range based upon the load real data address and the load size;
retrieve a store real data address corresponding to the store operation, the store real data address included in the one or more endianness relevant store attributes; and
compute the store real data address range utilizing the store real data address and the store size.

### Claim 15 (depends on 12)

The system of claim 12 wherein the endianness analyzer circuitry is further configured to:
obtain the store debug data from one of a plurality of hardware units over one of a plurality of debug channels prior to the locating of the store real data address range that overlaps the load real data address range;
extract a store effective data address from the store debug data;
translate the store effective data address to a store real data address using a shadow memory management unit, wherein the shadow memory management unit receives memory management unit update information over one or more of the plurality of debug channels; and
store the received store debug data and the store real data address in a lookup table entry.

### Claim 16 (depends on 12)

The system of claim 12 wherein the endianness analyzer circuitry is further configured to:
retrieve a first byte ordering type identifier corresponding to a first hardware unit that generates the store debug data, the first byte ordering type identifier included in the one or more endianness relevant store attributes;
retrieve a second byte ordering type identifier corresponding to a second hardware unit that generates the load debug data, the second byte ordering type identifier included in the one or more endianness relevant load attributes; and
generate the endianness violation in response to determining that the first byte ordering type identifier is different than the second byte ordering type identifier.

### Claim 17 (depends on 16)

The system of claim 16 wherein the first hardware unit and the second hardware unit are different hardware unit types selected from the group consisting of a processor core and a hardware accelerator.

### Claim 18 (depends on 16)

The system of claim 16 wherein the endianness analyzer circuitry is further configured to:
generate a first filter rule that filters out subsequent debug data corresponding to the first hardware unit and the store real data address range; and
generate a second filter rule that filters out the subsequent debug data corresponding to the second hardware unit and the store real data address range.

### Claim 19 (depends on 12)

The system of claim 12 wherein the endianness analyzer circuitry is further configured to:
determine a load effective instruction address of a load instruction and a store effective instruction address of a store instruction, the load instruction corresponding to the load operation and the store instruction corresponding to the store operation; and
include the load effective instruction address and the store effective instruction address in the endianness violation.

### Claim 20

A device comprising:
a plurality of hardware units;
a shared memory area accessible by one or more of the plurality of hardware units; and
an endianness violation detection sub-system, communicatively coupled to the plurality of hardware units by corresponding debug channels and configured to:
locate a store real data address range that overlaps a load real data address range, wherein the store real data address range is included in store debug data generated in response to execution of a store operation, and wherein the load real data address range is included in load debug data generated in response to execution of a load operation;
determine that at least one endianness relevant load attribute corresponding to the load operation is different than at least one endianness relevant store attribute corresponding to the store operation; and
generate an endianness violation, by at least one of the one or more processors, in response to the determination.
