How to deal with MISRA SLSF 036 rule

조회 수: 20 (최근 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