# US 10,310,822 B1 · Method and system for simulating a control program

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

- Number: US 10,310,822 B1
- Document ID: US10310822B1
- Status: Granted
- Kind: B1
- Application number: 15/827,196
- Filed: 2017-11-30
- Published: 2019-05-30
- Granted: 2019-06-04
- Earliest claimed: 2017-11-30
- Assignees: dSPACE digital signal processing and control engineering GmbH
- Applicants: dSPACE digital signal processing and control engineering GmbH
- Inventors: Renata Hein; Wolfgang Trautmann; Sebastian Hillebrand
- Web page: https://patentgrep.com/patent/US10310822B1

## CPC

- G06F 8/34: Graphical or visual programming
- G06F 8/33: Intelligent editors
- G06F 8/35: model driven
- G06F 8/41: Compilation
- G06F 11/00: Error detection; Error correction; Monitoring (error detection, correction or monitoring in information storage based on relative movement between record carrier and transducer G11B20/18; monitoring, i.e. supervising the progress of recording or reproducing G11B27/36; in static stores G11C29/00)
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 30/15: Vehicle, aircraft or watercraft design
- G06F 30/20: Design optimisation, verification or simulation (optimisation, verification or simulation of circuit designs G06F30/30)
- G06F 8/71: Version control (security arrangements therefor G06F21/57); Configuration management
- G06F 11/3636: {by tracing the execution of the program}
- G06F 11/3696: {Methods or tools to render software testable}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method for simulating a program modeled as one or more blocks of a block diagram in a technical computing environment. A block diagram is opened in a model editor. Source code is generated for the one or more blocks of the block diagram using the code generator. The program is configured from the source code using a predefined compiler in order to generate a binary executable file, and the program is simulated, which comprises running at least one function in the auxiliary file in order to determine at least the width of a basic data type corresponding to the enumeration variable in the binary executable file, and allocating one or more variables based on the determined byte width in order to log the simulation results.

## Claims

### Claim 1

A method for simulating a program, the program being modeled as one or more blocks of a block diagram in a technical computing environment, the one or more blocks comprising at least one signal or parameter that is marked as an enumeration, the technical computing environment comprising a model editor, a data definition tool and a code generator, the method being executed by at least one processor of a host computer, the method comprising:
opening the block diagram in the model editor;
generating source code for the one or more blocks of the block diagram using the code generator, including converting the at least one signal or parameter to an enumeration variable in the source code;
storing information on the source code in the data definition tool, the information comprising the defined type of the enumeration variable in the source code;
building the program from the source code using a predefined compiler in order to generate a binary executable file;
generating an auxiliary file based on the information in the data definition tool, wherein the auxiliary file is built to be a standalone binary executable file or integrated into the binary executable file of the program; and
initializing a simulation by running at least one function in the auxiliary file in order to determine at least a width of a basic data type corresponding to the enumeration variable in the binary executable file, and allocating one or more variables based on the determined byte width.

### Claim 2 (depends on 1)

The method of claim 1, wherein determining the byte width comprises determining whether the basic data type is signed or unsigned.

### Claim 3 (depends on 1)

The method of claim 1, further comprising: storing information on the determined byte width, the determined basic data type or both in the data definition tool.

### Claim 4 (depends on 1)

The method of claim 1, wherein simulating the program comprises:
executing the built program on the host computer;
logging or extracting the values of one or more of the variables of the program during execution, including at least one enumeration variable; and
displaying on a display or storing in a memory the logged simulation results.

### Claim 5 (depends on 1)

The method of claim 1, wherein the predefined compiler is adapted to generate instruction for a target processor differing from the processor of the host computer, wherein an embedded system comprising a target processor is connected to the host computer, wherein simulating the program comprises:
transferring the binary executable file to the embedded system;
running the binary executable file on the target processor;
logging or extracting the values of one or more of the variables of the program during execution, including at least one enumeration variable; and
storing or displaying the logged values on the host computer.

### Claim 6 (depends on 1)

The method of claim 1, wherein the enumeration variable is part of a structured variable, further comprising:
determining address values for accessing the different components of the structured variable, and
storing the address values in the data definition tool.

### Claim 7 (depends on 1)

A non-transitory computer readable medium containing instructions that, when executed by a microprocessor of a computer system, cause the computer system to carry out the method according to claim 1.

### Claim 8 (depends on 1)

A computer system comprising a host computer, the host computer comprising a microprocessor, a random access memory, a graphics controller connected to a display, a serial interface connected to at least one human input device, and a nonvolatile memory, a hard disk or solid state disk, the nonvolatile memory comprising instructions that, when executed by the microprocessor, causes the computer system to carry out the method according to claim 1.

