# US 2014/0195217 A1 · Simulated input/output devices

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

- Number: US 2014/0195217 A1
- Document ID: US20140195217A1
- Status: Published application
- Kind: A1
- Application number: 13/737,927
- Filed: 2013-01-09
- Published: 2014-07-10
- Earliest claimed: 2013-01-09
- Assignees: Apple Inc.
- Applicants: Apple Inc.
- Inventors: Andrew D. MYRICK; John E. KELLEY
- Web page: https://patentgrep.com/patent/US20140195217A1

## CPC

- G06F 13/107: {Terminal emulation}
- G06F 13/385: {for adaptation of a particular data processing system to different peripheral devices}
- G06F 30/20: Design optimisation, verification or simulation (optimisation, verification or simulation of circuit designs G06F30/30)
- G06F 9/455: Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In one or more embodiments, methods and apparatus are provided for simulating device communications such as those of the Universal Serial Bus (“USB”) or the like. The methods and apparatus involve receiving host requests that represent commands in a communication protocol and are associated with communication endpoints, distributing the host requests across the communication endpoints in the order that they are received, to their associated endpoints to generate a distribution of requests, generating a reordered plurality of host requests by selecting the host requests from the communication endpoints in an order based upon the order in which the requests are received and one or more simulation factors, receiving device requests from a simulated device in accordance with the communication protocol, merging the reordered host requests and the plurality of device requests to form a merged sequence of requests, and performing commands from the merged sequence of requests in the order.

## Claims

### Claim 1

A method of simulating communication between devices, the method comprising:
receiving a plurality of host requests that represent commands in a communication protocol, wherein the plurality of host requests are associated with a plurality of communication endpoints;
distributing the plurality of host requests across the plurality of communication endpoints, wherein requests are distributed, in the order that they are received, to their associated endpoints to generate a distribution of requests;
generating a reordered plurality of host requests by selecting the plurality of host requests from the plurality of communication endpoints in an order based upon the order in which the requests are received and one or more simulation factors;
receiving a plurality of device requests from a simulated device that simulates a communication controller in accordance with the communication protocol;
merging the reordered plurality of host requests and the plurality of device requests to form a merged sequence of requests; and
performing commands from the merged sequence of requests in the order in which the requests occur in the merged sequence of requests, wherein the commands access state data that represents a simulated state of the simulated device.

### Claim 2 (depends on 1)

The method of claim 1, wherein merging comprises selecting the requests for the merged sequence of requests based on the order of requests in the reordered plurality of host requests and the individual requests from the plurality of controller requests are received.

### Claim 3 (depends on 1)

The method of claim 1, wherein the positions of host requests in the merged sequence are based upon times at which the host requests are selected from the communication endpoints, and the positions of device requests in the merged sequence are based upon times at which the device requests are generated by the simulated device.

### Claim 4 (depends on 1)

The method of claim 1, wherein distributing the plurality of host requests across the plurality of communication endpoints comprises:
retrieving, using a plurality of concurrent threads of execution, a plurality of host requests from a plurality of endpoint queues that correspond to the communication endpoints.

### Claim 5 (depends on 4)

The method of claim 4, wherein the simulation factors include the times at which the plurality of host requests are retrieved from the plurality of endpoint queues.

### Claim 6 (depends on 4)

The method of claim 4, wherein the host requests represent read or write transactions, and storing the plurality of host requests comprises:
splitting the host requests into smaller packets having sizes less or equal to a maximum packet size;
storing the packets corresponding to an individual host request in the first queue in sequence in an atomic operation.

### Claim 7 (depends on 4)

The method of claim 4, wherein merging the reordered plurality of host requests and the plurality of controller requests to form a merged sequence of requests comprises:
storing the reordered plurality of host requests and the plurality of controller requests in a second queue, wherein the second queue merges the reordered plurality of host requests and the plurality of controller requests to form the merged sequence of requests in the second queue.

### Claim 8 (depends on 1)

The method of claim 1, wherein the simulated state includes representations of registers and memory locations, and the commands read from or write to the registers and memory locations.

### Claim 9 (depends on 1)

The method of claim 1, wherein the simulation factors include which endpoints are capable of receiving data, and selecting the plurality of host requests from the plurality of communication endpoints comprises selecting only the endpoints that are capable of receiving data.

### Claim 10 (depends on 1)

