Rate grouping during code generation for multi-rate models
AssigneeThe MathWorks, Inc.
InventorsMatthew Englehart, John E. Ciolfi
Life of this patent
Estimating the term…
Abstract
A method is provided for generating code in a block diagram environment. The method for generating code eliminates a need to use logical predicates to identify an invoking rate of a portion of a block in the block diagram environment. This eliminates the need for contiguous sets of conditional code statements in the generated code.
Claims26
A method implemented in an electronic device that provides a block diagram environment, the method comprising:
- providing a block diagram representing a multi-rate dynamic system, the block diagram having a plurality of systems, wherein a first group of systems process data at a first rate and a second group of systems process data at a second rate;
- generating a first set of functions, the first set of functions being associated with the first group of systems to invoke said first group of systems implicitly therefrom;
- storing the first set of functions in a storage device;
- generating a second set of functions, the second set of functions being associated with the second group of systems to invoke said second group of systems implicitly therefrom;
- and
- storing the second set of functions in the storage device.
A method implemented in an electronic device that provides a block diagram environment, the method comprising:
- providing a block diagram representing a multi-rate dynamic system, the block diagram including a block having functions defined in a mechanism outside of the block diagram;
- identifying portions of the block by a rate of operation;
- grouping code for the block into a plurality of functions, wherein there exists at least one function for each portion of the block identified;
- and
- storing the grouped code in a storage device.
A method implemented in an electronic device that provides a block diagram environment, the method comprising:
- providing a block representing an elemental multi-rate dynamic system, the block having two or more components that execute at different rates;
- separating generated code for the block into two or more sets of code statements, with one set of code statements for each rate;
- associating each of the sets of code statements with a corresponding one of the components of the block, and
- storing each of the sets of code statements in a storage device.
A method implemented in an electronic device providing a block diagram environment, for generating code from a multi-rate block diagram model representing a multi-rate dynamic system, the multi-rate block diagram having one or more sub-systems that include an elementary block having two-or more operating rates, the multi-rate block diagram model performing a plurality of operations at a plurality of operating rates, the method comprising:
- identifying the plurality of operating rates contained in the multi-rate block diagram model, wherein each block in the multi-rate block diagram model has one or more operating rates and each of the plurality of identified operating rates indicates a rate of an associated operation of one of the blocks in the multi-rate block diagram model;
- generating code from the multi-rate block diagram model, the generated code having one function for each identified operating rate, wherein each of the functions provides implicit identification of one of the identified plurality of operating rates per groups of blocks in the multi-rate block diagram model;
- generating code from the multi-rate block diagram model for the one or more sub-systems, the generated code having a sub-function corresponding to a selected one of the plurality of identified operating rates for the elementary blocks in the sub-systems and relate to the function for the selected operating rate, wherein the sub-function provides implicit identification of the selected operating rate per a subsystem of the groups of blocks;
- and
- storing the generated code in a storage device.
A computer readable medium holding computer executable instructions, that when executed by a processor, generates code from a multi-rate block diagram model representing a multi-rate dynamic system, the multi-rate block diagram model having one or more sub-systems that include an elementary block having two or more operating rates, the multi-rate block diagram model performing a plurality of operations at a plurality of operating rates, the medium comprising:
- instructions for determining from the multi-rate block diagram model the plurality of operating rates contained in the multi-rate block diagram model, wherein each block in the multi-rate block diagram model has one or more operating rates and each of the plurality of operating rates indicate a rate of an associated operation of one of the blocks in the multi-rate block diagram model;
- and
- instructions for generating code from the multi-rate block diagram model, the generated code having one function for each of the plurality of operating rates, wherein each of the functions provides implicit identification of one of the plurality of operating rates per groups of blocks in the multi-rate block diagram model;
- instructions for generating code from the multi-rate block diagram model for the one or more sub-systems, the generated code having a sub-function corresponding to a selected one of the plurality of identified operating rates for the elementary blocks in the sub-systems and relate to the function for the selected operating rate, wherein the sub-function provides implicit identification of the selected operating rate per a subsystem of the groups of blocks;
- and
- instructions for storing the generated code in a storage device.
A computer readable medium holding computer readable instructions, that when executed by a processor, generate functions associated with a multi-rate dynamic system, said medium comprising:
- instructions for identifying from a block diagram representing a multi-rate dynamic system, a plurality of systems, wherein a first group of systems process data at a first rate and a second group of systems process data at a second rate;
- instructions for generating a first set of functions, the first set of functions being associated with the first group of systems to invoke said first group of systems implicitly therefrom;
- instructions for storing the first set of functions in a storage device;
- instructions for generating a second set of functions, the second set of functions being associated with the second group of systems to invoke said second group of systems implicitly therefrom;
- and
- instructions for storing the second set of functions in the storage device.
A computer readable medium holding computer executable instructions, that when executed by a processor, generate instructions for a multi-rate dynamic system, said medium comprising:
- instructions for importing into a block diagram representing a multi-rate dynamic system, a block having functions defined in a mechanism outside of the block diagram;
- instructions for identifying portions of the block by a rate of operation;
- instructions for grouping code for the block into a plurality of functions, wherein there exists at least one function for each portion of the block identified;
- and
- instructions for storing the grouped code in a storage device.
A computer readable medium holding computer executable instructions, that when executed by a processor, generate instructions associated with a multi-rate dynamic system, said medium comprising:
- instructions for selecting a block representing an elemental multi-rate dynamic system, the block having two or more components that execute at different rates;
- instructions for separating generated code for the block into two or more sets of code statements, with one set of code statements for each rate;
- instructions for associating each of the sets of code statements with a corresponding one of the components of the block;
- and
- instructions for storing each of the sets of code statements in a storage device.
Dependencies are inferred from the claim text.