Polyspace code prover not able to analyse stack for whole project

2 Ansichten (letzte 30 Tage)
Trying to get stack size for my project but code prover is giving only application level with initialization value.
Let me know how to get entire stack usage value for whole project with both application and bootloader.

Akzeptierte Antwort

Anirban
Anirban am 4 Dez. 2020
Hi,
Could you provide some more information? For instance, the following would be helpful:
  • When you say 'project', do you mean a Polyspace project? Are the bootloader source files part of the Polyspace project?
  • How do you know that the stack size estimation is not taking the bootloader sources into account?
Just for your information, the software does compute a Program Maximum Stack Usage . In some situations, the result for this metric might show up as Not Computed. Is that what is happening here?
Whatever else you can state about your diagnosis of the problem can help us here.
  2 Kommentare
ashwini BHAT
ashwini BHAT am 30 Dez. 2020
Yes,it is polyspace project created by command line and also created option file to generate result throuigh command line only.
Yes bootloader source files part of polyspace project.
OS related functions are getting as a not computed.
Last point which you mentioned regarding program maximum stack usage :
Which are situation in which metrics is not computed?
as per my understaning :
1.red check : which is not present in my code.
2. grey check : yes there is grey checks but how to handle this.If code is compiled completely then need to get complete stack with all function.
Let me know the solution to get complete stack size for my project.It is autosar based project.
Anirban
Anirban am 5 Jan. 2021
Hi,
Gray checks should not prevent computation of program maximum stack usage. The function calls in gray code would simply be discounted from the computation.
The things that prevent stack usage computation are things that you would typically not have in your code:
  • Red checks
  • Infinite loops (These sometimes appear as Non-terminating loop red checks, but for trivial infinite loops that are perhaps intended, the loops are shown through a dashed red in the source code. )
  • Recursive functions (In embedded code, recursive functions are discouraged. You can run the checker for MISRA C:2012 Rule 17.2 to detect these functions.)
If the stack usage of a function appears as Not computed, the stack usage of all functions upstream from this function will probably also appear as Not computed. One quick question comes to mind. Do you have a main function in your project or are you using the Polyspace option -main-generator?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by