Pragmas in SIL simulation

1 Ansicht (letzte 30 Tage)
Thomas Becker
Thomas Becker am 13 Feb. 2018
Beantwortet: Thomas Becker am 25 Jun. 2018
Hello,
we have to insert pragmas for adaptive values and parameters; that works well and the generated code looks fine.
But what's with SIL simulation using a Model (reference) block? How are pragmas treated during compiling for host PC simulation?
Or is it always necessary to encapusulate our pragmas in #ifndef / #ifdef directives?
Thanks a lot, Thomas

Antworten (2)

shou wang
shou wang am 25 Jun. 2018
I am doing the same thing,I do not know howto do.

Thomas Becker
Thomas Becker am 25 Jun. 2018
Hi,
in the meantime I've got a friendly answer from MathWorks support:
"In general, SIL and PIL modes try to closely emulate the deployed behavior of the code. As a result, there are no specific mechanisms to ignore directives for this mode as there would be for other simulation modes. While you may use the "coder.target" function to distinguish behavior for other code generation targets, this is not the case for SIL. As such, to ensure that the pragmas are ignored for this simulation mode, the most direct way would be to utilize the conditional macros (#ifdef TARGET_DIAB_COMPILER) as you described."

Kategorien

Mehr zu Deployment, Integration, and Supported Hardware finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by