Shared Simulink Cache Files doesn't work

6 views (last 30 days)
Hello,
i using Matlab "R2020b" and i have problem in Cache files (.slxc),
i have a model Simulink Contains many Referance Models and when i compile the Model it take time ~5h and after the compiling of the Model, Matlab generate a Cache files succufly in my Computer for set up the speed of the compilation (~1h),but when i want to share the Cache files with another person it doesn't work in his Computer and the Model Simulink take many times to finish the Compilation (~5h again) and after the Compilation it doesn't generate another Cache files but it Modify on the existing Cache files that i generated
knowing that we use the Same Parmeters and the Version
Dignostic in My Computer:
Diagnostic in My Computer
Dignostic in the Computer of the Person :
the Person Computer
and to Configure the Path of existing Cache files we use this scripte :
RootPath = pwd;
Cachefile_Path = fullfile(RootPath,'Cashe_file');
Simulink.fileGenControl('set', 'CacheFolder', Cachefile_Path );
set_param(0, 'CacheFolder', fullfile(RootPath,'Cashe_file'))
Can you guys help me to resolve this issue pls
Thank you,

Accepted Answer

Shubham
Shubham on 19 Mar 2024
Hey Younes,
I understand that you are trying to share Simulink cache files to speedup simulation however Simulink is rebuilding the model. It seems that the rebuild was caused by changes in "Code Replacement Library". Please check if the parameters are same on both the machines:
Configuration Parameter -> Code Generation -> Interface -> Code replacement library.
The script for configuring the path for existing cache file seems correct, however you can refer to the following MATLAB Answers post for configuring the Simulink cache folder here: https://www.mathworks.com/matlabcentral/answers/535769-how-can-i-change-the-location-where-generated-simulink-files-are-placed
Make sure that you are matching the requirements for reusing the Simulink Cache files such as using the same MATLAB release, platform and compiler. For more details please refer to this Article explaining the workflows and best practises involved while sharing Simulink Cache files: https://www.mathworks.com/company/technical-articles/agile-model-based-design-accelerating-simulink-simulations-in-continuous-integration-workflows.html
Since you have mentioned that your model contains several reference models leading to high compilation time, I would suggest you to enable "parallel model reference builds" option provided in the Model Referencing tab as shown in the above mentioned article. You can perform checks for parallel build by navigating to:
DEBUG -> Performance Advisor -> Simulation -> checks that require Update Diagram
For more information on parallel builds you can refer to the following documentation:
You can also refer to the workflow example for sharing Simulink Cache in this File Exchange submission by MathWorks: https://www.mathworks.com/matlabcentral/fileexchange/100376-workflow-for-simulink-cache-and-jenkins
You may find the following documentation useful to your query as well:
I hope this helps !

More Answers (0)

Categories

Find more on Programmatic Model Editing in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!