이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
메모리 사용량
코드 생성기가 변수를 지역 변수로 정의하는지 아니면 전역 변수로 정의하는지와 데이터가 서브시스템 함수로 어떻게 전달되는지를 지정하여 메모리 사용량을 제어합니다. 구성 설정을 수정하여 데이터 저장에 사용되는 메모리의 양을 줄입니다.
코드 생성기는 제어 흐름 구조를 결합하고, 쓸모없는 코드 경로와 계산 결과에 영향을 미치지 않는 블록에 대한 코드를 제거하여 ROM 사용량을 줄입니다. 초기화 코드, 재설정 및 비활성화 함수, 방어 코드 등 필요 없는 코드를 제거하면 ROM 사용량을 더욱 줄일 수 있습니다.
도움말 항목
- Vector Operation Optimization
The code generator reduces stack memory by replacing temporary local arrays with local variables.
- Reduce Memory Usage for Boolean and State Configuration Variables
Reduce the amount of memory that stores state configuration variables and
Boolean
variables. - Optimize Generated Code Using memset Function
The
memset
function clears internal storage, regardless of type, to the integer bit pattern 0 (that is, all bits are off). - Customize Stack Space Allocation
Control the maximum allowable stack size to provide some control over whether data is defined locally or globally in the generated code.
- Configure Loop Unrolling Threshold
Starting at a default value of 5, the code generator begins to use a
for
loop instead of separate statements to assign values to the elements of a signal or parameter array. - Specify Single-Precision Data Type for Embedded Application
Generate code whose floating-point data types are only single precision, for example, for targeting a single-precision processor.
- Generate Efficient Code by Specifying Data Types for Block Parameters
To generate more efficient code, match parameter data types with signal data types or store parameters in smaller data types.
- Optimize Generated Code Using Boolean Data for Logical Signals
The code generator optimizes the generated code by storing logical signals as
Boolean
data types. - Optimize Memory Usage for Time Counters
Optimize memory that the code generator allocates for an elapsed time counter.