이 페이지는 기계 번역을 사용하여 번역되었습니다. 영어 원문을 보려면 여기를 클릭하십시오.
데이터 복사 횟수 줄이기
모델 파라미터를 조정하여 코드 실행 속도를 향상하고 메모리 사용량을 줄입니다.
생성된 코드에서 데이터 사본을 제거하여 RAM 및 ROM 소비량을 줄이고 코드 실행 속도를 높입니다. 코드 생성기가 일부 데이터의 복사본을 제거합니다. 특정 모델 파라미터 설정을 조정하고, MATLAB 함수 블록의 입력 및 출력 인수에 동일한 이름을 지정하고, Simulink 신호를 사용하여 재사용을 지정하면 다른 데이터 사본을 제거할 수 있습니다.
도움말 항목
기본적인 데이터 복사량 절감
- Optimize Generated Code by Passing Reusable Subsystem Outputs as Individual Arguments
The code generator eliminates data copies from local variables back to global block I/O structures by passing reusable subsystem outputs as individual arguments instead of as a pointer to a structure stored in global memory. - 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. - Reuse Global Block Outputs in the Generated Code
The code generator attempts to reuse global 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. - Convert Data Copies to Pointer Assignments
The code generator optimizes generated code for vector signal assignments by trying to replaceforloop controlled element assignments andmemcpyfunction calls with pointer assignments. - Inline Invariant Signals
Use the numerical values of invariant signals instead of their symbolic names in the generated code. - Data Copy Reduction for Data Store Read and Data Store Write Blocks
The code generator attempts to eliminate data copies for Data Store Read and Data Store Write blocks. - Reduce Data Copies for Bus Assignment Blocks in Generated Code
For models containing a Bus Assignment block, if possible, the code generator uses the same variable for the block input and output.
지정에 의한 데이터 복사량 절감
- Remove Data Copies by Reordering Block Operations in the Generated Code
Reorder block operations in the generated code to eliminate temporary variables and associated data copies. - Optimize Generated Code by Using Signal Labels to Guide Buffer Reuse
Remove data copies by using signal labels. - Optimize Global Variable Usage
Choose a global variable reference optimization to satisfy your memory usage and execution speed requirements. - Specify Buffer Reuse for MATLAB Function Blocks in a Path
Reuse buffers across MATLAB Function blocks. - Specify Buffer Reuse for Signals in a Path
Use the Reusable storage class to specify buffer reuse for multiple signals in a path. - Generate Efficient Code for Buses
Model buses to maximize efficiency of the generated code. - 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.