The method of claim 1, wherein the host requests, commands, communication protocol, and communication endpoints are specific to the Universal Serial Bus (“USB”).

### Claim 11

A system comprising:
a processor:
a memory storing computer executable instructions that when executed by the processor cause the processor to:
retrieve, using a plurality of concurrent threads of execution, a plurality of host requests from a plurality of endpoint queues that correspond to communication endpoints;
store the retrieved plurality of host requests in a first queue to form a reordered sequence of host requests;
receive a sequence of controller requests from a simulated device that simulates a communication controller in accordance with a communication protocol;
store the reordered sequence of host requests and the sequence of controller requests in a second queue, wherein the second queue merges the reordered sequence of host requests and the sequence of controller requests to form a merged sequence of requests; and
perform commands represented by the merged sequence of requests in sequential order, wherein the commands access data that represents the state of the simulated device.

### Claim 12 (depends on 11)

The system of claim 11, wherein the processor is further configured to:
receive a plurality of host requests from a host system, the host requests indicating communication commands to be performed;
store the plurality of host requests in a queue;
retrieve, using a thread, the plurality of host requests from the queue; and
store, using the thread, the plurality of host requests in the plurality of endpoint queues, wherein individual host requests from the plurality of host requests are stored in queues that correspond to endpoints associated with the individual host requests.

### Claim 13 (depends on 11)

The system of claim 11, wherein the positions of host requests in the merged sequence are based upon times at which the host requests are selected from the plurality of endpoint queues, and the positions of controller requests in the merged sequence are based upon times at which the controller requests are generated by the simulated device.

### Claim 14 (depends on 11)

The system of claim 11, wherein the processor is further configured to
determine whether any endpoints in the plurality of communication endpoints are available,
wherein the processor is further configured to retrieve only host requests that correspond to available communication endpoints.

### Claim 15 (depends on 14)

The system of claim 14, wherein to determine whether any endpoints are available, the processor is further configured to:
query the hardware simulator to determine if it is capable of receiving a transaction on an endpoint;
determine available endpoints based upon a response from the hardware simulator;

### Claim 16

A system comprising:
a simulation computer system including a simulated communication controller and simulated hardware model, and a remote simulator interface; and
a host computer system including a remote daemon process that communicates with a simulated communication interface device driver that communicates with an operating system of the host computer,
wherein the remote simulator interface sends output of the simulated communication controller via a network to the remote daemon process on the host computer system,
the remote daemon process sends the output of the simulated communication controller to the device driver, and
the device driver translates the output to transactions of a communication protocol and sends the transactions to the operating system of the host computer.

### Claim 17

A system comprising:
a processor configured to:
receive, at a host machine, one or more transactions from a host operating system;
translate the one or more transactions to commands using a virtual device driver that communicates with the host operating system and appears to the host operating system as a device driver;
receive, at a remote daemon process, the commands;
forward, using the remote daemon process, the commands to a remote interface server process;
translate, using the remote interface server process, the commands to register read and write operations;
execute a hardware simulator that simulates operation of a device, including a simulated controller and simulated registers; and
perform the register read and write operations on the simulated registers in the simulated controller, wherein the read and write operations simulate the transactions from the host operating system.

### Claim 18 (depends on 17)

The system of claim 17, wherein the transactions, commands, device driver, daemon process, interface server process, simulated registers, and simulated controller are specific to the Universal Serial Bus (“USB”).

### Claim 19

A system comprising:
a processor configured to:
execute a hardware simulator that simulates operation of a device, including a simulated controller and simulated registers;
receive one or more read and write operations at a remote interface server from a simulated controller, the read and write operations referencing the simulated registers;
translate, at the remote interface server, the read and write operations to commands;
send the commands from the remote interface server to a remote daemon process via network communication;
receive the commands at the remote daemon process;
send the commands from the remote daemon process to a virtual device driver that communicates with the a operating system;
receive, using a simulator server process at a host machine, commands from a remote simulator interface;
translate the commands received from the remote simulator interface to transactions; and
provide the transactions to a host operating system via a device driver, wherein the host processes the transactions, and the transactions are based on the read and write operations generated by the simulated controller.

### Claim 20 (depends on 19)

The system of claim 19, wherein the transactions, commands, device driver, daemon process, interface server process, simulated registers, and simulated controller are specific to the Universal Serial Bus (“USB”).
