IP Library Patent Application 18947041
Patent Application
App. No. 18/947,041

METHOD FOR GENERATING SOURCE CODE

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 None
App. No.
18/947,041
Abstract

A method for generating source code includes: transforming, by a computing device, a block diagram into an intermediate representation; successively optimizing, by the computing device, the intermediate representation; and translating, by the computing device, the optimized intermediate representation into source code. Transforming a block comprises creating a reference to a block output variable. Creating the reference to the block output comprises: detecting at least two parallel control flow branches which read or write a variable; identifying an operation that accesses the variable; checking whether a cost criterion is satisfied; and reproducing the operation in the at least two parallel control flow branches based on the cost criterion being satisfied. Reproducing the operation comprises shifting the operation from an original position to positions where the variable is read or written.

Claims (48)

1 . A method for generating source code from one or more blocks of a block diagram that comprises at least two blocks and at least one signal link between the at least two blocks, the method comprising:

transforming, by a computing device, the block diagram into an intermediate representation;

successively optimizing, by the computing device, the intermediate representation; and

translating, by the computing device, the optimized intermediate representation into source code;

wherein transforming the block diagram into the intermediate representation comprises transforming a block, wherein transforming the block comprises creating a reference to a block output variable, and wherein creating the reference to the block output comprises:

detecting at least two parallel control flow branches which read or write a variable;

identifying an operation that accesses the variable;

checking whether a cost criterion is satisfied; and

reproducing the operation in the at least two parallel control flow branches based on the cost criterion being satisfied, wherein reproducing the operation comprises shifting the operation from an original position to positions where the variable is read or written.

2 . The method according to claim 1 , wherein a backward propagation and/or a forward propagation is/are performed, wherein, in the backward propagation, the variable is an input variable of the operation and reproducing the operation comprises a shift in the source code upstream of the original position, and wherein, in the forward propagation, the variable is an output variable of the operation and reproducing the operation comprises a shift in the source code downstream of the original position.

3 . The method according to claim 2 , wherein the cost criterion is satisfied without any further verification based on the operation being a function call having fewer parameters than a predetermined threshold value and, additionally, one of the following conditions is met:

in the case of the forward propagation, at least one control flow branch is independent of the variables and/or the variable is a multi-component variable, or

in the case of the backward propagation, the variable is a multi-component variable.

4 . The method according to claim 1 , wherein the cost criterion takes into account:

the increase in code size; and

a decrease in stack usage and/or a potential decrease in runtime.

5 . The method according to claim 4 , wherein the increase in code size is determined on the basis of the number of parallel control flow branches that access the variable, and/or a measure of the complexity of the operation.

6 . The method according to claim 4 , wherein the decrease in stack usage and/or the potential decrease in runtime is determined on the basis of:

the number of parallel control flow branches that do not access the variable, and

the storage requirements and/or a dimension of the variable.

7 . The method according to claim 1 , wherein the operation comprises a function call and/or a calculation using elements of a multi-component variable.

8 . The method according to claim 1 , further comprising:

applying at least one further optimization to the intermediate representation.

9 . The method according to claim 8 , wherein the cost criterion comprises an assessment of the changes in runtime, stack usage, and/or code size that are caused by the at least one further optimization.

10 . A method for configuring a control device comprising at least one arithmetic logic unit, the method comprising:

inputting a block diagram;

generating source code from one or more blocks of the block diagram that comprises at least two blocks and at least one signal link between the at least two blocks;

compiling the source code for the at least one arithmetic logic unit such that executable code is generated;

transmitting the executable code to the control device; and

storing the executable code in a non-volatile memory of the control device and/or executing the executable code by the at least one arithmetic logic unit of the control device;

wherein generating the source code comprises:

transforming the block diagram into an intermediate representation;

successively optimizing the intermediate representation; and

translating the optimized intermediate representation into source code;

wherein transforming the block diagram into the intermediate representation comprises transforming a block, wherein transforming the block comprises creating a reference to a block output variable, and wherein creating the reference to the block output comprises:

detecting at least two parallel control flow branches which read or write a variable;

identifying an operation that accesses the variable;

checking whether a cost criterion is satisfied; and

reproducing the operation in the at least two parallel control flow branches based on the cost criterion being satisfied, wherein reproducing the operation comprises shifting the operation from an original position to positions where the variable is read or written.

11 . A non-transitory computer-readable medium having processor-executable instructions stored thereon for generating source code from one or more blocks of a block diagram that comprises at least two blocks and at least one signal link between the at least two blocks, wherein the processor-executable instructions, when executed, facilitate performance of the following:

transforming the block diagram into an intermediate representation;

successively optimizing the intermediate representation; and

translating the optimized intermediate representation into source code;

wherein transforming the block diagram into the intermediate representation comprises transforming a block, wherein transforming the block comprises creating a reference to a block output variable, and wherein creating the reference to the block output comprises:

detecting at least two parallel control flow branches which read or write a variable;

identifying an operation that accesses the variable;

checking whether a cost criterion is satisfied; and

reproducing the operation in the at least two parallel control flow branches based on the cost criterion being satisfied, wherein reproducing the operation comprises shifting the operation from an original position to positions where the variable is read or written.

Assignments (2)
CHANGE OF NAME Recorded May 22, 2026
From: DSPACE GMBH
To: DSPACE SE & CO. KG
Reel/Frame 075622/0216 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 14, 2024
From: MAIR, MICHAEL; GAYK, FLORIAN
To: DSPACE GMBH
Reel/Frame 069255/0962 →