How can I insert 'pragma' directives in my generated code using Real-Time Workshop Embedded Coder 5.5 (R2010a)?
조회 수: 12 (최근 30일)
이전 댓글 표시
I use MATLAB and CUDA to rapidly simulate many parallel Simulink models in a Monte Carlo fashion. In the generated code, I will need finer control of where the data will be placed in the compiled code. Inserting 'pragma' in the generated code will allow me to control the memory locations where the data will be placed and so on. I would like to know how I may do this with Real-Time Workshop Embedded Coder 5.5 (R2010a).
채택된 답변
MathWorks Support Team
2010년 6월 23일
In order to insert 'pragma' directives before specific functions, for example the 'model_custom_initialize' function for model_custom.mdl, please use the following steps:
1. Create a new data package using the data class designer. For more information regarding this please consult the following documentation named 'Subclassing Simulink Data Classes'. You can access this by executing the following command:
web([docroot '/toolbox/simulink/ug/f14-90757.html'])
2. Then, edit the data class package created using the function 'csdesigner'. In the example provided we have added a new memory section named 'myMS'.
For more information regarding this please consult the following documentation named 'Designing Custom Storage Classes and Memory Sections'. You may access this by executing the following at the MATLAB command prompt:
web([docroot '/toolbox/ecoder/ug/f19459.html'])
3. In the model, let's say we select 'ert' as the target using the Real-Time Workshop pane in the 'Configuration Parameters' GUI. We will then see a 'Memory Sections' option in Configuration Parameters>Real-Time Workshop. Here you can select the appropriate memory section for the model Initialize/Terminate functions.
To perform such 'pragma' insertions for other specific subsystems, please convert them to atomic subsystems and then follow the documentation named 'Applying Memory Section'. You may access this by executing the following at the MATLAB command prompt:
web([docroot '/toolbox/ecoder/ug/bq3642m.html'])
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!