# US 11,119,921 B1 · State machine generation for multi-buffer electronic systems

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

- Number: US 11,119,921 B1
- Document ID: US11119921B1
- Status: Granted
- Kind: B1
- Application number: 17/001,252
- Filed: 2020-08-24
- Granted: 2021-09-14
- Earliest claimed: 2020-08-24
- Assignees: Xilinx, Inc.
- Applicants: Xilinx, Inc.
- Inventors: Uday M. Hegde
- Web page: https://patentgrep.com/patent/US11119921B1

## CPC

- G06F 5/16: Multiplexed systems, i.e. using two or more similar devices which are alternately accessed for enqueue and dequeue operations, e.g. ping-pong buffers
- G06F 12/0806: Multiuser, multiprocessor or multiprocessing cache systems
- G06F 9/544: {Buffers; Shared memory; Pipes}
- G06F 2212/1008: Correctness of operation, e.g. memory ordering
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

State machine generation for a multi-buffer electronic system can include receiving, using a processor, a user input specifying a reader policy and a number of a plurality of buffers used by a reader and a writer of the multi-buffer electronic system. A state machine can be generated as a data structure. The state machine has a plurality of states determined based on the number of the plurality of buffers and the reader policy. The state machine allocates different buffers of the plurality of buffers to the reader in temporally accurate order over time. Each state can specify an allocation from the plurality of buffers to the reader and the writer. A state machine description including one or more program code components can be generated, where the one or more program components may be used in an implementation of the reader and an implementation of the writer.

## Claims

### Claim 1

A method, comprising:
receiving, using a processor, a user input specifying a reader policy and a number of a plurality of buffers used by a reader and a writer of a multi-buffer electronic system;
generating, using the processor, a state machine data structure, wherein the state machine has a plurality of states determined based on the number of the plurality of buffers and the reader policy, wherein the state machine allocates different buffers of the plurality of buffers to the reader in temporally accurate order over time, and each state specifies an allocation from the plurality of buffers to the reader and the writer; and
generating, using the processor, a state machine description including one or more program code components for use in an implementation of the reader and an implementation of the writer.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
in response to determining that the reader policy is a newest available policy and that the number of the plurality of buffers is greater than three, generating a notification indicating that the number of the plurality of buffers is incompatible with the newest available policy.

### Claim 3 (depends on 1)

The method of claim 1, wherein the determining the state machine comprises:
adding an initial state of the state machine to a list of states stored in a memory;
for each state on the list of states:
determining a first next state corresponding to a buffer request from the reader and adding the first next state to the list of states in response to determining that the first next state is new; and
determining a second next state corresponding to a buffer request from the writer and adding the second next state to the list of states in response to determining that the second next state is new.

### Claim 4 (depends on 1)

The method of claim 1, wherein the determining the state machine comprises:
for a buffer request from the reader, generating, from a current state, a next state by, in response to determining that one or more of the plurality of buffers are waiting buffers in the current state, designating a temporally earliest of the one or more waiting buffers as a reading buffer for the next state and designating a reading buffer for the current state as a free buffer for the next state.

### Claim 5 (depends on 1)

The method of claim 1, wherein the determining the state machine comprises:
for a buffer request from the writer using a newest available policy, generating, from a current state, a next state by designating a writer buffer for the current state as a waiting buffer for the next state, and wherein each state includes at most one waiting buffer.

### Claim 6 (depends on 5)

The method of claim 5, wherein the generating the next state comprises:
in response to determining that a free buffer exists for the current state, designating the free buffer for the current state as a writer buffer for the next state; or
in response to determining that no free buffer exists for the current state, designating a waiting buffer for the current state as the writer buffer for the next state.

### Claim 7 (depends on 1)

The method of claim 1, wherein the determining the state machine comprises:
for a buffer request from the writer using an oldest available policy, generating, from a current state, a next state by adding a writer buffer for the current state as a waiting buffer for the next state, and wherein each state includes at most N−1 waiting buffers where N is the number of the plurality of buffers.

### Claim 8 (depends on 7)

