이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
데이터 복사 횟수 줄이기
생성된 코드에서 데이터 사본을 제거하여 RAM 및 ROM 소비량을 줄이고 코드 실행 속도를 높입니다. 코드 생성기가 일부 데이터의 복사본을 제거합니다. 특정 모델 파라미터 설정을 조정하고, MATLAB 함수 블록의 입력 및 출력 인수에 동일한 이름을 지정하고, Simulink 신호를 사용하여 재사용을 지정하면 다른 데이터 사본을 제거할 수 있습니다.
도움말 항목
- Minimize Computations and Storage for Intermediate Results at Block Outputs
The code generator folds block computations into a single expression, instead of generating separate code statements and storage declarations for each block in a model.
- Fold Expressions
Expression fold code to minimize the computation of intermediate results at block outputs and the storage of such results in temporary buffers or variables.
- Enable and Reuse Local Block Outputs in Generated Code
Where possible, the code generator declares block outputs as local variables, so that it can potentially reuse these variables.
- Generate Efficient Code for Buses
Model buses to maximize efficiency of the generated code.
- Inline Invariant Signals
Use the numerical values of invariant signals instead of their symbolic names in the generated code.
- Use memcpy Function to Optimize Generated Code for Vector Assignments
The code generator optimizes the generated code for vector assignments by replacing
for
loops withmemcpy
function calls. - Control Inlining to Fine-Tune Performance and Readability of Generated Code
Inlining eliminates the overhead of function calls but can produce larger C/C++ code and reduce code readability.