By default, a SIL or PIL 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.
In a coder.EmbeddedCodeConfig
object that
you configured for SIL or PIL execution:
To disable constant input checking, set the
SILPILCheckConstantInputs
property to
false
. For example, for an object
cfg
, use this
code:
cfg.SILPILCheckConstantInputs = false;
To disable global data synchronization, set the
SILPILSyncGlobalData
property to
false
. For example, for an object
cfg
, use this
code:
cfg.SILPILSyncGlobalData = false;
In the settings for a project that you set up for SIL or PIL execution, on the Debugging tab:
To disable constant input checking, set Check constant
inputs in SIL/PIL to
No
.
To disable global data synchronization, set Synchronize
global data in SIL/PIL to
No
.