Main Content

Speed Up SIL/PIL Execution by Disabling Constant Input Checking and Global Data Synchronization

默认情况下,银或公益诉讼execution performs constant input checking and global data synchronization. Constant input checking compares the value that a test file provides for a constant input argument with the value specified at code generation time. If the values do not match, an error occurs. Global data synchronization makes the values of global variables in the SIL or PIL execution environment consistent with the values in the MATLAB®workspace. If a global variable is constant and its value in the SIL or PIL execution environment differs from its value in the MATLAB workspace, an error occurs.

It is possible to speed up a SIL or PIL execution by disabling constant input checking or global data synchronization. However, if you disable these features, the SIL or PIL execution results might differ from the results in MATLAB.

Disable Constant Input Checking or Global Data Synchronization at the Command Line

In acoder.EmbeddedCodeConfigobject that you configured for SIL or PIL execution:

  • To disable constant input checking, set theSILPILCheckConstantInputsproperty tofalse. For example, for an objectcfg, use this code:

    cfg.SILPILCheckConstantInputs = false;

  • To disable global data synchronization, set theSILPILSyncGlobalDataproperty tofalse. For example, for an objectcfg, use this code:

    cfg.SILPILSyncGlobalData = false;

Disable Constant Input Checking or Global Data Synchronization in theMATLABCoder应用程序

In the settings for a project that you set up for SIL or PIL execution, on theDebuggingtab:

  • To disable constant input checking, setCheck constant inputs in SIL/PILtoNo.

  • To disable global data synchronization, setSynchronize global data in SIL/PILtoNo.

Related Topics