Main Content

Share Simulink Cache Files for Faster Simulation

金宝app®cache files contain build artifacts that can speed up simulation and code generation. To generate these build artifacts and automatically package them in Simulink cache files, perform one of these actions:

  • 更新包含Accelerator模式中引用的模型的模型层次结构图

  • Simulate a model hierarchy that contains models referenced in accelerator mode

  • Simulate a top model in accelerator or rapid accelerator mode

  • Generate code for a model or model hierarchy

The second time that you perform any of these actions, Simulink builds only the out-of-date files as long as the重建configuration parameter is set to如果检测到任何变化(默认)或如果检测到已知依赖性的任何变化。With fewer files to build, the actions complete faster.

笔记

While you can avoid all referenced model rebuilds by setting the重建configuration parameter to绝不, using this setting can produce invalid simulation results.

团队成员或持续集成(CI)系统可以为您使用的模型生成Simulink缓存文件。金宝app要减少第一次构建这些模型时所需的时间,您可以将相应的Simulink缓存文件复制到所指定的本地文件夹金宝appSimulation cache folder偏爱。金宝appSimulink提取与磁盘上的内容不同的Simulink缓存文件内容。如果S金宝appimulink在磁盘上生成或更新构建工件,则会在本地更新相应的Simulink缓存文件。

您可以通过其识别Simulink缓存文金宝app件.slxc.延期。其文件名与相应模型的名称匹配。

检查金宝appCache File Contents

金宝appSimulink缓存文件可以包含多种类型的构建工件,包括:

  • 加速器目标

  • Rapid accelerator targets

  • 模型参考仿真目标

  • 可变使用信息

  • Code generation targets (Simulink Coder™, Embedded Coder®的)

  • Model representations (金宝appSimulink Design Verifier™的)

金宝appSimulink缓存文件为多个平台和Simulink版本累积构建工件。

要了解特定的Simulink缓存文件包含哪些内容,金宝app请通过双击文件打开报告。

金宝appSimulink缓存报告

或者,要在MATLAB中获取Simulink缓存文件的内容金宝app®表,使用Slxcinfo.功能。

You can reuse build artifacts that support the platform and release that you are using. For example, suppose that you use a Windows®machine and the R2019a Simulink release. In the Simulink cache file described by this report, you can use the simulation targets underR2019a : win64。使用Linux的团队成员®机器和R2019B可以使用模拟和代码生成目标R2019b : glnxa64and the model representations underR2019B:所有平台

A Simulink cache file can accumulate build artifacts for the release in which it was created and later releases. Suppose you create a Simulink cache file in R2019b. You would not be able to use that Simulink cache file in R2019a.

Use金宝app缓存文件

虽然大多数团队可以受益于使用仿真软件c金宝appache files, a development environment with these features is best suited for using Simulink cache files.

  • A model hierarchy that contains many referenced models.

  • 一种模拟加速器或快速加速器模式的顶级模型,导致Simulink为顶部模型和所有引用的模型生成仿真目标。金宝app

  • 整个开发团队的标准化平台,编译器和Simulink版本。金宝app

  • 您使用指定的相对路径或一致的绝对路径包括目录configuration parameter, for the entire development team.

  • A source control system, such as Git™, that manages design files. SeeSet Up Git Source Control

    笔记

    Since Simulink cache files are derived files, you should not manage them under source control. Even if you share Simulink cache files by storing them in a source control system, you cannot diff or merge different versions of these files.

  • CI系统,如Jenkins®,它定期使用一款并行工人池构建最新版本的模型层次结构。

    笔记

    To avoid unnecessary rebuilds for simulation and coder targets that use custom code, map the CI system directories to named volumes or symbolic links that are the same in team member sandboxes. For example, have the CI system and team members store custom code in a mapped directory such asB:\ path \ customcode

在此开发环境中,您可以在源控制系统中与文件进行交互并构建存档。

使用源控制系统,CI系统和构建存档的工作流程。CI系统从源控制系统中提出了设计更改,并在Build Archive中归档Simulink缓存文件。金宝app

To reduce the amount of time that you spend updating simulation targets, follow these steps.

  1. 从源控制系统中拉动最新版本的所有设计文件。

  2. Copy the latest version of all Simulink cache files from the build archive and place them in yourSimulation cache folder

  3. 打开顶级模型并模拟它。

    Simulink extracts the required build artifacts from the Simulink cache files. The simulation completes without rebuilding any models as long as the models have not changed since the most recent build completed by the CI system.

    笔记

    要从Simulink高速缓存文件中解压缩模拟和代码生成目标而不更新,模拟或生成模型层次结构的代码,请使用金宝appslxcunpack.功能。

  4. 更改模型并再次模拟模型层次结构。

    Simulink rebuilds the necessary models and updates the local copy of the corresponding Simulink cache file.

  5. Commit the updated model to the source control system. You do not commit the Simulink cache file, which is a derived file.

检查金宝app在项目中缓存文件

When you create a project from a top model, the project includes the corresponding Simulink cache files for the model and its referenced models.

要查看模型层次结金宝app构中的Simulink缓存文件依赖项,可以选择依赖性分析仪in the意见pane of the corresponding project.

依赖性分析器结果对于SLDEMO_MDLREF_DEPPRAGH,包括SIMULINK缓存文件金宝app

For more information, seeWhat Is Dependency Analysis?

也可以看看

|

Related Topics

外部网站