Borrar filtros
Borrar filtros

Pragmas in SIL simulation

3 visualizaciones (últimos 30 días)
Thomas Becker
Thomas Becker el 13 de Feb. de 2018
Respondida: Thomas Becker el 25 de Jun. de 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

Respuestas (2)

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

Thomas Becker
Thomas Becker el 25 de Jun. de 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."

Community Treasure Hunt

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

Start Hunting!

Translated by