Challenge

Project on Development of TFT Cluster Speedometer Software Component

Aim : To Develop the Simulink model based on the given requirements and also create SLDD file and link the same to the model.And Perform the complete V and V workflow for the obtained model.

Description of Challenge :

Cluster Instrument receives the signals from other ECU via CAN bus interface. It also receives commands from the driver via steering wheel buttons. The signals are then processed by the Cluster ECU, after which the Cluster ECU may send the vehicle information to the LCD or light the LEDs and so forth, according to the results. Therefore, the Cluster ECU can be viewed as a carrier of the information flow.

1) Model Development :

Subsystem :

Calculating_TFT_Display_speed Subsystem :

Main_data_filtering Subsystem :

Auxilary_Data_Filtering Subsystem :

TFT_Speed_output Subsystem :

2) Simulink Data Dictionary (SLDD) :

3) Requirement Tagging :

Create the Functional and SwReq File into the xls. File.

Click On the New Requirement Set :

After That Click on the Add Requirement :

Linking the Requirement :

Link to the Subsystem

Requirement Report :

4) Model Advisor (JMAAB) :

Going to the Simulink Model >> Click on the Modelling >> Model Advisor.

5) Fixed Point Tool :

Run thee Model Error Free >> and then Click on the Fixed Point Tool >> Iterative Fixed-Point Conversion.

Simulation Model :

Simulink Data Dictionary(SLDD) Before Applying the Fixed point Tool:

Block Before Applying Fixed Point Tool

Procedure to Start the Fixed Point Tool :

Collect Ranges using Current Settings

Simulink Data Dictionary (SLDD) After Applying the Fixed Point Tool:

6) SLDV Design Error Detection Report :

Goto the Model >> Open the Design Verifier App >> Select the Design Error Detection >> then Click on Design Error Detection Setting.

Design Error Detection Report :

7) Functional Test Cases, MIL, SIL Harness, Coverage Report :

Simulink Model :

Functional Test Cases :

Model in Loop (MIL) :

MIL Output :

MIL Coverage Report :

Software in Loop (SIL) :

SIL Output :

SIL Coverage Report :

Code Generated :

8) SLDV Test Generation Report :

Goto the Model Run the model Error Free >> App >> Desgin Verifier >> Click one the Test Generation

Click on the Test Generation Setting

Result Summary of Test Generation :

Report :

9) Auto Code Generation main .c & .h Files :

Code Report :

.c File :

