How to deal with MISRA SLSF 036 rule

21 次查看(过去 30 天)
Daniele
Daniele 2018-6-29
编辑: Satwik 2024-8-23
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 个评论
Jean Matthieu
Jean Matthieu 2024-7-26
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

请先登录,再进行评论。

回答(1 个)

Satwik
Satwik 2024-8-23
编辑:Satwik 2024-8-23
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!

类别

Help CenterFile Exchange 中查找有关 Stateflow 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by