Stack Usage Estimation for Embedded Code Generation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional modeling applications lack the capability to determine whether generated code for a target controller will use memory in a desired manner, leading engineers to create multiple model configurations to avoid memory overruns.
Innovation Solution
A method and system for estimating stack usage of a graphical model by obtaining information about a target system, using a stack usage calculator to provide estimates for executing model components, and displaying data related to stack usage, allowing users to ensure adequate memory allocation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If conventional modeling applications are used without stack usage estimation, then code generation is simple and fast, but memory overruns may occur on the target controller
Solution Approach 1:
The patent performs stack usage estimation before code generation and deployment to the target controller. The modeling application calculates estimated stack usage for each model component and provides this information to the user prior to code generation, allowing memory issues to be identified and resolved in advance without affecting the simplicity of the code generation process itself.
Solution Approach 2:
The patent introduces an intermediary stack usage estimation mechanism between the modeling application and the target controller. This intermediary layer analyzes the model, calculates stack usage requirements, and provides feedback to the user, thereby preventing memory overruns without requiring direct modification of the code generation process or the target controller hardware.
2Manufacturing precision
If engineers generate multiple model configurations to test memory usage, then memory allocation can be optimized, but development time increases significantly
Solution Approach 1:
The patent performs stack usage estimation during the model design phase, before code generation and before deployment to multiple test configurations. By calculating estimated stack usage upfront for each model component, engineers can determine adequate memory allocation in a single pass, eliminating the need to generate and test multiple model configurations to assess memory requirements.
Solution Approach 2:
The patent provides feedback to the user regarding estimated stack usage of model components and the overall system. This feedback mechanism allows engineers to see memory requirements early in the design process and make informed decisions about memory allocation without needing to iterate through multiple configurations, thereby reducing development time while maintaining precise memory allocation.
3Reliability
If stack usage estimation is added to the modeling application, then memory overruns are prevented, but the application becomes more complex
Solution Approach 1:
The patent implements self-service functionality within the modeling application where the system automatically performs stack usage estimation and provides the results to the user. The estimation process is integrated into the existing modeling workflow, requiring minimal additional user effort while providing comprehensive memory usage information that enhances reliability without significantly complicating the user interface or operation procedures.
Data Source
AI summary
In one embodiment, a method of determining stack usage of at least a portion of a model for deployment on a target system is provided. The method may include obtaining information describing a first target system, and using the information to estimate a stack usage related to executing a representation of a component of the model on the first target system.


