Systems and methods for sharing resources having different data types
First Claim
Patent Images
1. A method comprising:
- storing, in a memory, at least a portion of an executable source model having a plurality of model elements;
identifying, by a processor coupled to the memory, first and second model elements that implement a same computation, functionality, or operation with each other, where a first input to the first model element is associated with a first fixed point data type and a second input to the second model element is associated with a second fixed point data type that is different than the first fixed point data types;
modifying, by the processor, the at least a portion of the executable source model byconverting the first fixed point data type associated with the first input to the first model element to a new fixed point data type, wherein the converting includes at least one of;
changing a fraction length of at least one of the first fixed point data type or the second fixed point data type to a predetermined fraction length;
changing the first fixed point data type to either a signed data type or an unsigned data type;
promoting a first word length of the first fixed point data type to a second word length of the second fixed point data type;
partitioning the first model element into a set of model elements whose inputs are associated with data types having smaller word lengths than a word length of the first fixed point data type;
ormerging the first model element with one or more other model elements to create a merged model element wherein a merged word length associated with the merged model element equals the second word length of the second fixed point data type;
utilizing a single shared model element in place of the first and second model elements identified as implementing the same computation, functionality, or operation with each other; and
automatically generating code for the at least a portion of the executable source model, following the modifying, wherein the code generated for the at least a portion of the executable source model includes a portion for the single shared model element.
1 Assignment
0 Petitions
Accused Products
Abstract
A system and method generates optimized code for a source model. The system may include a resource sharing optimizer that evaluates the source model and replaces multiple model elements of the source model that are functionally equivalent with a single shared model element. The model elements replaced with the single shared model element may have different fixed point data types. The resource sharing optimizer may convert some of the fixed point data types to a common fixed point data type.
79 Citations
19 Claims
-
1. A method comprising:
-
storing, in a memory, at least a portion of an executable source model having a plurality of model elements; identifying, by a processor coupled to the memory, first and second model elements that implement a same computation, functionality, or operation with each other, where a first input to the first model element is associated with a first fixed point data type and a second input to the second model element is associated with a second fixed point data type that is different than the first fixed point data types; modifying, by the processor, the at least a portion of the executable source model by converting the first fixed point data type associated with the first input to the first model element to a new fixed point data type, wherein the converting includes at least one of; changing a fraction length of at least one of the first fixed point data type or the second fixed point data type to a predetermined fraction length; changing the first fixed point data type to either a signed data type or an unsigned data type; promoting a first word length of the first fixed point data type to a second word length of the second fixed point data type; partitioning the first model element into a set of model elements whose inputs are associated with data types having smaller word lengths than a word length of the first fixed point data type;
ormerging the first model element with one or more other model elements to create a merged model element wherein a merged word length associated with the merged model element equals the second word length of the second fixed point data type; utilizing a single shared model element in place of the first and second model elements identified as implementing the same computation, functionality, or operation with each other; and automatically generating code for the at least a portion of the executable source model, following the modifying, wherein the code generated for the at least a portion of the executable source model includes a portion for the single shared model element. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. An apparatus comprising:
-
a memory storing at least a portion of an executable source model, the at least a portion of the executable source model including model elements; and a processor coupled to the memory, the processor configured to; identify a group of the model elements that implement a same computation, functionality, or operation with each other, the group of the model elements having inputs associated with fixed point data types that are different; and modify the at least a portion of the executable source model by converting one or more of the fixed point data types that are associated with the inputs to the group of the model elements to a same fixed point data type, wherein the converting includes at least one of; changing a fraction length of at least one of the fixed point data types to a predetermined fraction length; changing the at least one of the fixed point data types to either a signed data type or an unsigned data type; promoting a first word length of a first fixed point data type of the fixed point data types to a second word length of a second fixed point data type of the fixed point data types; partitioning a first model element of the group of the model elements into a plurality of model elements whose inputs are associated with data types having smaller word lengths than a word length of the at least one of the fixed point data types;
ormerging a second model element of the group of the model elements with one or more other model elements to create a merged model element wherein a merged word length associated with the merged model element equals the first word length of the first fixed point data type, replacing the group of the model elements with a single shared model element that implements the same computation, functionality, or operation as the group of the model elements, and routing the inputs for the group of the model elements to the single shared model element. - View Dependent Claims (14, 15, 16, 17)
-
-
18. One or more non-transitory computer-readable media comprising program instructions, the program instructions, when executed, causing a processor to:
-
access, from a memory coupled to the processor, at least a portion of an executable source model, the at least a portion of the executable source model including model elements; identify a group of the model elements that implement a same computation, functionality, or operation with each other, the group of the model elements having inputs associated with fixed point data types that are different; and modify the at least a portion of the executable source model by converting one or more of the fixed point data types that are associated with the inputs to the group of the model elements to a same fixed point data type wherein the converting includes at least one of; changing a fraction length of at least one of the fixed point data types to a predetermined fraction length; changing the at least one of the fixed point data types to either a signed data type or an unsigned data type; promoting a first word length of a first fixed point data type of the fixed point data types to a second word length of a second fixed point data type of the fixed point data types; partitioning a first model element of the group of the model elements into a plurality of model elements whose inputs are associated with data types having smaller word lengths than a word length of the at least one of the fixed point data types;
ormerging a second model element of the group of the model elements with one or more other model elements to create a merged model element wherein a merged word length associated with the merged model element equals the first word length of the first fixed point data type, replacing the group of the model elements with a single shared model element that implements the same computation, functionality, or operation as the group of the model elements, and routing the inputs for the group of the model elements to the single shared model element. - View Dependent Claims (19)
-
Specification