필터 지우기
필터 지우기

Pragmas in SIL simulation

조회 수: 3 (최근 30일)
Thomas Becker
Thomas Becker 2018년 2월 13일
답변: Thomas Becker 2018년 6월 25일
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

답변 (2개)

shou wang
shou wang 2018년 6월 25일
I am doing the same thing,I do not know howto do.

Thomas Becker
Thomas Becker 2018년 6월 25일
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