Project 2 - Development of TFT Cluster Speedometer Software Component
-Development of TFT Cluster Speedometer Software Component.
-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)Simulink Model File:







-Create the SLDD File;

-Create the functional and SWReq file into the .xls File;


-Linking the Requirement to the model using Requirement Editor:(Report)


-Run the Model error free>>Click on 'Fixed-point Tool' app>>Click on 'New'>>Click on Iterative Fixed-point conversion;



-Then click on 'Prepare' then click on 'collect Ranges'>>then Click on 'Propose Data Type>>click on 'Apply Data Type;



-SLDD After Fixed-point Tool Applying:

-Go to the model>>open the 'Design verifier' app>>Select 'design error Detection'>>'then Error detection setting'>>


-Report:
Functional test case,MIL & SIL harness, Coverage reports:
-Simulink Model;

-MIL Model;

-Functional test cases;





-Signal builder input signal;

-Data Inspector Output;

-SIL Model;

-Code Generation Report;

-Data Inspector Output;

-Open the model>>Select 'Test Generation'>>Then 'Test generation setting'>> 'Advisor'>>Then 'Generate Test';





-Code Reports;
/*
* File: TFT_Cluster_Speedometer_SWC.c
*
* Code generated for Simulink model 'TFT_Cluster_Speedometer_SWC'.
*
* Model version : 1.16
* Simulink Coder version : 9.5 (R2021a) 14-Nov-2020
* C/C++ source code generated on : Wed June 7 15:52:51 2023
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "TFT_Cluster_Speedometer_SWC.h"
#include "TFT_Cluster_Speedometer_SWC_private.h"
/* Exported data definition */
/* Definition for custom storage class: ExportToFile */
uint16_T Out_VehicleSpeedDisplay; /* '/Switch' */
/* Definition for custom storage class: Localizable */
static uint16_T DisplaySpeed1; /* '/Subtract' */
static uint16_T DisplaySpeed_Filter; /* '/Subtract' */
/* Previous zero-crossings (trigger) states */
PrevZCX_TFT_Cluster_Speedomet_T TFT_Cluster_Speedometer_PrevZCX;
/* Real-time model */
static RT_MODEL_TFT_Cluster_Speedome_T TFT_Cluster_Speedometer_SWC_M_;
RT_MODEL_TFT_Cluster_Speedome_T *const TFT_Cluster_Speedometer_SWC_M =
&TFT_Cluster_Speedometer_SWC_M_;
int32_T div_s32_floor(int32_T numerator, int32_T denominator)
{
int32_T quotient;
uint32_T absDenominator;
uint32_T absNumerator;
uint32_T tempAbsQuotient;
boolean_T quotientNeedsNegation;
if (denominator == 0) {
quotient = numerator >= 0 ? MAX_int32_T : MIN_int32_T;
/* Divide by zero handler */
} else {
absNumerator = numerator < 0 ? ~(uint32_T)numerator + 1U : (uint32_T)
numerator;
absDenominator = denominator < 0 ? ~(uint32_T)denominator + 1U : (uint32_T)
denominator;
quotientNeedsNegation = ((numerator < 0) != (denominator < 0));
tempAbsQuotient = absNumerator / absDenominator;
if (quotientNeedsNegation) {
absNumerator %= absDenominator;
if (absNumerator > 0U) {
tempAbsQuotient++;
}
}
quotient = quotientNeedsNegation ? -(int32_T)tempAbsQuotient : (int32_T)
tempAbsQuotient;
}
return quotient;
}
/* Model step function */
void TFT_Cluster_Speedometer_SWC_step(void)
{
/* local block i/o variables */
uint16_T DisplaySpeed;
int32_T tmp_0;
uint32_T tmp;
uint16_T tmp_1;
boolean_T rtb_Compare;
/* Saturate: '/Saturation' incorporates:
* Inport: '/Avg_VehicleSpeed'
*/
tmp = (uint32_T)Avg_VehicleSpeed << 1;
if (tmp >= 64000U) {
/* Saturate: '/Saturation' */
DisplaySpeed = 64000U;
} else if (tmp <= 512U) {
/* Saturate: '/Saturation' */
DisplaySpeed = 512U;
} else {
/* Saturate: '/Saturation' */
DisplaySpeed = (uint16_T)(Avg_VehicleSpeed << 1);
}
/* End of Saturate: '/Saturation' */
/* RelationalOperator: '/Compare' incorporates:
* Constant: '/Constant'
* Inport: '/Time_Input'
* Math: '/Rem'
*/
rtb_Compare = ((uint16_T)(Time_Input % 10) == 0);
-Make code generation setting as below and built the model for code and generates the code using auto code generation;


-Open the polyspace app>>Click on 'Start a New project>>Then link to a source file>>Select 'Bug Finder>>and make configuration setting as below and then save and Run Bug Finder;






-Result:

-For Code Prover;
-Keeping above setting as same and select 'Code prover' and make following configuration setting then save and Run the code prover;


-Result:

Note:Here we are not getting the proper result due to the unavailability of licence version for polyspace


-Go to the Requirement;

-Click on 'System under test';

-Click on 'Input';(Input Mapping)

-Click on 'Baseline Criteria';

-Click on 'Coverage setting';

-Then save and Run the Test;
-
-Baseline criteria results;

-Baseline test Result Reports;





-Then select tset location and test will be generated as below,
-Generated MIL And SIL model;
-Then Go to Requirements;

-Check Simulation1;

-Check Simulation2;

-Click On Inputs;

-Click on Coverage setting;

-Then Save and Run;
-For iteration1;

-For Iteration2;

Note: We can see results and output of others in following attached report pdf.
-Report;