/
/*
* Event Support License -- for demonstration use and event support. Not
* for government, research, commercial, or other organizational use.
*
* File: TFT_Cluster_Speedometer_Software_Component.c
*
* Code generated for Simulink model 'TFT_Cluster_Speedometer_Software_Component'.
*
* Model version : 1.15
* Simulink Coder version : 9.8 (R2022b) 13-May-2022
* C/C++ source code generated on : Mon Jul 17 16:50:56 2023
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "TFT_Cluster_Speedometer_Software_Component.h"
#include "rtwtypes.h"
#include "TFT_Cluster_Speedometer_Software_Component_private.h"
/* Exported block signals */
uint16_T Out_Vehicle_speed_display; /* '<S6>/Switch' */
/* Block signals (default storage) */
B_TFT_Cluster_Speedometer_Sof_T TFT_Cluster_Speedometer_Softw_B;
/* Real-time model */
static RT_MODEL_TFT_Cluster_Speedome_T TFT_Cluster_Speedometer_Soft_M_;
RT_MODEL_TFT_Cluster_Speedome_T *const TFT_Cluster_Speedometer_Soft_M =
&TFT_Cluster_Speedometer_Soft_M_;
/* Model step function */
void TFT_Cluster_Speedometer_Software_Component_step(void)
{
int32_T tmp;
/* Outputs for Atomic SubSystem: '<Root>/TFT_Cluster_SWC' */
/* Switch: '<S7>/Switch2' incorporates:
* Inport: '<Root>/Average_Vehicle_Speed'
* RelationalOperator: '<S7>/LowerRelop1'
* RelationalOperator: '<S7>/UpperRelop'
* Switch: '<S7>/Switch'
*/
if (Average_Vehicle_Speed > 25000) {
/* Switch: '<S7>/Switch2' incorporates:
* Constant: '<S3>/Constant1'
*/
Out_Vehicle_speed_display = 25000U;
} else if (Average_Vehicle_Speed < 200) {
/* Switch: '<S7>/Switch2' incorporates:
* Constant: '<S3>/Constant'
* Switch: '<S7>/Switch'
*/
Out_Vehicle_speed_display = 200U;
} else {
/* Switch: '<S7>/Switch2' */
Out_Vehicle_speed_display = Average_Vehicle_Speed;
}
/* End of Switch: '<S7>/Switch2' */
/* Outputs for Enabled SubSystem: '<S1>/Auxilary_Data_Filtering' incorporates:
* EnablePort: '<S2>/Enable'
*/
/* Outputs for Enabled SubSystem: '<S1>/Main_data_filtering' incorporates:
* EnablePort: '<S5>/Enable'
*/
/* RelationalOperator: '<S4>/Compare' incorporates:
* Constant: '<S4>/Constant'
* Inport: '<Root>/Timer_input'
* Math: '<S1>/Rem'
*/
if ((uint16_T)(Timer_input % 10) == 0) {
uint32_T qY;
uint16_T tmp_0;
/* Product: '<S5>/Divide' incorporates:
* Gain: '<S5>/Gain'
* Inport: '<Root>/Main_filter_speed'
*/
if (Main_filter_speed == 0U) {
tmp_0 = MAX_uint16_T;
/* Divide by zero handler */
} else {
/* Gain: '<S5>/Gain' incorporates:
* Switch: '<S7>/Switch2'
*/
qY = (21299U * Out_Vehicle_speed_display) >> 7;
if (qY > 65535U) {
qY = 65535U;
}
qY = (qY * 41943U) >> 15;
if (qY > 65535U) {
qY = 65535U;
}
tmp_0 = (uint16_T)(qY / Main_filter_speed);
}
/* Product: '<S2>/Divide' incorporates:
* Constant: '<S5>/Constant'
* Gain: '<S2>/Gain'
* Inport: '<Root>/Auxiliary_filter_speed'
* Product: '<S5>/Divide'
* Sum: '<S5>/Add'
*/
if (Auxiliary_filter_speed == 0U) {
tmp_0 = MAX_uint16_T;
/* Divide by zero handler */
} else {
tmp_0 = (uint16_T)((((((uint16_T)(((int32_T)(tmp_0 * 800U) - 1310725) >>
18) * 25559U) >> 22) * 41943U) >> 15) * 100U / Auxiliary_filter_speed);
}
/* Sum: '<S2>/Add' incorporates:
* Constant: '<S2>/Constant'
* Product: '<S2>/Divide'
*/
qY = tmp_0 - 3U;
if (tmp_0 - 3U > tmp_0) {
qY = 0U;
}
/* Sum: '<S2>/Add' */
TFT_Cluster_Speedometer_Softw_B.Add_c = (uint16_T)qY;
}
/* End of RelationalOperator: '<S4>/Compare' */
/* End of Outputs for SubSystem: '<S1>/Main_data_filtering' */
/* End of Outputs for SubSystem: '<S1>/Auxilary_Data_Filtering' */
/* Sum: '<S6>/Add' incorporates:
* Sum: '<S2>/Add'
* Switch: '<S7>/Switch2'
*/
tmp = TFT_Cluster_Speedometer_Softw_B.Add_c - Out_Vehicle_speed_display;
if (tmp < 0) {
tmp = 0;
}
/* Switch: '<S6>/Switch' incorporates:
* RelationalOperator: '<S6>/GreaterThan'
* Sum: '<S6>/Add'
*/
if (tmp <= 150) {
/* Switch: '<S7>/Switch2' incorporates:
* Sum: '<S2>/Add'
* Switch: '<S6>/Switch'
*/
Out_Vehicle_speed_display = TFT_Cluster_Speedometer_Softw_B.Add_c;
}
/* End of Switch: '<S6>/Switch' */
/* End of Outputs for SubSystem: '<Root>/TFT_Cluster_SWC' */
}
/* Model initialize function */
void TFT_Cluster_Speedometer_Software_Component_initialize(void)
{
/* (no initialization code required) */
}
/* Model terminate function */
void TFT_Cluster_Speedometer_Software_Component_terminate(void)
{
/* (no terminate code required) */
}
/*
* File trailer for generated code.
*
* [EOF]
*/

10) Polyspace Analysis Report/ Output :

Procedure to Analysis the Polyspace Report

Bug Finder :

  • Firstly Generated the .C code
  • Initially, open the Polyspace in that new project click on start new project.
  • The Project Properties dialogue box will open in that give the project name as we saved in the MATLAB,then select the location where it we need to save after that click Next or use the default location.
  • Then ,it asks for the Projrct source,click on browserand select the folder where th .c file are generated then optionally we can add the include folder then clock on finish,the polyspace environment will open.
  • In the configuraton settings option called Target & compiler select the source code language as c,change the target processor as X86_64.
  • In the coding standards & code Metrics in that enable the check MISRA C:2004 also select the calculate the code metrics option
  • After that go to bug finder analysis under that select the default one.
  • Go to reporting enable the generate report option and ouput formet as PDF or any file we need
  • Finally save the polyspace and run the Bug Finder.

Code Prover :

  • Befour going to the Code Prover First setup the Configration setting.
  • In Configuration go to the Code prover verification and under code prover verification option.
  • Click on the Check Behavior and Enable the option (i,e Allow Negative Operand for left shifts).
  • and also click on the Consider Non-Finite floats.
  • Then After you go to the Precision
  • In Precision Select the Precision level -2 and Verification Level is Software Safety Analysis Level-2.
    then After Click on Save Botton the Configration setting will be save.
    then After We Run the Code Prover.
  • And After Click on the Dashboard option and see the Results.

11) Test Generation Report- Baseline and Back to back Testing :

Baseline Testing :

Run the model>> goto the Simulink Test >>Click on the Simulink Test Manager >> then Click on New >> Test File>> Create Test Name.

Click on the Requirement

then after Click one the System Under Testing

Click on the Input

Click on the Coverage Setting >> Click on Enable Option.

then After Save and Run it.

Results :

Baseline Criteria Output :

Baseline Testing Report :

Back To Back Testing :

Click on the Simulink Test Manager

Click on New

Generated MIL And SIL Model :

Click on the Requirement

then After Click on the System under test and harness are link automatically.

then Click on the Input and enable it.

after that click on coverage Setting and Enable the Coverage.

and Save and Run it.

Results :

Equivalence Criteria Result :

Back to back testing Report :

---------------------------------------------------------------------------------------------------------------------------------------------

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.