IP Library Granted Patent US 11,403,077
Granted Patent B2
US 11,403,077 · App. 16/983,462 · Granted Aug 2, 2022

Method and system for preparing block diagrams for code generation

Inventors: Johannes Scherle (Calw, DE); Anders Johansson (Stuttgart, DE); Olaf Grajetzky (Paderborn, DE)
Assignee: dSPACE GmbH
G06F8/35G06F8/34G06F8/36
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,403,077
App. No.
16/983,462
Granted
Aug 2, 2022
Kind
B2
Abstract

A method for preparing block diagrams having one or more blocks for code generation in a computing environment comprising a model editor, a data definition tool and a code generator. The block diagram is opened in the model editor, wherein a first block is a hierarchical block comprising a plurality of subordinate blocks, at least one input port and at least one output port connected by signals. Minimum values and maximum values are received for the input and output ports, determining scaling parameters for the input and output ports based on the received minimum and maximum values. Scaling parameters are determined for each subordinate block in the first block, wherein the scaling parameters of at least one subordinate block are determined based on the scaling parameters of at least one output port. Also, a method for generating program code, a non-transitory computer readable medium and a computer system are provided.

Claims (33)

1. A method for preparing a block diagram comprising one or more blocks for code generation in a technical computing environment, the technical computing environment comprising a model editor, a data definition tool, and a code generator, the technical computing environment being executed by at least one processor of a host computer, the method comprising:

opening the block diagram in the model editor, wherein a first block is a hierarchical block comprising a plurality of subordinate blocks, at least one input port and at least one output port, wherein signals connect the at least one input port, the subordinate blocks and the at least one output port;

receiving minimum values and maximum values for the at least one input port and the at least one output port;

determining scaling parameters for the at least one input port and the at least one output port based on the received minimum and maximum values;

determining scaling parameters for at least one subordinate block in the first block, wherein the scaling parameters of the at least one subordinate block are determined based on the scaling parameters of at least one output port of the at least one output ports;

verifying if at least one scaling condition is fulfilled for the at least one subordinate block;

generating a warning to a user based on predefined scaling conditions; and

generating production code based on the block diagram and the scaling parameters,

wherein the at least one scaling condition is not fulfilled if a range of values for an internal signal of non-Boolean type comprises less than three possible values.

2. The method of claim 1 , wherein the scaling parameters for subordinate blocks are determined iteratively, and wherein an order of preparing subordinate blocks is predefined for the first block.

3. The method of claim 2 , wherein the first block is a library block and wherein the library block comprises an executable script for scaling the first block and/or a dedicated definition document.

4. The method of claim 2 , wherein the minimum and the maximum values for the at least one input port and the at least one output port are stored in the data definition tool, and wherein the scaling parameters are determined based on the stored values.

5. The method of claim 1 , further comprising outputting a suggestion for changing the maximum value, the minimum value or the scaling parameters of the at least one input port or of the at least one output port.

6. The method of claim 1 , wherein the scaling parameters for each subordinate block are determined based on the scaling parameters of adjacent blocks or the input ports or the output ports upstream of the subordinate block.

7. The method of claim 1 , wherein the scaling parameters comprise a data type, a least significant bit and an offset.

8. The method of claim 1 , wherein the scaling parameters for atomic blocks are stored in and retrieved from the data definition tool.

9. The method of claim 1 , further comprising: executing the block diagram including the first block, the at least one subordinate block, and signal paths in a simulation engine of the technical computing environment of the host computer.

10. A method for generating source code based on a block diagram, comprising one or more blocks, in a technical computing environment, the technical computing environment comprising a model editor, a data definition tool, a simulation engine, and a code generator, the technical computing environment being executed by at least one processor of a host computer, the method comprising:

opening the block diagram in a model editor, wherein a first block is a hierarchical block comprising a plurality of subordinate blocks, at least one input port and at least one output port, wherein signals connect the at least one input port, the subordinate blocks and the at least one output port;

receiving minimum values and maximum values for the at least one input port and the at least one output port;

determining scaling parameters for the at least one input port and the at least one output port based on the received minimum and maximum values;

determining scaling parameters for at least one subordinate block in the first block, wherein the scaling parameters of the at least one subordinate block are determined based on the scaling parameters of at least one output port of the at least one output ports;

verifying if at least one scaling condition is fulfilled for the at least one subordinate block;

generating a warning to a user based on predefined scaling conditions; retrieving additional code generation settings from a data definition tool; and

generating production code based on a scaled block diagram and the additional code generation settings,

wherein the at least one scaling condition is not fulfilled if a range of values for an internal signal of non-Boolean type comprises less than three possible values.

11. 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 a method according to claim 10 .

12. A computer system comprising a 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 and/or a solid state disk, the nonvolatile memory comprising instructions that, when executed by the microprocessor, cause the computer system to carry out the method according to claim 1 .

Assignments (2)
CHANGE OF NAME Recorded Dec 21, 2022
From: DSPACE DIGITAL SIGNAL PROCESSING AND CONTROL ENGINEERING GMBH
To: DSPACE GMBH
Reel/Frame 062202/0014 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 27, 2020
From: SCHERLE, JOHANNES; JOHANSSON, ANDERS; GRAJETZKY, OLAF
To: DSPACE GMBH
Reel/Frame 054183/0144 →
Priority Claims (1)
DE 10 2019 120 829.7 · Aug 1, 2019 · national
Continuity (1)
Related Publication 20210034337A1 · Feb 4, 2021