Azzera filtri
Azzera filtri

How to deal with MISRA SLSF 036 rule

9 visualizzazioni (ultimi 30 giorni)
Daniele
Daniele il 29 Giu 2018
Modificato: Satwik il 23 Ago 2024 alle 5:48
Hello, I'm using Simulink and Stateflow to produce a MISRA SLSF and MISRA C compliant model, to produce an AUTOSAR SwC with Embedded Coder.
I'm using bus signals into models in different points as they are really useful for my intended implementation.
One of the required rules by MISRA SLSF is the 036. The statement "A" of this rule suggest not to use Bus inputs with Stateflow, since buses are used in Simulink to package signals together often with different types. Each data in Stateflow must have a unique type definition.
My questions are: - Is this rule still valid with R2018a? - Is there a correlated check into Model Advisor for this rule? - Is there a way to use buses and respect this rule?
Thanks in advance
  1 Commento
Jean Matthieu
Jean Matthieu il 26 Lug 2024
Most of the rules are supid. Are they still valid on release post 2019?
Few other examples:
MISRA AC SLSF 005 --> list of allowable blocks
MISRA AC SLSF 025 --> size of blocks
MISRA AC SLSF 034 --> rules on stateflow that feel Stateflow are useless
MISRA AC SLSF 035 --> it is forbidden to use truth table (?)
MISRA AC SLSF 039 --> Here are other constraining rules over stateflow --> Stateflow is clearly useless with MISRA AC
MISRA AC SLSF 040 --> Other constraints over Stateflow...
==> It seems like those who wrote this document disliked Stateflow

Accedi per commentare.

Risposte (1)

Satwik
Satwik il 23 Ago 2024 alle 5:04
Modificato: Satwik il 23 Ago 2024 alle 5:48
Hi,
Regarding your first question, the 'MISRA AC SLSF' document specifies that the 'In Bus Element' block is categorized as 'Not Allowed' within the context of modelling blocks, as detailed in 'Appendix E: Allowable Simulink and Stateflow Blocks'. The document is attached for your reference.
For your second question, to evaluate the potential of your model to generate code compliant with MISRA, you should open the Model Advisor and execute the checks found under 'By Task > Modelling Guidelines for MISRA C:2012'. Additionally, it is advisable to utilize the Model Advisor checks that align with the high-integrity modelling guidelines for MISRA C:2012. For more detailed information, you may refer to the documentation given below: https://in.mathworks.com/help/releases/R2024a/slcheck/ref/model-advisor-checks-for-misra-c2012-coding-standards.html.
For your third question, a possible workaround to use buses without breaching MISRA SLSF compliance is to decompose bus signals into their individual components, before interfacing with Stateflow. This approach ensures that each signal entering Stateflow has a unique type, thereby maintaining compliance.
Hope this helps!

Categorie

Scopri di più su Stateflow in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by