Coverage of a model doesn't necessarily reflect coverage of generated code.
In the generated code, there will be utility functions/routines generated as part of block settings (for ex: rounding, saturate on integer overflow, div-by-zero etc) which will not be covered using Simulink V&V.
Also optimization settings plays a part too.
For code coverage, you could try tools such as BTC EmbeddedTester (works better with TargetLink as code generator), ReactisForC, BullEyeCoverage etc.
2 Comments
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/243389-is-code-coverage-for-a-model-equal-to-code-coverage-of-generated-code#comment_310717
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/243389-is-code-coverage-for-a-model-equal-to-code-coverage-of-generated-code#comment_310717
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/243389-is-code-coverage-for-a-model-equal-to-code-coverage-of-generated-code#comment_310760
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/243389-is-code-coverage-for-a-model-equal-to-code-coverage-of-generated-code#comment_310760
Sign in to comment.