The method of claim 7, wherein the generating the next state comprises:
in response to determining that a free buffer exists for the current state, designating the free buffer as a writer buffer for the next state; or
in response to determining that a free buffer does not exist for the current state, keeping the writer buffer for the current state as the writer buffer for the next state.

### Claim 9 (depends on 1)

The method of claim 1, wherein the one or more program code components include one or more high-level programming language components or one or more hardware description language components.

### Claim 10 (depends on 9)

The method of claim 9, wherein the one or more high-level programming language components are implemented using switch statements.

### Claim 11

A system, comprising:
a processor configured to initiate operations including:
receiving a user input specifying a reader policy and a number of a plurality of buffers used by a reader and a writer of a multi-buffer electronic system;
generating a state machine data structure, wherein the state machine has a plurality of states determined based on the number of the plurality of buffers and the reader policy, wherein the state machine allocates different buffers of the plurality of buffers to the reader in temporally accurate order over time, and each state specifies an allocation from the plurality of buffers to the reader and the writer; and
generating a state machine description including one or more program code components for use in an implementation of the reader and an implementation of the writer.

### Claim 12 (depends on 11)

The system of claim 11, wherein the processor is configured to initiate operations including:
in response to determining that the reader policy is a newest available policy and that the number of the plurality of buffers is greater than three, generating a notification indicating that the number of the plurality of buffers is incompatible with the newest available policy.

### Claim 13 (depends on 11)

The system of claim 11, wherein the determining the state machine comprises:
adding an initial state of the state machine to a list of states stored in a memory;
for each state on the list of states:
determining a first next state corresponding to a buffer request from the reader and adding the first next state to the list of states in response to determining that the first next state is new; and
determining a second next state corresponding to a buffer request from the writer and adding the second next state to the list of states in response to determining that the second next state is new.

### Claim 14 (depends on 11)

The system of claim 11, wherein the determining the state machine comprises:
for a buffer request from the reader, generating, from a current state, a next state by, in response to determining that one or more of the plurality of buffers are waiting buffers in the current state, designating a temporally earliest of the one or more waiting buffers as a reading buffer for the next state and designating a reading buffer for the current state as a free buffer for the next state.

### Claim 15 (depends on 11)

The system of claim 11, wherein the determining the state machine comprises:
for a buffer request from the writer using a newest available policy, generating, from a current state, a next state by designating a writer buffer for the current state as a waiting buffer for the next state, and wherein each state includes at most one waiting buffer.

### Claim 16 (depends on 15)

The system of claim 15, wherein the generating the next state comprises:
in response to determining that a free buffer exists for the current state, designating the free buffer for the current state as a writer buffer for the next state; or
in response to determining that no free buffer exists for the current state, designating a waiting buffer for the current state as the writer buffer for the next state.

### Claim 17 (depends on 11)

The system of claim 11, wherein the determining the state machine comprises:
for a buffer request from the writer with an oldest available policy, generating, from a current state, a next state by, adding a writer buffer for the current state as a waiting buffer for the next state, and wherein each state includes at most N−1 waiting buffers where N is the number of the plurality of buffers.

### Claim 18 (depends on 17)

The system of claim 17, wherein the generating the next state comprises:
in response to determining that a free buffer exists for the current state, designating the free buffer as a writer buffer for the next state; or
in response to determining that a free buffer does not exist for the current state, keeping the writer buffer for the current state as the writer buffer for the next state.

### Claim 19 (depends on 11)

The system of claim 11, wherein the one or more program code components include one or more high-level programming language components or one or more hardware description language components; and
wherein the one or more high-level programming language components are implemented using switch statements.

### Claim 20

A computer program product, comprising:
one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media, wherein the program instructions are executable by computer hardware to initiate operations including:
receiving a user input specifying a reader policy and a number of a plurality of buffers used by a reader and a writer of a multi-buffer electronic system;
generating a state machine data structure, wherein the state machine has a plurality of states determined based on the number of the plurality of buffers and the reader policy, wherein the state machine allocates different buffers of the plurality of buffers to the reader in temporally accurate order over time, and each state specifies an allocation from the plurality of buffers to the reader and the writer; and
generating a state machine description including one or more program code components for use in an implementation of the reader and an implementation of the writer.
