Memory management in embedded system with design time object instantiation
First Claim
1. A method for managing memory usage in a software program having a framework and a plurality of algorithm modules, the method comprising the steps of:
- linking the plurality of algorithm modules with a first calling program to form an initial software program, wherein each of the plurality of algorithm modules has a memory interface which responds to a memory allocation inquiry with memory usage requirements of an instance of the algorithm module;
sending a query from the first calling program to the memory interface of each of the plurality of algorithm modules to request memory usage requirements for each instance of the algorithm module;
receiving a response from the memory interface of each algorithm module identifying memory usage requirements of each instance of the algorithm module; and
allocating a portion of memory to each algorithm module to instantiate each instance in accordance with the memory usage requirement identified by the memory interface of each algorithm module, such that a plurality of algorithm module instantiations are formed, whereby each instance of the plurality of algorithm modules is instantiated and allocated memory at design time;
combining the plurality of algorithm module instantiations with the framework to form a final software program.
1 Assignment
0 Petitions
Accused Products
Abstract
A system and method is provided for enabling the reuse of algorithms in multiple application frameworks with no alterations required of the algorithm once it is developed. An inverted memory allocation mechanism enables various algorithm modules to be integrated into a single application without modifying the source code of the algorithm modules. During a design phase of an application, a set of algorithm modules is linked with a calling program to form an initial software program. Each of the set of algorithm modules has a memory interface which responds to a memory allocation inquiry with memory usage requirements of an instance of the algorithm module. The calling program sends a query to the memory interface of each algorithm module to request memory usage requirements for each instance of the algorithm module. A response is then sent from the memory interface of each algorithm module identifying memory usage requirements for each instance of the algorithm module. The calling program then allocates a portion of memory to each algorithm module to instantiate each instance in accordance with the memory usage requirement identified by the memory interface of each algorithm module. Thus, each instance of the plurality of algorithm modules is instantiated and allocated memory at design time of an application. The set of algorithm module instantiations is then combined with the framework to form a final software program.
48 Citations
19 Claims
-
1. A method for managing memory usage in a software program having a framework and a plurality of algorithm modules, the method comprising the steps of:
-
linking the plurality of algorithm modules with a first calling program to form an initial software program, wherein each of the plurality of algorithm modules has a memory interface which responds to a memory allocation inquiry with memory usage requirements of an instance of the algorithm module;
sending a query from the first calling program to the memory interface of each of the plurality of algorithm modules to request memory usage requirements for each instance of the algorithm module;
receiving a response from the memory interface of each algorithm module identifying memory usage requirements of each instance of the algorithm module; and
allocating a portion of memory to each algorithm module to instantiate each instance in accordance with the memory usage requirement identified by the memory interface of each algorithm module, such that a plurality of algorithm module instantiations are formed, whereby each instance of the plurality of algorithm modules is instantiated and allocated memory at design time;
combining the plurality of algorithm module instantiations with the framework to form a final software program. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
initializing a first region of memory allocated by the first calling program to a first algorithm module under direction of the memory interface of the first algorithm module;
executing a first algorithm in a first instance of the first algorithm module in a manner that only the first memory region is used for data memory accesses.
-
-
4. The method of claim 3, further comprising the steps of:
-
relocating the first algorithm module from a first location to a second location; and
re-computing all internal data references within the first algorithm module to the first memory region to correspond with the second location.
-
-
5. The method of claim 1, wherein the step of receiving a response comprises defining two or more types of memory usage requirements.
-
6. The method of claim 1, wherein the step of receiving a response comprises defining at least on type of memory usage requirement, and wherein step of allocating a portion of memory allocates a different type of memory.
-
7. The method of claim 1, wherein the step of receiving a response informs the first calling program that at least a first portion of the required memory must be persistent memory and a second portion is shared scratch memory.
-
8. The method of claim 7, further comprises the step of sending a directive from the framework to a first algorithm module directing the first algorithm module to activate itself by copying certain data from a first portion of persistent memory allocated to the first algorithm module to shared scratch memory, such that the first algorithm module uses shared scratch memory during execution of the first algorithm.
-
9. The method of claim 8, further comprising the step of sending a directive from the framework to the first algorithm module directing the first algorithm module to deactivate itself by copying certain resultant data from the shared scratch memory to the first portion of persistent memory.
-
10. The method of claim 1, wherein the step of combining comprises combining another plurality of algorithm modules with the plurality of algorithm module instantiations and with the framework to form a final software program, wherein each of the another plurality of algorithm modules has a memory interface which responds to a memory allocation inquiry with memory usage requirements of an instance of the algorithm module;
- and further comprising the steps of;
loading the final software program on a hardware platform; and
executing the final software program on the hardware platform, wherein the step of executing comprises the steps of;
sending a query from the framework to the memory interface of each of the another plurality of algorithm modules to request memory usage requirements for each instance of each of the another plurality of algorithm modules;
receiving a response from the memory interface of each algorithm module identifying memory usage requirements for each instance of the algorithm module; and
allocating a portion of memory to each of the another plurality algorithm modules to instantiate each instance in accordance with the memory usage requirement identified by the memory interface of each algorithm module, whereby each instance of the another plurality of algorithm modules is instantiated and allocated memory dynamically.
- and further comprising the steps of;
-
11. A software program that is formed by a process comprising the steps of:
-
combining a plurality of algorithm modules with a first calling program to form an initial software program, wherein each of the plurality of algorithm modules has a memory interface which responds to a memory allocation inquiry with memory usage requirements of an instance of the algorithm module;
sending a query from the first calling program to the memory interface of each of the plurality of algorithm modules to request memory usage requirements for each instance of each of the plurality of algorithm modules;
receiving a response from the memory interface of each algorithm module identifying memory usage requirements of each instance of the algorithm module; and
allocating a portion of memory to each algorithm module to instantiate each instance in accordance with the memory usage requirement identified by the memory interface of each algorithm module, such that a plurality of algorithm module instantiations are formed, whereby each instance of the plurality of algorithm modules is instantiated and allocated memory at design time;
combining the plurality of algorithm module instantiations with a framework to form the software program.
-
-
12. A method for managing memory usage in a software program having a framework and a plurality of algorithm modules, wherein for a given one of the plurality of algorithm modules, the method comprises the steps of:
-
encapsulating an algorithm instruction code section with a memory interface code section to form an algorithm module, wherein a portion of the memory interface is segregated so that it can be excluded;
responding to a memory allocation inquiry by a first calling program to the memory interface with a memory usage requirement for an instance of the algorithm module;
accepting an allocation of a first region of memory in response to the memory allocation inquiry and adjusting relative addresses within the algorithm instruction code section so that data memory accesses are performed by the algorithm instruction code in the first region of memory, such that an instance of the algorithm module is formed; and
excluding the segregated portion of the memory interface when the instance of the algorithm module is combined with the framework. - View Dependent Claims (13, 14, 15, 16)
initializing the first region of memory allocated in response to the framework under direction of the memory interface; and
executing the algorithm instruction in a first instance of the algorithm module in a manner that only the first region of memory is used for data memory accesses.
-
-
14. The method of claim 13, further comprising the steps of:
-
relocating the algorithm module from a first location to a second location; and
re-computing all internal data references within the first algorithm module to the first region of memory to correspond with the second location.
-
-
15. The method of claim 13, further comprises the step of receiving a directive from the framework directing the algorithm module to activate itself by copying certain data from a portion of persistent memory allocated to the algorithm module to shared scratch memory, such that the algorithm module uses shared scratch memory during execution of the first algorithm.
-
16. The method of claim 15, further comprising the step of receiving a directive from the framework directing the algorithm module to deactivate itself by copying certain resultant data from the shared scratch memory to the portion of persistent memory allocated to the algorithm module.
-
17. A digital system, comprising:
-
a microprocessor with a central processing unit (CPU);
a non-volatile program memory connected to the CPU;
a data memory connected to the CPU; and
a software program stored in the nonvolatile memory, wherein the software program is formed by a process comprising the steps of;
combining a plurality of algorithm modules with a first calling program to form an initial software program, wherein each of the plurality of algorithm modules has a memory interface which responds to a memory allocation inquiry with memory usage requirements of an instance of the algorithm module;
sending a query from the first calling program to the memory interface of each of the plurality of algorithm modules to request memory usage requirements for each instance of each of the plurality of algorithm modules;
receiving a response from the memory interface of each algorithm module identifying memory usage requirements of each instance of the algorithm module; and
allocating a portion of memory to each algorithm module to instantiate each instance in accordance with the memory usage requirement identified by the memory interface of each algorithm module, such that a plurality of algorithm module instantiations are formed, whereby each instance of the plurality of algorithm modules is instantiated and allocated memory at design time; and
combining the plurality of algorithm module instantiations with a framework to form the software program. - View Dependent Claims (18, 19)
an integrated keyboard connected to the CPU via a keyboard adapter;
a display, connected to the CPU via a display adapter;
radio frequency (RF) circuitry connected to the CPU; and
an aerial connected to the RF circuitry.
-
Specification