### Claim 9 (depends on 8)

The computer system of claim 8, further comprising an embedded system connected to the host computer, the embedded system comprising a target processor.

### Claim 10

A method for generating source code for a program, the program being modeled as one or more blocks of a block diagram in a technical computing environment, the one or more blocks of the model comprising at least one signal or parameter that is marked as an enumeration, the technical computing environment comprising a model editor, a data definition tool and a code generator, the method being executed by at least one processor of a host computer, the method comprising:
opening the block diagram in the model editor;
generating source code for the one or more blocks of the block diagram using the code generator, including converting the at least one signal or parameter to an enumeration variable in the source code;
storing information on the source code in the data definition tool, the information comprising the defined type of the enumeration variable in the source code;
building the program from the source code using a predefined compiler in order to generate a binary executable file;
generating an auxiliary file based on the information in the data definition tool, wherein the auxiliary file is built to be a standalone executable or integrated into the binary executable file of the program;
initializing a simulation by transferring the binary executable file to the embedded system and running at least one function in the auxiliary file in order to determine the width of the basic data type corresponding to the enumeration variable in the binary executable file;
storing information on the enumeration variable in the data definition tool, comprising the determined byte width or a determined basic data type or both;
simulating the program by running the binary executable file on the target processor;
receiving user input indicating that a variable description file is to be generated; and
generating a variable description file for the program, the variable description file comprising information on the enumeration variable, wherein at least the determined byte width or the determined basic data type is retrieved from the data definition tool.

### Claim 11 (depends on 10)

The method of claim 10, wherein the enumeration variable is part of a structured variable, further comprising:
determining address offset values for accessing the different components of the structured variable; and
storing the address offset values in the variable description file.

### Claim 12 (depends on 10)

The method of claim 10, wherein the at least one function in the auxiliary file is executed when initializing the simulation.

### Claim 13 (depends on 10)

The method of claim 10, wherein determining the byte width comprises determining whether the basic data type is signed or unsigned.

### Claim 14 (depends on 13)

The method of claim 13, wherein storing information on the enumeration variable in the data definition tool comprises storing if the basic data type is signed, an identifier of the determined basic data type or both in the data definition tool.

### Claim 15

A method for simulating a program, the program being modeled as one or more blocks of a block diagram in a technical computing environment, the one or more blocks comprising at least one structured signal or parameter that comprises multiple components, the technical computing environment comprising a model editor, a data definition tool and a code generator, the method being executed by at least one processor of a host computer, comprising:
opening the block diagram in the model editor;
generating source code for the one or more blocks of the block diagram using the code generator, including converting the at least one signal or parameter to a structured variable in the source code;
storing information on the source code in the data definition tool, the information comprising the names of the components of the structured variable in the source code;
building the program from the source code using a predefined compiler in order to generate a binary executable file;
generating an auxiliary file based on the information in the data definition tool, wherein the auxiliary file is built to be a standalone binary executable file or integrated into the binary executable file of the program;
initializing a simulation by running at least one function in the auxiliary file in order to determine address offset values for the components of the structured variable in the binary executable file; and
simulating the program, including accessing at least one component of the structured variable.

### Claim 16

A method for generating source code for a program, the program being modeled as one or more blocks of a block diagram in a technical computing environment, the one or more blocks of the model comprising at least one structured signal or parameter that comprises multiple components, the technical computing environment comprising a model editor, a data definition tool and a code generator, the method being executed by at least one processor of a host computer, comprising:
opening the block diagram in the model editor;
generating source code for the one or more blocks of the block diagram using the code generator, including converting the at least one signal or parameter to a structured variable in the source code;
storing information on the source code in the data definition tool, the information comprising the names of the components of the structured variable in the source code;
building the program from the source code using a predefined compiler in order to generate a binary executable file;
generating an auxiliary file based on the information in the data definition tool, wherein the auxiliary file is built to be a standalone executable or integrated into the binary executable file of the program;
initializing a simulation by transferring the binary executable file to the embedded system, running at least one function in the auxiliary file in order to determine address offset values for the components of the structured variable in the binary executable file;
storing information on the structured variable in the data definition tool, comprising the determined address offset values of the components;
simulating the program by running the binary executable file on the target processor;
receiving user input indicating that a variable description file is to be generated; and
generating a variable description file for the program, the variable description file comprising information on the structured variable, wherein at least the address offsets of the components are retrieved from the data definition tool.
