In polyspace 2019B for the targetlink generated code how to enable the shared variable sharing option?

1 view (last 30 days)
Hi ,
am using the polyspace 2019B and wantto run the cod prover for global varibale sharing option
main is not there in code generated
please help in what configuration needs to be done this analysis.
using the desktop version of 2019B polyspace
thanks for the support and any answers

Answers (1)

Anirban
Anirban on 7 May 2020
Hi Geetha,
To find shared variables, you need to have a main function, even if empty. See the requirements for multitasking verification.
Now, if you run Code Prover on generated code directly from Simulink (code generated by TargetLink), a main is generated for the purposes of verification. This main generation is not compatible with the multitasking options. So you cannot check for shared variables if you run Polyspace directly from Simulink.
Your best bet is to add the code directly in the Polyspace user interface in a project (or launch from command line), and add a main function. But then you lose other conveniences. You have to specify paths to the headers and so on explicitly. For multitasking, in either case, you will have to also specify the entry-point functions, cyclic tasks, and so on. Unfortunately, this will require detailed knowledge of the structure of your generated code.
Please contact MathWorks Technical Support for help with setting up your verification. You can also provide them more details so that Polyspace can better support this use-case.
  2 Comments
Geetha shastry
Geetha shastry on 11 May 2020
Hello Anriban,
Thank you for the answer, as a using the desktop user interface of polyspace , is in multitasking main can be entry point ?
Anirban
Anirban on 11 May 2020
Hi Geetha,
When running Code Prover for multitasking, a main is required, but you do not have to explicitly specify it as an entry point.
In fact, the underlying model in Code Prover is that the main function ends before all entry points begin. So, your main cannot have an infinite loop,etc. If your main contains an infinite loop, for instance to emulate a cyclic task, then there are workarounds so that the analysis can run without errors. The link above states those workarounds.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!